OpenMPI mpirun universe size

I do not know if I can get it wrong. But here is what I want to achieve with OpenMPI, in particular, only starting with mpirun:

  • I want to create one process using the -np parameter, which defines the size of the world as 1
  • Then I want to set the size of the universe to some arbitrary number (for the sake 10 parameter), how to do this?

The following two commands:

  • MPI_Comm_size (MPI_COMM_WORLD, & world_size);
  • MPI_Attr_get (MPI_COMM_WORLD, MPI_UNIVERSE_SIZE and user_size, & amp; flag);

prints the result of world_size as 1 and univers_size as 1.

Thank you so much for your help.

+1
source share
1 answer

Ok, so I found two ways to do this:

  • Implicit: mpirun -np 1 -H localhost, localhost, ..., localhost executable
  • Explicit: just assign a value to the universe in the application itself, it will work fine.

Thanks to everyone who looked at this.

+2
source

Source: https://habr.com/ru/post/1689192/


All Articles