master and Single

General OpenMP discussion

master and Single

Postby rashmi_k28 » Mon Mar 17, 2008 12:27 am

master is to force the thread to be handled by master thread.

In which case this is used

Re: master and Single

Postby ejd » Mon Mar 17, 2008 7:17 am

You essentially asked the same question under your profiling query. In any case, single by default has an implicit barrier while master doesn't. If you don't care which thread executes a region of code, then use single (possibly with a nowait). When OpenMP was originally designed, I believe this had more reason for existence. Now I can't really give a good example for needing it. However, the master thread is different than the others, in that it is the one that forms the team and lives on beyond the region, so there may be times a user might want to be able to distinguish it from the rest.
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 6 guests