- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
