Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] Program does not finish after MPI_Finalize()
From: Yves Caniou (yves.caniou_at_[hidden])
Date: 2010-05-24 02:15:59


Dear All,
(follows a previous mail)

I don't understand the strange behavior of this small code: sometimes it ends, sometimes not.
The output of MPI_Finalized is 1 (for each processes if n>1), but the code doesn't end. I am forced to use Ctrl-C.

I compiled it with the command line:
"mpicc --std=c99" / gcc is 4.5, on a Quad-Core AMD Opteron(tm) Processor 8356
"mpiexec -n 1 a.out" or "mpiexec -n 2 a.out" to run the code.
"ps aux" returns that the program is in Sl+ state.

Sometimes, I can see also a line like this:
p10015 6892 0.1 0.0 43376 1828 ? Ssl 14:50 0:00 orted --hnp --set-sid --report-uri 8 --singleton-died-pipe 9

Is this a bug? Do I do something wrong?
If you have any tips...
Thank you.

---------
#include "stdio.h"
#include "mpi.h"

int
main(int argc, char *argv[])
{
  int my_num, mpi_size ;
  int flag ;

  MPI_Init(&argc, &argv) ;

  MPI_Comm_rank(MPI_COMM_WORLD, &my_num);
  printf("%d calls MPI_Finalize()\n\n\n", my_num) ;

  MPI_Finalize() ;

  MPI_Finalized(&flag) ;
  printf("MPI finalized: %d\n", flag) ;
  return 0 ;
}
-------

-- 
Yves Caniou
Associate Professor at Université Lyon 1,
Member of the team project INRIA GRAAL in the LIP ENS-Lyon,
Délégation CNRS in Japan French Laboratory of Informatics (JFLI),
  * in Information Technology Center, The University of Tokyo,
    2-11-16 Yayoi, Bunkyo-ku, Tokyo 113-8658, Japan
    tel: +81-3-5841-0540
  * in National Institute of Informatics
    2-1-2 Hitotsubashi, Chiyoda-ku, Tokyo 101-8430, Japan
    tel: +81-3-4212-2412 
http://graal.ens-lyon.fr/~ycaniou/