Hi,

 

Does MPI_COMM_WORLD exist in any sense before MPI_Init is called? In particular, does this code violate the standard?

 

InitializeMyApp(MPI_Comm comm, int argc, char **argv)

{

  int initialized;

  MPI_Initialized(&initialized);

  if (!initialized) MPI_Init(&argc, &argv);

  /* call some function that uses comm */

}

 

int main(int argc, char **argv)

{

  MPI_Comm comm = MPI_COMM_WORLD;

  InitializeMyApp(comm, argc, argv);

     :

}

 

My instinct is that this is wrong, but I would like to be sure before I complain about it. It appears to work with some existing implementations, but it looks sketchy to me.

 

Bruce