openmp with multi-user environment

General OpenMP discussion

openmp with multi-user environment

Postby mike165 » Fri Apr 26, 2013 5:12 am

All,

A couple of questions.

i have an application that is run on a system that is shared by many users. Each user can open up their own instance of the application and run it. The application is implemented with OpenMP.


Let's say that the system has a total of 32 threads.
1) I assume that it is better to set the OpenMP schedule to Dynamic rather than Static for multi-user environment? Do you have any other suggestions for the implementation?
2) Is it ok to assign each instance of the application to utilize all 32 threads, and let the OS manage the threads if the application is run simultaneously? Or is it better to try to lower the number of threads used by each user to a lower value?

Thanks!
mike165
 
Posts: 2
Joined: Thu Apr 25, 2013 1:14 pm

Re: openmp with multi-user environment

Postby MarkB » Fri Apr 26, 2013 8:47 am

mike165 wrote:1) I assume that it is better to set the OpenMP schedule to Dynamic rather than Static for multi-user environment? Do you have any other suggestions for the implementation?


Yes, that would make sense, though you should avoid small chunk sizes if there are a large number of iterations which don't take much time each.


mike165 wrote:2) Is it ok to assign each instance of the application to utilize all 32 threads, and let the OS manage the threads if the application is run simultaneously? Or is it better to try to lower the number of threads used by each user to a lower value?


One option is to set OMP_DYNAMIC=true (or call omp_set_dynamic(1) ) which permits the run time to use fewer threads than the user requests for parallel regions if the system is overloaded. In general, having many more threads than cores will be detrimental to performance.

Hope that helps,
Mark.
MarkB
 
Posts: 452
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: openmp with multi-user environment

Postby mike165 » Fri Apr 26, 2013 9:01 am

Thanks for the reply.

Perhaps a dumb question, but is setting the Pragma's schedule to Dynamic different than omp_set_dynamic(1) or setting the environment variable OMP_DYNAMIC=true?

also, if there are more threads than cores, does OpenMP use the primary threads on each core first? or is that up to the OS to determine which threads of which cores are executed by diff. applications at the same? in general, i would assume that the primary threads on each core are used up first, then if another user tries to run their application, they might get mostly secondary threads? Or are they redistributed?

btw, if it matters, i am running in a unix (solaris 10) environment.


Thanks!
mike165
 
Posts: 2
Joined: Thu Apr 25, 2013 1:14 pm

Re: openmp with multi-user environment

Postby MarkB » Fri Apr 26, 2013 9:17 am

mike165 wrote:Perhaps a dumb question, but is setting the Pragma's schedule to Dynamic different than omp_set_dynamic(1) or setting the environment variable OMP_DYNAMIC=true?


They are completely different and independent, despite (confusingly) both using the term "dynamic"! Setting the schedule kind to dynamic means that loop iterations are assigned to threads on a first-come-first-served basis. Calling omp_set_dynamic(1) or setting the environment variable OMP_DYNAMIC=true allows the runtime to choose how many threads to use for a parallel region: it is allowed to use fewer than requested by OMP_NUM_THREADS or omp_set_num_threads(), but not more.

mike165 wrote:also, if there are more threads than cores, does OpenMP use the primary threads on each core first? or is that up to the OS to determine which threads of which cores are executed by diff. applications at the same? in general, i would assume that the primary threads on each core are used up first, then if another user tries to run their application, they might get mostly secondary threads? Or are they redistributed?


In current versions of OpenMP the scheduling of OpenMP threads to hardware threads/cores is up to the OS. Under Solaris, you can control this to some degree, for example by setting SUNW_MP_PROCBIND. In future versions of OpenMP, there will be a standard mechanism for binding threads to hardware threads/cores/sockets etc.

mike165 wrote:Thanks!


You're welcome!
MarkB
 
Posts: 452
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh


Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 12 guests