
code base. - many (most) mca type names have "component" or "module" in them, as relevant, just to further distinguish the difference between component data/actions and module data/actions. All developers are encouraged to perpetuate this convention when you create types that are specific to a framework, component, or module - did very little to entire framework (just the basics to make it compile) because it's just about to be almost entirely replaced - ditto for io / romio - did not work on elan or ib components; have to commit and then convert those on a different machine with the right libraries and headers - renamed a bunch of *_module.c files to *_component.c and *module*c to *component*c (a few still remain, e.g., ptl/ib, ptl/elan, etc.) - modified autogen/configure/build process to match new filenames (e.g., output static-components.h instead of static-modules.h) - removed DOS-style cr/lf stuff in ns/ns.h - added newline to end of file src/util/numtostr.h - removed some redundant error checking in the top-level topo functions - added a few {} here and there where people "forgot" to put them in for 1 line blocks ;-) - removed a bunch of MPI_* types from mca header files (replaced with corresponding ompi_* types) - all the ptl components had version numbers in their structs; removed - converted a few more elements in the MCA base to use the OBJ interface -- removed some old manual reference counting kruft This commit was SVN r1830.
98 строки
2.8 KiB
C
98 строки
2.8 KiB
C
/*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "include/constants.h"
|
|
#include "class/ompi_list.h"
|
|
#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"
|
|
#include "mca/pml/base/base.h"
|
|
#include "mca/mpool/base/base.h"
|
|
|
|
|
|
/*
|
|
* Look at available pml, ptl, and coll modules and find a set that
|
|
* works nicely. Also set the final MPI thread level. There are many
|
|
* factors involved here, and this first implementation is rather
|
|
* simplistic.
|
|
*
|
|
* The contents of this function will likely be replaced
|
|
*/
|
|
int mca_base_init_select_components(int requested,
|
|
bool allow_multi_user_threads,
|
|
bool have_hidden_threads, int *provided)
|
|
{
|
|
bool user_threads, hidden_threads;
|
|
|
|
/* Make final lists of available modules (i.e., call the query/init
|
|
functions and see if they return happiness). For pml, there will
|
|
only be one (because there's only one for the whole process), but
|
|
for ptl and coll, we'll get lists back. */
|
|
|
|
if (OMPI_SUCCESS != mca_mpool_base_init(&user_threads)) {
|
|
return OMPI_ERROR;
|
|
}
|
|
allow_multi_user_threads &= user_threads;
|
|
|
|
/* JMS: At some point, we'll need to feed it the thread level to
|
|
ensure to pick one high enough (e.g., if we need CR) */
|
|
|
|
if (OMPI_SUCCESS != mca_pml_base_select(&mca_pml,
|
|
&user_threads, &hidden_threads)) {
|
|
return OMPI_ERROR;
|
|
}
|
|
allow_multi_user_threads &= user_threads;
|
|
have_hidden_threads |= hidden_threads;
|
|
|
|
if (OMPI_SUCCESS != mca_ptl_base_select(&user_threads, &hidden_threads)) {
|
|
return OMPI_ERROR;
|
|
}
|
|
allow_multi_user_threads &= user_threads;
|
|
have_hidden_threads |= hidden_threads;
|
|
|
|
if (OMPI_SUCCESS != mca_coll_base_find_available(&user_threads,
|
|
&hidden_threads)) {
|
|
return OMPI_ERROR;
|
|
}
|
|
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;
|
|
|
|
/* Now that we have a final list of all available modules, do the
|
|
selection. pml is already selected. */
|
|
|
|
/* JMS ...Do more here with the thread level, etc.... */
|
|
|
|
*provided = requested;
|
|
if (have_hidden_threads) {
|
|
ompi_set_using_threads(true);
|
|
}
|
|
|
|
/* Tell the selected pml module about all the selected ptl
|
|
modules */
|
|
|
|
mca_pml.pml_add_ptls(&mca_ptl_base_components_initialized);
|
|
|
|
/* All done */
|
|
|
|
return OMPI_SUCCESS;
|
|
}
|
|
|