I am trying to execute two processes at the same time on a VPS which has 16 cores and I'd like each job to utilize 8 cores each and max out the number of available cores.

So I thought that I could just execute two separate processes as such:

$ mpirun -np 8 pmemd.MPI -O -i input_proc1.in -o output_proc1.out
$ mpirun -np 8 pmemd.MPI -O -i input_proc2.in -o output_proc2.out

In my mind this would put process 1 on cores 1-8 and process 2 on cores 9-16 though this was obviously not the case. Checking the htop output shows both these processes crowding over cores 1-8 leaving 8 cores not being utilised.

I am running these in the background buy placing a series of mpirun commands in a file in two separate folders and running each as such:

$ nohup ./runscript.sh < /dev/null > /dev/null 2>&1 &

To have them run in the background after I log out as each series of processes I need to run can take days to finish.

I figure you should be able to somehow "reserve" 8 cores (1-8) for one task and then when launching the next task which should then be forced to utilize the remaining 8 cores though I have yet managed to achieve the desired behavior using --bind-to options. I am not sure if this is related to the system being an OpenStack VPS machine or if I am just not doing it right.

I am using mpirun (Open MPI) 2.1.1 on a Ubuntu VPS running Ubuntu 18.04.2 LTS.

Any feedback or suggestions towards reaching the desired behavior would be gratefully appreciated

Best regards

1 Answer 1


So after digging around quite a bit I found an answer to my problem on stack overflow. For my purposes I apt-get installed hwloc to map out the available cores using lstopo -p and then running my commands as:

$ nohup mpirun --cpu-set 0-7 --bind-to core -np 8 pmemd.MPI [arguments]
$ nohup mpirun --cpu-set 8-15 --bind-to core -np 8 pmemd.MPI [arguments]

and this successfully distributed the first task over the first 8 cores and the second task over the remaining 8 cores utilizing all the available 16 cores fully.

I thought I'd post the answer here as well in case someone stumbles upon this question in the future.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .