- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
At the beginning of "main" in your program (before using any Cilk keywords), try executing the folllowing call, and see if it addresses your problem.
__cilkrts_set_param("stack size", "2000000");
That should set the default size of all of the stacks that Cilk creates to approximately 2 MB.
Note that the Cilk runtime creates more than P stacks on amachine with P worker threadsbecause of the way the scheduler works, so use with caution.
Cheers,
Jim
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Intel Cilk Plus doesn't work that way.
"cilk_spawn" is a terrible keyword. Except we never found a better one. The cilk_spawn keyword tells the runtime that the continuation (the code after the spawned function) may be stolen by another worker and run in parallel with the spawned function. It gives permission for parallelism. It does not command it. The Cilk runtime does not create a thread in response to the cilk_spawn keyword.
When the runtime steals a continuation, it needs a stack to run it on. So it creates a stack, transfersonto the new stack,and starts executing the continuation. When the two strands sync, you continue executing on the leftmost stack; the one that you entered the function on.
You can set the size of the stacks that the Cilk runtime will create, both when threads are created and when the runtime creates these extra stacks. But a stack may move between threads. You don't have control on a per-thread basis.
- Barry
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
At the beginning of "main" in your program (before using any Cilk keywords), try executing the folllowing call, and see if it addresses your problem.
__cilkrts_set_param("stack size", "2000000");
That should set the default size of all of the stacks that Cilk creates to approximately 2 MB.
Note that the Cilk runtime creates more than P stacks on amachine with P worker threadsbecause of the way the scheduler works, so use with caution.
Cheers,
Jim
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
On Windows, the default is taken from the value set by the /STACK linker option for the executable (the .exe file). If not specified, the Windows linker defaults to 1MB.
As Jim noted, you can override these defaultsusing __cilkrts_set_param().
- Barry
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla