Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] Passing a structure to starpu insert task

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] Passing a structure to starpu insert task


Chronologique Discussions 
  • From: Amani Alonazi <amani.alonazi@kaust.edu.sa>
  • To: Hatem Ltaief <hatem.ltaief@kaust.edu.sa>
  • Cc: starpu-devel@lists.gforge.inria.fr
  • Subject: Re: [Starpu-devel] Passing a structure to starpu insert task
  • Date: Sun, 14 Oct 2018 18:28:21 +0300
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=amani.alonazi@kaust.edu.sa; spf=Pass smtp.mailfrom=amani.alonazi@kaust.edu.sa; spf=None smtp.helo=postmaster@mail-ed1-f52.google.com
  • Ironport-phdr: 9a23:4N2jVBVJMQCPcU3pj2F5G3Tje5LV8LGtZVwlr6E/grcLSJyIuqrYbBGDt8tkgFKBZ4jH8fUM07OQ7/i/HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba9wIRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KpwVhTmlDkIOCI48GHPi8x/kqRboA66pxdix4LYeZyZOOZicq/Ye94RWGhPUdtLVyFZDYy8YYkAAeoPM+hbsofzuUcBoACkCgWwHu7i0CNEimP00KA8zu8vERvG3AslH98WrHnUqc/6NKETUeuo0KTIyTLDb/VM1jb86YjDbxcsruuJXb1qd8rRyFMjGBnBjlWXr4zqJTKU1uUWvmiY9eVgSPmvi3I9pw5vvzev290gipLTiY8MzF3P6Ct3wIEwJdKiSU57Z8apEJhKuCGHLIt2XtkuTH91tyYn0LEGooS0cS4Xw5ok3x7Sc+KLf5SM7x75V+ucIS10iGx5dL+8nRq/8Vasx+vhXceuyllKtDBKktzUu3ANyRPT7s+HR+N4/ki72DaP0xnf5f9ZLkwpjKbbJZ4szqAqmpoctkTDGSD2mEHog6OMakok/e2o5/zmYrXguJCcK5d5hh/iPqkqgMCyAuQ1PhIQU2SH+umwzr3u8VPhTLVPlPI2k63ZsJ7AJcQco660GxVa0oM55Ba5Djeqys4XnX0ALFJDYh2GjonpNkrNIP/iEPe/mEisnC11yP/bI73tGI7NIWLbnLf7Ybl981JcyBY0zd1H/JJUFqsOIOjrWk/srdDXEwE2MxKqzObjE9h90oIeWXmTAq+CKq/SvlGI5uU1I+mDeoAZojf9K/4/5/7vl3A1g1EdfbP6lacQPVCxAvlja2GFaHvhjJ9VEW4Wsw94SPDjiVCMeT1aem2uGa8w+3cgAdT1I53EQ9WEhbWH3W+SGppQb3JHQgSFFH7udsONX/AKYTCTCsxojycYE7WtVsk63Ef950fB17N7I7+MqWUjvpX52Y0wvrWLzEBgxXlPF82Yllq1YSRxl2IMSSUx2fkj809010yfl6V0nrpDHI4Kvq8bYkIBLZfZitdCJZXqQAuYIoWKQUu9XpOrDSx3Vdtjm4ZTMXY4IM2ri1X45wTvA7IRkObWVpk986aZ0nSoYsggkTDJ064ui1RgScxKZzWr
  • List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel/>
  • List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>

Dear StarPU dev,

I have a question about passing a struct to StarPU codelet. If I pass it by reference to my function, I got Segmentation-fault error.
MORSE_Task_x(..., mystruct* s){ ...
 starpu_insert_task(
      starpu_mpi_codelet(codelet),
      ...
      STARPU_VALUE, s, sizeof(mystruct),
      ...
      0);
}

Thread 8 "CPU 0" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdaffd700 (LWP 27333)]
0x00007ffff7547dd9 in _starpu_job_get_data_size (model=0x300000001, arch=0x7ffff791ee50 <_starpu_config+4784>, impl=0, j=0x970d60) at core/perfmodel/perfmodel_history.c:198
198        if (model && model->state->per_arch && comb != -1 && model->state->per_arch[comb] && model->state->per_arch[comb][impl].size_base)
(gdb) bt
#0  0x00007ffff7547dd9 in _starpu_job_get_data_size (model=0x300000001, arch=0x7ffff791ee50 <_starpu_config+4784>, impl=0, j=0x970d60) at core/perfmodel/perfmodel_history.c:198
#1  0x00007ffff758f5ef in _starpu_driver_end_job (worker=0x7ffff791ee08 <_starpu_config+4712>, j=0x970d60, perf_arch=0x7ffff791ee50 <_starpu_config+4784>, rank=0, profiling=0) at drivers/driver_common/driver_common.c:131
#2  0x00007ffff76337fd in execute_job_on_cpu (j=0x970d60, worker_task=0x970910, cpu_args=0x7ffff791ee08 <_starpu_config+4712>, rank=0, perf_arch=0x7ffff791ee50 <_starpu_config+4784>) at drivers/cpu/driver_cpu.c:122
#3  0x00007ffff76345de in _starpu_cpu_driver_run_once (cpu_worker=0x7ffff791ee08 <_starpu_config+4712>) at drivers/cpu/driver_cpu.c:307
#4  0x00007ffff763495a in _starpu_cpu_worker (arg=0x7ffff791ee08 <_starpu_config+4712>) at drivers/cpu/driver_cpu.c:368
#5  0x00007fffedd826ba in start_thread (arg=0x7fffdaffd700) at pthread_create.c:333
#6  0x00007fffec86441d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

However, if I pass it by value, the problem is solved. Am I missing something?

Thanks,
Amani


On Wed, May 2, 2018 at 9:41 PM Hatem Ltaief <hatem.ltaief@kaust.edu.sa> wrote:
solved, thx!
H
> On May 1, 2018, at 12:56 PM, Samuel Thibault <samuel.thibault@inria.fr> wrote:
>
> Hatem Ltaief, le mar. 01 mai 2018 09:54:44 +0000, a ecrit:
>> I am trying to pass a single data structure (composed of int, float, etc...) to a starpu insert task API using STARPU_VALUE. Is that the right way to do it for data structures?
>
> You can pass both the pointer to the structure and the size of the
> structure, yes.
>
> Samuel



--
Amani AlOnazi
PhD Student
Extreme Computing Research Center

King Abdullah University of Science and Technology
Al-Khawarizmi (Bldg.1)
Floor 0, Office 0203-WS02

Telephone: +966 (12) 808 0218
Mobile: +966 (0) 555191795
Email: amani.alonazi@kaust.edu.sa

www.kaust.edu.sa


This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.


Archives gérées par MHonArc 2.6.19+.

Haut de le page