[mpich-discuss] need help to run hybrid code

Halim Amer aamer at anl.gov
Mon Aug 14 14:03:44 CDT 2017


If you are running with multiple processes per node, then pass 
"--bind-to core:6" or "--bind-to hwthread:6" if you have more than one 
hardware thread per core and you want to map them to OpenMP threads.

If your intention is to have only one MPI process per node, then make 
sure it is the case (e.g., by checking the hostname of each process).

Also, I don't understand what you mean by virtual threads, but if you 
meant over-subscribing the same hardware thread with multiple OpenMP 
threads, then make sure you have at least 6 hardware threads available 
for each MPI process and use OpenMP CPU affinity hints (OMP_PROC_BIND 
for OpenMP >= 4, or GOMP_CPU_AFFINIty/KMP_AFFINITY depending on your 
compiler).

Halim
www.mcs.anl.gov/~aamer

On 8/14/17 12:14 PM, Pasha Pashaei wrote:
> Dear Colleague
> Hi
> I am working on hybrid MPI -OpenMp code and face with a problem. I can
> not run the code as the way that I want.
> I can run pure mpi code and also pure openmp code, but not hybrid one.
> I used "export OMP_NUM_THREADS=6" and then "mpirun -np 4 ./hybrid.exe >
> output.txt"
> It run but I noticed that It used only virtual threads of  CPUs not
> physical threads.
> I have both OpenMpi and Mpich  on my computer.
> My problem is I want to use mpi for communication between nodes and
> sockets and Openmp for cores which are inside of sockets and nodes, I do
> not know how to pin cpu to each other in each socket and nodes. I could
> find some material on internet such as
> https://aciref.org/how-to-gain-hybrid-mpi-openmp-code-performance-without-changing-a-line-of-code-a-k-a-dealing-with-task-affinity/
> How to gain hybrid MPI-OpenMP code performance without
> ...<https://aciref.org/how-to-gain-hybrid-mpi-openmp-code-performance-without-changing-a-line-of-code-a-k-a-dealing-with-task-affinity/>
> aciref.org
> How to gain hybrid MPI-OpenMP code performance without changing a line
> of code a.k.a. dealing with task affinity
> But it did not work, I think I need a PBS file to assign those commands
> on my grid with qsub command.
> If you need more information please let me know.
> I am looking forward to hearing from you,
> Best regards.
>
>
> Pasha Pashaei
>
>
>
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list