I have access to a linux cluster server. I have 10 CPUs at my disposal at any given time. The server is running GAUSS11, which I access through Putty. I would like to know if it is possible to have multiple instances of GAUSS (TGAUSS) running at the same time, each assigned its own cpu.
I am currently facing the same issue, but I haven't had any luck yet. I assume you want to run Gauss in the background, i.e. using the nohup command, right? If anyone can help with this, I would also be very interested. Thanks.
Using 'taskset' (located in the util-linux package) on a Linux server can achieve the desired results. For example, on a multi-threaded CPU with 8 cores:
taskset -c 0,1 ./tgauss -b prg1.e & taskset -c 2,3 ./tgauss -b prg2.e & taskset -c 4,5 ./tgauss -b prg3.e & taskset -c 6,7 ./tgauss -b prg4.e &
Would launch 4 separate instances of tgauss in the background each having access to their own cores (2 each). You can verify current process affinity with:
[email protected]:~/gauss16$ taskset -cp $(pgrep tgauss) pid 8784's current affinity list: 0,1
We can break down the first command even further:
taskset -c 0,1 ./tgauss -b prg1.e &
taskset -c 0,1
- Use taskset to assign CPU affinity to cores 0,1. Valid core values are from 0-(N-1) where N is the number of cores.
./tgauss -b prg1.e
- Execute tgauss in batch mode (run and exit) with prg1.e as the program to run
&specifies to run the process in the background
As an addition to Nks' question, prepending '
nohup' to the entire command would cause it to run in the background even if the current user logs out. Since '
nohup' directs all output to /dev/null, another valid option is to use 'screen' or 'tmux' for continued execution if at some point you wish to view the print output.
Thanks for the answer, it works brilliantly for me except the nohup command does not seem to work. Specifically, I run the command:
nohup taskset -c 0 tgauss -b myprog1.src> myprog1.out &
then I log out, but when I login again (10 seconds later) the process has been killed (ps returns nothing).
Am I doing something wrong (I know this is the most probable answer)?
Many thanks to all of you!!! Problem solved. Unfortunately I cannot help Nks issue about nohup command.
My bad, the processes were actually running, I forgot to add the -a option to 'ps' (or maybe use 'top'). Everything sorted for me! Thanks!