void ompi_comm_spawn_f(char *command, char *argv, MPI_Fint *maxprocs, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *intercomm, MPI_Fint *array_of_errcodes, MPI_Fint *ierr, int cmd_len, int string_len) { MPI_Comm c_comm, c_new_comm; MPI_Info c_info; int size, c_ierr; int *c_errs; char **c_argv; char *c_command; OMPI_ARRAY_NAME_DECL(array_of_errcodes); c_comm = PMPI_Comm_f2c(*comm); c_info = PMPI_Info_f2c(*info); PMPI_Comm_size(c_comm, &size); ompi_fortran_string_f2c(command, cmd_len, &c_command); /* It's allowed to ignore the errcodes */ if (OMPI_IS_FORTRAN_ERRCODES_IGNORE(array_of_errcodes)) { c_errs = MPI_ERRCODES_IGNORE; } else { OMPI_ARRAY_FINT_2_INT_ALLOC(array_of_errcodes, size); c_errs = OMPI_ARRAY_NAME_CONVERT(array_of_errcodes); } /* It's allowed to have no argv */ if (OMPI_IS_FORTRAN_ARGV_NULL(argv)) { c_argv = MPI_ARGV_NULL; } else { ompi_fortran_argv_blank_f2c(argv, string_len, string_len, &c_argv); } c_ierr = PMPI_Comm_spawn(c_command, c_argv, OMPI_FINT_2_INT(*maxprocs), c_info, OMPI_FINT_2_INT(*root), c_comm, &c_new_comm, c_errs); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) { *intercomm = PMPI_Comm_c2f(c_new_comm); } free(c_command); if (MPI_ARGV_NULL != c_argv && NULL != c_argv) { opal_argv_free(c_argv); } if (!OMPI_IS_FORTRAN_ERRCODES_IGNORE(array_of_errcodes)) { OMPI_ARRAY_INT_2_FINT(array_of_errcodes, size); } else { OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_errcodes); } }
/** * Measurement wrapper for MPI_Comm_spawn * @note Auto-generated by wrapgen from template: comm_mgnt.w * @note C interface * @note Introduced with MPI 2.0 * @ingroup spawn */ int MPI_Comm_spawn(char* command, char* argv[], int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* newcomm, int array_of_errcodes[]) { const int event_gen_active = IS_EVENT_GEN_ON_FOR(SPAWN); int return_val; if (event_gen_active) { EVENT_GEN_OFF(); esd_enter(epk_mpi_regid[EPK__MPI_COMM_SPAWN]); } return_val = PMPI_Comm_spawn(command, argv, maxprocs, info, root, comm, newcomm, array_of_errcodes); if (*newcomm != MPI_COMM_NULL) { epk_comm_create(*newcomm); } if (event_gen_active) { esd_exit(epk_mpi_regid[EPK__MPI_COMM_SPAWN]); EVENT_GEN_ON(); } return return_val; }
int MPI_Comm_spawn( char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes){ return PMPI_Comm_spawn( command, argv, maxprocs, info, root, comm, intercomm, array_of_errcodes); }