92
edits
Changes
→Case B - Using the Parallel Stacks Window
In the above code, the main program calls functions that may themselves call other functions. At each cilk_spawn keyword, we can expect a new child thread to call the function. However, if the function calls have very short operations each, then the different spawns may not even be distributed to different child threads, since each function call may take very fast. That was originally the case, where all of the function calls were done by one thread. Therefore, the functions were adjusted to sleep for 1 second within the function itself. This way, the functions took long enough so that the program did spawn into multiple child threads. The Parallel Stacks window allows us to see the call stack information for all active threads at any point in our program.
Setup:
1. Put a breakpoint at all function calls, all function definitions, cilk_sync, and cilk_for.<br/>
2. To be able to see more detailed debug info in the Parallel Stacks Window, go to Debug > Options, and under Debugging > General uncheck "Enable Just My Code", and under Debugging > Symbols put a checkmark on "Microsoft Symbol Servers".
Walkthrough:
Step 1)
==Case C==