2004-01-15 09:08:25 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-15 09:08:25 +03:00
|
|
|
|
2004-03-19 00:35:28 +03:00
|
|
|
#include "include/constants.h"
|
2004-08-14 05:56:05 +04:00
|
|
|
#include "mpi/runtime/mpiruntime.h"
|
|
|
|
#include "mpi/runtime/params.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "runtime/runtime.h"
|
2004-06-17 21:29:47 +04:00
|
|
|
#include "util/sys_info.h"
|
2004-07-01 18:49:54 +04:00
|
|
|
#include "util/proc_info.h"
|
2004-09-10 07:21:03 +04:00
|
|
|
#include "util/session_dir.h"
|
2004-01-15 09:08:25 +03:00
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "communicator/communicator.h"
|
|
|
|
#include "group/group.h"
|
2004-08-12 20:56:24 +04:00
|
|
|
#include "info/info.h"
|
2004-09-05 20:05:37 +04:00
|
|
|
#include "util/show_help.h"
|
2004-03-19 09:12:43 +03:00
|
|
|
#include "errhandler/errhandler.h"
|
2004-07-27 04:49:41 +04:00
|
|
|
#include "errhandler/errcode.h"
|
|
|
|
#include "errhandler/errclass.h"
|
|
|
|
#include "errhandler/errcode-internal.h"
|
2004-04-21 02:38:22 +04:00
|
|
|
#include "op/op.h"
|
2004-08-14 05:56:05 +04:00
|
|
|
#include "file/file.h"
|
|
|
|
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/base/base.h"
|
2004-06-17 20:23:34 +04:00
|
|
|
#include "mca/allocator/base/base.h"
|
|
|
|
#include "mca/allocator/allocator.h"
|
|
|
|
#include "mca/mpool/base/base.h"
|
|
|
|
#include "mca/mpool/mpool.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mca/ptl/ptl.h"
|
|
|
|
#include "mca/ptl/base/base.h"
|
|
|
|
#include "mca/pml/pml.h"
|
|
|
|
#include "mca/pml/base/base.h"
|
|
|
|
#include "mca/coll/coll.h"
|
|
|
|
#include "mca/coll/base/base.h"
|
2004-07-21 02:21:47 +04:00
|
|
|
#include "mca/topo/topo.h"
|
|
|
|
#include "mca/topo/base/base.h"
|
2004-08-14 05:56:05 +04:00
|
|
|
#include "mca/io/io.h"
|
|
|
|
#include "mca/io/base/base.h"
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
#include "mca/oob/base/base.h"
|
|
|
|
#include "mca/ns/base/base.h"
|
|
|
|
|
|
|
|
#include "runtime/runtime.h"
|
2004-01-15 09:08:25 +03:00
|
|
|
|
|
|
|
|
2004-02-05 04:52:56 +03:00
|
|
|
/*
|
|
|
|
* Global variables and symbols for the MPI layer
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
bool ompi_mpi_initialized = false;
|
|
|
|
bool ompi_mpi_finalized = false;
|
2004-08-12 20:56:24 +04:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
bool ompi_mpi_thread_multiple = false;
|
|
|
|
int ompi_mpi_thread_requested = MPI_THREAD_SINGLE;
|
|
|
|
int ompi_mpi_thread_provided = MPI_THREAD_SINGLE;
|
2004-02-05 04:52:56 +03:00
|
|
|
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
2004-01-15 09:08:25 +03:00
|
|
|
{
|
2004-08-14 05:56:05 +04:00
|
|
|
int ret, param;
|
2004-09-15 20:33:36 +04:00
|
|
|
mca_ns_base_jobid_t jobid;
|
|
|
|
mca_ns_base_vpid_t vpid;
|
2004-02-13 16:56:55 +03:00
|
|
|
bool allow_multi_user_threads;
|
|
|
|
bool have_hidden_threads;
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_proc_t** procs;
|
2004-03-03 19:44:41 +03:00
|
|
|
size_t nprocs;
|
2004-09-10 07:21:03 +04:00
|
|
|
char *error, *jobid_str, *procid_str;
|
2004-01-15 09:08:25 +03:00
|
|
|
|
2004-09-10 07:21:03 +04:00
|
|
|
/* Become an OMPI process */
|
2004-01-29 22:40:22 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_init(argc, argv))) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "ompi_init() failed";
|
|
|
|
goto error;
|
2004-02-13 16:56:55 +03:00
|
|
|
}
|
2004-01-15 09:08:25 +03:00
|
|
|
|
2004-02-13 16:56:55 +03:00
|
|
|
/* Open up the MCA */
|
2004-01-30 06:59:39 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = mca_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_base_open() failed";
|
|
|
|
goto error;
|
2004-02-14 01:33:30 +03:00
|
|
|
}
|
2004-01-30 06:59:39 +03:00
|
|
|
|
2004-02-13 16:56:55 +03:00
|
|
|
/* Join the run-time environment */
|
2004-08-29 13:05:14 +04:00
|
|
|
allow_multi_user_threads = true;
|
|
|
|
have_hidden_threads = false;
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_init_stage1(&allow_multi_user_threads,
|
|
|
|
&have_hidden_threads))) {
|
2004-09-10 07:21:03 +04:00
|
|
|
goto error;
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
}
|
|
|
|
|
2004-09-15 23:43:32 +04:00
|
|
|
/* parse environmental variables and fill corresponding info structures */
|
|
|
|
ompi_rte_parse_environ();
|
|
|
|
|
2004-09-15 20:33:36 +04:00
|
|
|
/* check for existing universe to join */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_universe_exists())) {
|
|
|
|
if (ompi_rte_debug_flag) {
|
|
|
|
ompi_output(0, "ompi_mpi_init: could not join existing universe");
|
|
|
|
}
|
|
|
|
}
|
2004-09-11 16:56:52 +04:00
|
|
|
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
/* start the rest of the rte */
|
2004-09-10 07:21:03 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_init_stage2(&allow_multi_user_threads,
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
&have_hidden_threads))) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_rte_init() failed";
|
|
|
|
goto error;
|
2004-02-13 16:56:55 +03:00
|
|
|
}
|
2004-01-15 09:08:25 +03:00
|
|
|
|
2004-09-10 07:21:03 +04:00
|
|
|
/***** SET MY NAME *****/
|
2004-09-11 16:56:52 +04:00
|
|
|
if (NULL != ompi_process_info.name) { /* should NOT have been previously set */
|
|
|
|
free(ompi_process_info.name);
|
2004-09-10 07:21:03 +04:00
|
|
|
}
|
2004-09-15 20:33:36 +04:00
|
|
|
if (NULL == ompi_rte_get_self()) { /* no name set in environment - must be singleton */
|
|
|
|
if (NULL == ompi_process_info.ns_replica) { /* couldn't join existing univ */
|
|
|
|
ompi_process_info.name = ompi_name_server.create_process_name(0,0,0);
|
|
|
|
} else { /* name server exists elsewhere - get a name for me */
|
|
|
|
jobid = ompi_name_server.create_jobid();
|
|
|
|
vpid = ompi_name_server.reserve_range(jobid, 1);
|
|
|
|
ompi_process_info.name = ompi_name_server.create_process_name(0, jobid, vpid);
|
|
|
|
}
|
|
|
|
} else { /* name set in environment - record it */
|
|
|
|
ompi_process_info.name = ompi_rte_get_self();
|
|
|
|
}
|
2004-09-10 07:21:03 +04:00
|
|
|
|
|
|
|
/* setup my session directory */
|
|
|
|
jobid_str = ompi_name_server.get_jobid_string(ompi_process_info.name);
|
|
|
|
procid_str = ompi_name_server.get_vpid_string(ompi_process_info.name);
|
|
|
|
|
|
|
|
if (ompi_rte_debug_flag) {
|
|
|
|
ompi_output(0, "[%d,%d,%d] setting up session dir with",
|
|
|
|
ompi_process_info.name->cellid,
|
|
|
|
ompi_process_info.name->jobid,
|
|
|
|
ompi_process_info.name->vpid);
|
|
|
|
if (NULL != ompi_process_info.tmpdir_base) {
|
|
|
|
ompi_output(0, "\ttmpdir %s", ompi_process_info.tmpdir_base);
|
|
|
|
}
|
|
|
|
ompi_output(0, "\tuniverse %s", ompi_process_info.my_universe);
|
|
|
|
ompi_output(0, "\tuser %s", ompi_system_info.user);
|
|
|
|
ompi_output(0, "\thost %s", ompi_system_info.nodename);
|
|
|
|
ompi_output(0, "\tjobid %s", jobid_str);
|
|
|
|
ompi_output(0, "\tprocid %s", procid_str);
|
|
|
|
}
|
|
|
|
if (OMPI_ERROR == ompi_session_dir(true,
|
|
|
|
ompi_process_info.tmpdir_base,
|
|
|
|
ompi_system_info.user,
|
|
|
|
ompi_system_info.nodename, NULL,
|
|
|
|
ompi_process_info.my_universe,
|
|
|
|
jobid_str, procid_str)) {
|
|
|
|
if (jobid_str != NULL) free(jobid_str);
|
|
|
|
if (procid_str != NULL) free(procid_str);
|
|
|
|
error = "session dir not found or created";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register my process info with my replica.
|
|
|
|
*/
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_register())) {
|
|
|
|
error = "ompi_rte_init: failed in ompi_rte_register()\n";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2004-09-14 18:21:04 +04:00
|
|
|
|
2004-09-10 07:21:03 +04:00
|
|
|
/* finalize the rte startup */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_init_finalstage(&allow_multi_user_threads,
|
|
|
|
&have_hidden_threads))) {
|
|
|
|
error = "mpi_init: failed in ompi_rte_init\n";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2004-09-14 18:21:04 +04:00
|
|
|
|
2004-08-14 05:56:05 +04:00
|
|
|
/* Once we've joined the RTE, see if any MCA parameters were
|
|
|
|
passed to the MPI level */
|
|
|
|
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_mpi_register_params())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_mpi_register_params() failed";
|
|
|
|
goto error;
|
2004-08-14 05:56:05 +04:00
|
|
|
}
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
/* initialize ompi procs */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_proc_init())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_proc_init() failed";
|
|
|
|
goto error;
|
2004-03-03 19:44:41 +03:00
|
|
|
}
|
|
|
|
|
2004-08-14 05:56:05 +04:00
|
|
|
/* Open up relevant MCA modules. */
|
|
|
|
|
2004-06-17 20:23:34 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = mca_allocator_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_allocator_base_open() failed";
|
|
|
|
goto error;
|
2004-06-17 20:23:34 +04:00
|
|
|
}
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_mpool_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_mpool_base_open() failed";
|
|
|
|
goto error;
|
2004-06-17 20:23:34 +04:00
|
|
|
}
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = mca_pml_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_pml_base_open() failed";
|
|
|
|
goto error;
|
2004-02-13 16:56:55 +03:00
|
|
|
}
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = mca_ptl_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_ptl_base_open() failed";
|
|
|
|
goto error;
|
2004-02-13 16:56:55 +03:00
|
|
|
}
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = mca_coll_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_coll_base_open() failed";
|
|
|
|
goto error;
|
2004-02-13 16:56:55 +03:00
|
|
|
}
|
2004-07-21 02:21:47 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = mca_topo_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_topo_base_open() failed";
|
|
|
|
goto error;
|
2004-08-14 05:56:05 +04:00
|
|
|
}
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_io_base_open())) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_io_base_open() failed";
|
|
|
|
goto error;
|
2004-07-21 02:21:47 +04:00
|
|
|
}
|
2004-01-30 06:59:39 +03:00
|
|
|
|
2004-02-13 16:56:55 +03:00
|
|
|
/* Select which pml, ptl, and coll modules to use, and determine the
|
2004-09-10 07:21:03 +04:00
|
|
|
final thread level */
|
2004-01-30 06:59:39 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS !=
|
2004-09-10 07:21:03 +04:00
|
|
|
(ret = mca_base_init_select_components(requested,
|
|
|
|
allow_multi_user_threads,
|
|
|
|
have_hidden_threads,
|
|
|
|
provided))) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "mca_base_init_select_components() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize info */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_info_init())) {
|
|
|
|
error = "ompi_info_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
/* initialize error handlers */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_errhandler_init())) {
|
|
|
|
error = "ompi_errhandler_init() failed";
|
|
|
|
goto error;
|
2004-02-13 16:56:55 +03:00
|
|
|
}
|
2004-01-30 06:59:39 +03:00
|
|
|
|
2004-09-05 20:05:37 +04:00
|
|
|
/* initialize error codes */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_mpi_errcode_init())) {
|
|
|
|
error = "ompi_mpi_errcode_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize error classes */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_errclass_init())) {
|
|
|
|
error = "ompi_errclass_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize internal error codes */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_errcode_intern_init())) {
|
|
|
|
error = "ompi_errcode_intern_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
2004-05-08 03:23:03 +04:00
|
|
|
|
2004-09-05 20:05:37 +04:00
|
|
|
/* initialize groups */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_group_init())) {
|
|
|
|
error = "ompi_group_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize attribute meta-data structure for comm/win/dtype */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_attr_init())) {
|
|
|
|
error = "ompi_attr_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize communicators */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_comm_init())) {
|
|
|
|
error = "ompi_comm_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize datatypes */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_ddt_init())) {
|
|
|
|
error = "ompi_ddt_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize ops */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_op_init())) {
|
|
|
|
error = "ompi_op_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize file handles */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_file_init())) {
|
|
|
|
error = "ompi_file_init() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* do module exchange */
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_base_modex_exchange())) {
|
|
|
|
error = "ompi_base_modex_exchange() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* add all ompi_proc_t's to PML */
|
|
|
|
if (NULL == (procs = ompi_proc_world(&nprocs))) {
|
|
|
|
error = "ompi_proc_world() failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_pml.pml_add_procs(procs, nprocs))) {
|
|
|
|
free(procs);
|
|
|
|
error = "PML add procs failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
free(procs);
|
|
|
|
|
|
|
|
/* start PTL's */
|
|
|
|
param = 1;
|
|
|
|
if (OMPI_SUCCESS !=
|
|
|
|
(ret = mca_pml.pml_control(MCA_PTL_ENABLE, ¶m, sizeof(param)))) {
|
|
|
|
error = "PML control failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* save the resulting thread levels */
|
2004-02-05 04:52:56 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_mpi_thread_requested = requested;
|
|
|
|
*provided = ompi_mpi_thread_provided;
|
2004-06-29 04:02:25 +04:00
|
|
|
ompi_mpi_thread_multiple = (ompi_mpi_thread_provided ==
|
|
|
|
MPI_THREAD_MULTIPLE);
|
2004-02-05 04:52:56 +03:00
|
|
|
|
2004-05-08 03:23:03 +04:00
|
|
|
/* Init coll for the comms */
|
|
|
|
|
2004-09-05 20:05:37 +04:00
|
|
|
if (OMPI_SUCCESS !=
|
|
|
|
(ret = mca_coll_base_comm_select(MPI_COMM_SELF, NULL))) {
|
|
|
|
error = "mca_coll_base_comm_select(MPI_COMM_SELF) failed";
|
|
|
|
goto error;
|
2004-07-13 16:35:43 +04:00
|
|
|
}
|
2004-05-08 03:23:03 +04:00
|
|
|
|
2004-09-05 20:05:37 +04:00
|
|
|
if (OMPI_SUCCESS !=
|
|
|
|
(ret = mca_coll_base_comm_select(MPI_COMM_WORLD, NULL))) {
|
|
|
|
error = "mca_coll_base_comm_select(MPI_COMM_WORLD) failed";
|
|
|
|
goto error;
|
2004-07-13 16:35:43 +04:00
|
|
|
}
|
2004-05-08 03:23:03 +04:00
|
|
|
|
|
|
|
/* Wait for everyone to initialize */
|
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
if (MPI_SUCCESS != (ret =
|
|
|
|
MPI_COMM_WORLD->c_coll.coll_barrier(MPI_COMM_WORLD))) {
|
2004-09-05 20:05:37 +04:00
|
|
|
error = "Barrier over MPI_COMM_WORLD failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
error:
|
|
|
|
if (ret != OMPI_SUCCESS) {
|
|
|
|
ompi_show_help("help-mpi-runtime",
|
|
|
|
"mpi_init:startup:internal-failure", true,
|
|
|
|
"MPI_INIT", "MPI_INIT", error, ret);
|
|
|
|
return ret;
|
2004-06-29 04:02:25 +04:00
|
|
|
}
|
2004-05-08 03:23:03 +04:00
|
|
|
|
2004-02-13 16:56:55 +03:00
|
|
|
/* All done */
|
2004-02-05 04:52:56 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_mpi_initialized = true;
|
|
|
|
ompi_mpi_finalized = false;
|
2004-02-13 16:56:55 +03:00
|
|
|
return MPI_SUCCESS;
|
2004-01-15 09:08:25 +03:00
|
|
|
}
|