2

I do not know if I perhaps understand this incorrectly. But here is what I want to achieve with OpenMPI in particular just starting with mpirun:

  • I want to create a single process using the -np parameter that specifies the world size as 1
  • I then want to set the universe size to some arbitrary number (for argument sake 10), how do I do this?

The following two commands:

  • MPI_Comm_size(MPI_COMM_WORLD, &world_size);
  • MPI_Attr_get(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &universe_size, &flag);

yield the output of world_size as 1 and universe_size as 1.

alfC
  • 14,261
  • 4
  • 67
  • 118
Arne Schreuder
  • 173
  • 1
  • 1
  • 12

1 Answers1

3

Ok, so I found 2 ways of doing this:

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

Thank you for anyone that looked at this.

Arne Schreuder
  • 173
  • 1
  • 1
  • 12
  • There should be a better way. For instance, in mpich (and its derivaties, such as Intel MPI) you can set an option on mpiexec: https://wiki.mpich.org/mpich/index.php/Proposed_MPIEXEC_Extensions Sorry, I don't speak OpenMPI, but I'm sure they have something similar. – Victor Eijkhout Oct 28 '19 at 16:11