# Efficiency on running multiple tasks on 1 gpu node

**URL:** <https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759>\
**Category:** User discussions\
**Tags:** mdrun\
**Created:** [July 5, 2023, 2:56am UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759 "2023-07-05T02:56:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![XiaSongyan](https://avatars.discourse-cdn.com/v4/letter/x/9de053/32.png) [@XiaSongyan](https://gromacs.bioexcel.eu/u/XiaSongyan)\
**Post date:** [July 5, 2023, 2:56am UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/1 "2023-07-05T02:56:49Z")

</div>

GROMACS version:GROMACS-2022.3  
GROMACS modification: No  
Dear gromacs community,  
I’m trying to submit multiple gromacs tasks on my cluster with 32 cores in one GPU node.  
However, the running efficencies seem to vary a lot between different tasks (0.6 h/ns to 6 h/ns)  
I’ve tried to detect what’s the difference between high efficiency task and low efficiency task via their log files and I found that in high efficiency task’s log file, I can see:  
**Running on 1 node with total 32 cores, 64 processing units, 1 compatible GPU**  
but in low efficiency tasks, the sentence will be:  
**Running on 1 node with total 32 cores, 32 processing units, 1 compatible GPU**

it seems the efficiency difference was caused by different number of processing units assigned to the task, but I’m using same mdrun command for all tasks:  
gmx mdrun -ntmpi 1 -ntomp 4 -deffnm us -v -nb gpu -bonded gpu -pme gpu

Any comments or suggestions are welcome,  
many thanks.  
XIA

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [July 5, 2023, 8:59am UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/2 "2023-07-05T08:59:23Z")

</div>

Hi XIA,

how many of these simulations (where each uses 4 threads) do you run on such a node?  
I would assume that a proper pinning strategy would lead to better performance.

Best,  
Carsten

---

<div class="post-metadata">

**Author:** ![XiaSongyan](https://avatars.discourse-cdn.com/v4/letter/x/9de053/32.png) [@XiaSongyan](https://gromacs.bioexcel.eu/u/XiaSongyan)\
**Post date:** [July 5, 2023, 9:38am UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/3 "2023-07-05T09:38:04Z")

</div>

Hi Carsten,  
I’m submitting 8 simulations to each node, I’ve also noticed that gromacs has warned me in the log file that  
**NOTE: The number of threads is not equal to the number of (logical) cpus**  
\*\* and the -pin option is set to auto: will not pin threads to cpus.\*\*  
\*\* This can lead to significant performance degradation.\*\*  
\*\* Consider using -pin on (and -pinoffset in case you run multiple jobs).\*\*

but I’m not sure how can i apply appropriate pinning strategies to those tasks, can u kindly give me some suggestions or examples to do that?

Regards,  
XIA

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [July 5, 2023, 12:08pm UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/4 "2023-07-05T12:08:30Z")

</div>

Hi XIA,

I find it easiest to let GROMACS do the proper pinning for me by starting all simulations at once in a multidir setting. For that, you will need an MPI-enabled `gmx` executable. Then you put your 8 individual input `.tpr` files in 8 separate directories, e.g. called `A B C D E F G` and `H`. Then you run

`mpirun -n 8 gmx_mpi mdrun -ntomp 4 -multidir A B C D E F G H -pin on -s topol.tpr ...`

The input files must all have the same name in the subdirectories, but this you can achieve, e.g. with symbolic links.

Best,  
Carsten

---

<div class="post-metadata">

**Author:** ![XiaSongyan](https://avatars.discourse-cdn.com/v4/letter/x/9de053/32.png) [@XiaSongyan](https://gromacs.bioexcel.eu/u/XiaSongyan)\
**Post date:** [July 5, 2023, 1:08pm UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/5 "2023-07-05T13:08:51Z")

</div>

Hi Carsten,  
I followed ur suggestion and submit tasks via multidir setting and the efficiencies of them seem good enough now, many thanks for ur kind suggestions and precious time.

Regards,  
XIA

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [July 5, 2023, 1:19pm UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/6 "2023-07-05T13:19:59Z")

</div>

You are welcome!

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [July 5, 2023, 4:35pm UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/7 "2023-07-05T16:35:03Z")

</div>

Hi XIA! Glad that your problem is solved!

Could you please share the output of `gmx_mpi -version` and the description of the hardware on your node? Does it use one of the recent Intel CPUs?

---

<div class="post-metadata">

**Author:** ![XiaSongyan](https://avatars.discourse-cdn.com/v4/letter/x/9de053/32.png) [@XiaSongyan](https://gromacs.bioexcel.eu/u/XiaSongyan)\
**Post date:** [July 6, 2023, 4:11am UTC](https://gromacs.bioexcel.eu/t/efficiency-on-running-multiple-tasks-on-1-gpu-node/6759/8 "2023-07-06T04:11:08Z")

</div>

Hi,  
My gmx\_mpi version is 2022.3 and CPU model in my node is Intel(R) Xeon(R) Gold 5218.

Regards,  
XIA
