/* * * PROGRAM TEST for MPI_COMM_SPAWN_MULTIPLE * * prototype program that simulate the spawn process needed for the SJI MT Domain Manager * the manager must be executed with the exec command of the worker as first input parameter * * updated to the OpenMPI-1.4.0 * * * program MASTER * * Author: Federico Golfre' Andreasi * Created: 28/01/2010 * */ #include "mpi.h" #include using namespace std; int main ( int argc, char* argv[] ) { int rank,size; char local_host[MPI_MAX_PROCESSOR_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,&rank); MPI_Comm_size(MPI_COMM_WORLD,&size); if (rank==0) cout<<"\n***** MASTER (SPAWNING) ****\n"; MPI_Barrier(MPI_COMM_WORLD); // Get the name of the host MPI_Get_processor_name(local_host,&local_host_len); cout<<" Rank "<