Directive about discrete cores

General OpenMP discussion

Directive about discrete cores

Postby vkarageo » Thu Mar 07, 2013 2:16 am

How can i use discrete cores instead of discrete threads?
Is there any directive which shares undoubtedly work among discrete cores instead of discrete threads?
vkarageo
 
Posts: 2
Joined: Wed Mar 06, 2013 5:09 am

Re: Directive about discrete cores

Postby MarkB » Thu Mar 07, 2013 3:32 am

vkarageo wrote:Is there any directive which shares undoubtedly work among discrete cores instead of discrete threads?


Currently no, though this facility is planned for OpenMP 4.0.
Until then you need to use implementation-specific mechanisms: what compiler and OS are you working with?

Mark.
MarkB
 
Posts: 450
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Directive about discrete cores

Postby vkarageo » Thu Mar 07, 2013 9:20 am

Currently no, though this facility is planned for OpenMP 4.0.
Until then you need to use implementation-specific mechanisms: what compiler and OS are you working with?

Mark.


Ok, because i'm trying to find a way to use cores. But unfortunatly as i searched at the official OpenMP manual i didn't find any directive.
I use gfortran compiler and Windows 7 and 8. Could you suggest any example about "implementation-specific mechanisms"?
Thanks Mark.

V.K.
vkarageo
 
Posts: 2
Joined: Wed Mar 06, 2013 5:09 am

Re: Directive about discrete cores

Postby MarkB » Fri Mar 08, 2013 4:04 am

I don't think that gfortran on Windows gives you much support for doing this. Are you convinced that the OS scheduler is doing the wrong thing if the number of threads is less than the number of cores? As a last resort, you could try calling SetThreadAffinityMask(), but this would require writing a Fortran wrapper.
MarkB
 
Posts: 450
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Directive about discrete cores

Postby ftinetti » Sat Mar 09, 2013 8:53 am

Hi V.K.,

I use gfortran compiler and Windows 7 and 8. Could you suggest any example about "implementation-specific mechanisms"?


I think that on this installation you could use/play with GOMP_CPU_AFFINITY (http://gcc.gnu.org/onlinedocs/libgomp/G ... INITY.html). It would be "rather manual", but at least you would be able to experimentally confirm/invalidate several issues.

HTH,

Fernando.
ftinetti
 
Posts: 582
Joined: Wed Feb 10, 2010 2:44 pm

Re: Directive about discrete cores

Postby MarkB » Mon Mar 11, 2013 3:15 am

ftinetti wrote:I think that on this installation you could use/play with GOMP_CPU_AFFINITY


Ah, I was unsure whether this really works on Windows. If it does, then that's a much easier solution than the one I suggested.
MarkB
 
Posts: 450
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Directive about discrete cores

Postby ftinetti » Mon Mar 11, 2013 3:58 am

Hi Mark,

I think that on this installation you could use/play with GOMP_CPU_AFFINITY

Ah, I was unsure whether this really works on Windows. If it does, then that's a much easier solution than the one I suggested.

Actually, I didn't test, I assumed it works, since there is not any specific advice for Windows, but it should be tested anyway (that's the "I think" part of my post).

Fernando.
ftinetti
 
Posts: 582
Joined: Wed Feb 10, 2010 2:44 pm


Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 4 guests