0

I have access to some Linux Workstations on which I run my C++ executable files from my Laptop but the problem is that each time I run a job from the terminal in my laptop I have to keep a terminal window for each job ... I need a way to submit the job to the Linux machine and see the result once only after the execution finishes ... I know that this can be done in FORTRAN executable by adding & at the end only and I tried it with: mpirun -np 20 ./a 200 1000000& and mpirun -np 20 ./a 200 1000000 & but non of them is working ...

Is there anyway to do the same in Linux ??

4 Answers 4

2

How about using the screen command?

2

as other have said you can run them in screen or tmux. You can also look at nohup

  nohup mpirun -np 20 ./a 200 1000000 &  > output.log 2>&1   

Since without something like nohup you cannot exit the sessions with jobs running in the background, or they will stop running when the Shell sends a HUP signal.

1

Use tmux or the older screen to maintain a terminal session on the remote server, to which you can attach and detach at will. Check the documentation for each command for specifics.

0

I assume you have a lot of jobs and would like to have a queue onto which jobs can be placed. I would recommend using something like redis, but the screen/tmux method is pretty solid too.

You must log in to answer this question.

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