[StarCluster] OpenMP and Sun Grid Engine

Justin Riley jtriley at MIT.EDU
Tue Apr 19 00:31:49 EDT 2011


Hi Damian,

It's been a little while since I've played with OpenMP but from what I remember you need to set OMP_NUM_THREADS equal to the number of slots you allocate using the parallel environment. In theory, you should be able to use the same command:

$ qsub -pe orte X open-mp-script.sh [args]

And inside open-mp-script.sh you would need to export OMP_NUM_THREADS=$NSLOTS and then run your OpenMP binary like so:

$ cat open-mp-script.sh
export OMP_NUM_THREADS=$NSLOTS
...
/path/to/my/openmp/binary $*
....

Don't forget to make your binary executable (chmod +x <binary>). Let me know how this goes. If that doesn't work I'll look into this further.

HTH,

~Justin

On Apr 18, 2011, at 11:38 PM, Damian Eads wrote:

> Hi,
> 
> Last year, I was using MPI and it was suggested by Justin to use
> 
>     qsub -pe orte X mpi-job-script.sh [mpi job arguments]
> 
> to add an MPI job to the queue (where X is the number of slots for the job).
> 
> Now, my situation is slightly different. I am no longer using MPI but
> OpenMP (you know, #pragma parallel before certain for loops). What
> process manager should I use with Sun Grid Engine in this case? How
> would I specify how many slots the job should use?
> 
> Thank you in advance.
> 
> Kind regards,
> 
> Damian
> _______________________________________________
> StarCluster mailing list
> StarCluster at mit.edu
> http://mailman.mit.edu/mailman/listinfo/starcluster





More information about the StarCluster mailing list