The omp_serialize command serializes the execution of the next encountered parallel region for the current thread or for all threads in the current team. The serialization applies only to that one trip into the parallel region and does not persist.
Be sure you are in the right place in the program when you use this command. A logical place is just before a parallel directive.
Serialize the execution of the next encountered parallel region for the current thread.
If –team is specified, do this for all threads in the current team.