To determine whether a bug is caused by concurrency or whether it occurs within an algorithm, it is useful to serialize execution for OpenMP* parallel code regions and to restrict execution of these code regions to a single thread per region. You can serialize the code regions dynamically, so you do not need to recompile or restart the OpenMP* application.
When you enable serialization while the program is executing a parallel region, this region is not serialized — only subsequent regions are. When you disable serialization, only regions subsequent to the current location are set back to parallel. To serialize a selected region, it is useful to set breakpoints before and after the region. This helps you to enable serialization before the selected region is executed, and disable it before other parallel regions are executed. With this selective serialization, the rest of the application can remain parallel, which reduces execution time.
To serialize an OpenMP* parallel region:
You must enable serialization at the first breakpoint and disable serialization at the second breakpoint each time you want to run this same region serially.
Copyright © 2001-2011, Intel Corporation. All rights reserved.