1
1

Making topo component lazy load

This commit was SVN r4659.
Этот коммит содержится в:
Prabhanjan Kambadur 2005-03-03 22:42:10 +00:00
родитель 4c03e33a3c
Коммит cc3a8ec302
4 изменённых файлов: 39 добавлений и 17 удалений

Просмотреть файл

@ -21,8 +21,6 @@
#include "mca/base/base.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "mca/topo/topo.h"
#include "mca/topo/base/base.h"
#include "mca/ptl/ptl.h"
#include "mca/ptl/base/base.h"
#include "mca/pml/pml.h"
@ -80,14 +78,7 @@ int mca_base_init_select_components(int requested,
allow_multi_user_threads &= user_threads;
have_hidden_threads |= hidden_threads;
if (OMPI_SUCCESS != mca_topo_base_find_available(&user_threads,
&hidden_threads)) {
return OMPI_ERROR;
}
allow_multi_user_threads &= user_threads;
have_hidden_threads |= hidden_threads;
/* io components are selected later, because the io framework is
/* io and topo components are selected later, because the io framework is
opened lazily (at the first MPI_File_* function invocation). */
/* Now that we have a final list of all available modules, do the

Просмотреть файл

@ -18,6 +18,7 @@
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "mca/topo/topo.h"
#include "mca/topo/base/base.h"
#include "errhandler/errhandler.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
@ -80,6 +81,24 @@ int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims,
}
}
/*
* Now we have to check if the topo module exists or not. This has been
* removed from initialization since most of the MPI calls do not use
* this module
*/
if (!(mca_topo_base_components_opened_valid ||
mca_topo_base_components_available_valid)) {
bool user_threads = true;
bool hidden_threads = true;
if (OMPI_SUCCESS != (err = mca_topo_base_open())) {
return OMPI_ERRHANDLER_INVOKE(old_comm, err, FUNC_NAME);
}
if (OMPI_SUCCESS != (err = mca_topo_base_find_available (&user_threads,
&hidden_threads))) {
return OMPI_ERRHANDLER_INVOKE(old_comm, err, FUNC_NAME);
}
}
/* everything seems to be alright with the communicator, we can go
* ahead and select a topology module for this purpose and create
* the new cartesian communicator

Просмотреть файл

@ -19,6 +19,7 @@
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#include "mca/topo/topo.h"
#include "mca/topo/base/base.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Graph_create = PMPI_Graph_create
@ -65,6 +66,24 @@ int MPI_Graph_create(MPI_Comm old_comm, int nnodes, int *index,
}
}
/*
* Now we have to check if the topo module exists or not. This has been
* removed from initialization since most of the MPI calls do not use
* this module
*/
if (!(mca_topo_base_components_opened_valid ||
mca_topo_base_components_available_valid)) {
bool user_threads = true;
bool hidden_threads = true;
if (OMPI_SUCCESS != (err = mca_topo_base_open())) {
return OMPI_ERRHANDLER_INVOKE(old_comm, err, FUNC_NAME);
}
if (OMPI_SUCCESS != (err = mca_topo_base_find_available (&user_threads,
&hidden_threads))) {
return OMPI_ERRHANDLER_INVOKE(old_comm, err, FUNC_NAME);
}
}
/*
* everything seems to be alright with the communicator, we can go
* ahead and select a topology module for this purpose and create

Просмотреть файл

@ -47,8 +47,6 @@
#include "mca/pml/base/base.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "mca/topo/topo.h"
#include "mca/topo/base/base.h"
#include "mca/io/io.h"
#include "mca/io/base/base.h"
#include "mca/oob/oob.h"
@ -161,11 +159,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
error = "mca_coll_base_open() failed";
goto error;
}
if (OMPI_SUCCESS != (ret = mca_topo_base_open())) {
error = "mca_topo_base_open() failed";
goto error;
}
/* The io framework is initialized lazily, at the first use of any
MPI_File_* function, so it is not included here. */