The SINGLE directive specifies that the enclosed code is to be executed by only one thread in the team.
May be useful when dealing with sections of code that are not thread safe (such as I/O)
!$OMP SINGLE [clause ...] PRIVATE (list) FIRSTPRIVATE (list) block !$OMP END SINGLE [ NOWAIT ]
#pragma omp single [clause ...] newline private (list) firstprivate (list) nowait structured_block
Threads in the team that do not execute the SINGLE directive, wait at the end of the enclosed code block, unless a NOWAIT/nowait clause is specified.
Clauses are described in detail later, in the Data Scope Attribute Clauses section.
It is illegal to branch into or out of a SINGLE block.