/* * * TEST PROGRAM * for MPI_COMM_SPAWN_MULTIPLE * * The first argument of the master program in the exec filename of the slave * * program MASTER * * Author: Federico Golfrè Andreasi * Created: 18/08/2009 * */ #include #include "mpi.h" #define MAX_HOST_NAME 255 using namespace std; int main ( int argc, char* argv[] ) { int manager_rank,manager_size; char local_host[MAX_HOST_NAME]; int local_host_len; MPI_Comm intercomm; // *** MPI SESSION *** // Initialization of MPI session MPI_Init(&argc,&argv); // *** GET INFORMATION ABOUT THE WORLD COMMUNICATOR *** // Get the size and the rank within the comm MPI_Comm_rank(MPI_COMM_WORLD,&manager_rank); MPI_Comm_size(MPI_COMM_WORLD,&manager_size); if (manager_rank==0) cout<<"\n***** STARTING THE SPAWN TEST PROGRAM ****\n"; // Get the name of the host MPI_Get_processor_name(local_host,&local_host_len); cout<<" Rank "<