Replace Annotations with OpenMP* Code
- Add OpenMP code to provide appropriate synchronization of shared resources, using the LOCK annotations as a guide.Adding OpenMP Code to Synchronize the Shared Resources provides an overview of the following OpenMP synchronization techniques:
- Add code to create OpenMP tasks, using the SITE/TASK annotations as a guide.The following topics cover the OpenMP task creation options:
- Add appropriate synchronization of shared resources, using LOCK annotations as a guide.
- Test to verify you did not break anything, before adding the possibility of non-deterministic behavior with parallel tasks.
- Add code to create OpenMP parallel sections or equivalent, using the SITE/TASK annotations as a guide.
- Test with one thread to verify that your program still works correctly. For example, set the environment variableOMP_NUM_THREADSto 1 before you run your program.
- Test with more than one thread to see that the multithreading works as expected.
Serial C/C++ and Fortran Code with
Parallel C/C++ and Fortran Code using OpenMP