Mpi Spawn and Cray's Aprun
Suppose I Have a Master Program, Which Is Basically a 1 Rank Mpi Which Uses Mpi Spawn to Spawn 5 Worker Programs. Now, If I Execute My Master Using the...
Suppose I have a master program, which is basically a 1 rank mpi which uses MPI spawn to spawn 5 worker programs.
Now, if I execute my master using the following command
aprun -n 1 -N 1 master
The total number of ranks after spawning will be 6. But will all the 6 ranks be running on the same node? Is there anyway I can distribute the 6 among 3 nodes?
I can exactly one copy of the master process and 5 worker processes.
1 Answer
Cray MPI has not supported MPI_Comm_spawn until recently, and its solution to managing resources for spawned MPI jobs is unique. A place-holder job is launched using aprun to manage the resources used to host spawned jobs, i.e., the cores/nodes that will be hosting the spawned MPI ranks. The set of resources managed by the place-holder job is called a "rank pool", in analogy to a memory pool. Here's how you would set up and use a rank pool:
Must Read
rankpool.c
int main(int argc, char **argv) {
MPI_Init(&argc, &argv);
/* Name this rank pool "all_nodes", which will be
* used by MPI_Comm_spawn to identify it. */
MPIX_Comm_rankpool(MPI_COMM_WORLD, "all_nodes", /* 60 seconds timeout */ 60);
MPI_Finalize();
}