Results 1 to 6 of 6

Thread: Nohup problem with MPI and remote ssh

  1. #1

    Default Nohup problem with MPI and remote ssh

    I am trying to run an application on multiple processors using openMPI. The command is as follows:

    $mpirun -np 2 <executable>

    For all those unfamiliar with the mpirun-command: -np specifies the number of processors to be used.
    From time to time I log in using a remote machine and ssh. I can start my mpi-process normally. The downside is that I have to keep my remote terminal open and my remote machine running until the process is finished. I'd like to be able to log off and shut down the remote machine though.

    I tried using the nohup-command as follows:

    $nohup mpirun -np 2 <executable> > run.out &

    Which starts the process just fine (and writes the output to <run.out>). Once I close the terminal thought, the process is killed despite the 'nohup' command.

    I also tried

    $nohup bash -c "mpirun -np 2 <executable> > run.out" &

    and

    $nohup ksh -c "mpirun -np 2 <executable> > run.out" &

    Unfortunately without success.
    Can anyone help with this?
    Thanks!

  2. #2
    Join Date
    Jun 2008
    Location
    Praha, CZ, EU
    Posts
    26

    Default Re: Nohup problem with MPI and remote ssh

    Strange, nohup should work.

    In any case, try GNU Screen instead. Here's a cheat sheet. To emulate nohup, use:
    Code:
    $ screen
    % mpirun ...
    % Ctrl-A D
    $ exit

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,156

    Default Re: Nohup problem with MPI and remote ssh

    Indeed strange.

    Can you check, after you started and before you log out, if the parent PID of the mpirun program is 1? (it should be).
    Code:
    ps -ef | grep mpirun
    Henk van Velden

  4. #4

    Default Re: Nohup problem with MPI and remote ssh

    The $screen approach works fine.

    When I start the mpi-process with $mpirun I get
    [1] <process ID>

    Does that help?
    As the screen-command works fine for me, I can close this thread.

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,156

    Default Re: Nohup problem with MPI and remote ssh

    Quote Originally Posted by DIN1587 View Post
    The $screen approach works fine.

    When I start the mpi-process with $mpirun I get
    [1] <process ID>

    Does that help?
    As the screen-command works fine for me, I can close this thread.
    It should help you, not me.
    I did suggest a statement to you. When you have questions about the output of it, I am willing to look into it, but then you must:
    a) execute it
    b) post the output here (between CODE tags!).

    But as you are satisfied this is a bit academic now.
    Henk van Velden

  6. #6

    Default Re: Nohup problem with MPI and remote ssh

    Dear Henk,
    yes here is the result of the statement in my case. What should I do?

    $ nohup mpirun -np 4 ./c.e &
    [1] 19473
    $ nohup: ignorando entrada e anexando sada a "nohup.out"
    $ ps -ef |grep mpirun
    daniel 19473 18924 0 16:09 pts/11 00:00:00 mpirun -np 4 ./c.e
    daniel 19536 18924 0 16:10 pts/11 00:00:00 grep --color mpirun
    $

    Thank you very much,
    Daniel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •