37 MPI_Finalized(&finalized);
44 MPI_Abort(MPI_COMM_WORLD,1);
61 int requested = MPI_THREAD_MULTIPLE;
63 int err = MPI_Init_thread(
nullptr,
nullptr, requested , &provided);
64 if (err != MPI_SUCCESS ) {
69 if (provided >= requested) {
96 MPI_Comm_group( MPI_COMM_SELF, &self_group );
97 MPI_Comm_create( MPI_COMM_SELF, self_group, &
comm );
102 MPI_Get_processor_name(
unique_id, &length);
118 char*
port_name =
new char[port.length()+1];
119 memcpy(
port_name, port.c_str(), port.length());
125 MPI_Comm_set_errhandler(
comm, MPI_ERRORS_RETURN);
126 int err = MPI_Comm_connect(
port_name, MPI_INFO_NULL, 0,
comm, &intercomm );
127 MPI_Comm_set_errhandler(
comm, MPI_ERRORS_ARE_FATAL);
129 if (err != MPI_SUCCESS ) {
137 MPI_Intercomm_merge(intercomm, high, &
comm);
138 MPI_Comm_disconnect(&intercomm);
149 MPI_Comm intercomm, newintra;
150 MPI_Comm_accept(
port_name, MPI_INFO_NULL, 0,
comm, &intercomm );
157 MPI_Intercomm_merge(intercomm, high, &newintra);
158 MPI_Comm_disconnect(&intercomm);
159 MPI_Comm_disconnect(&
comm);
171 MPI_Comm_split(
comm, disconn,
rank(), &new_comm);
172 MPI_Comm_disconnect(&
comm);