- rename fini -> finalize
- use allow_multi_use_threads/have_hidden_threads instead of min_thread/max_thread This commit was SVN r616.
Этот коммит содержится в:
родитель
4debc92533
Коммит
94a9aab796
@ -19,6 +19,7 @@ typedef struct opened_module_t {
|
||||
mca_pml_t *om_actions;
|
||||
} opened_module_t;
|
||||
|
||||
|
||||
/**
|
||||
* Function for selecting one module from all those that are
|
||||
* available.
|
||||
@ -26,18 +27,17 @@ typedef struct opened_module_t {
|
||||
* Call the init function on all available modules and get their
|
||||
* priorities. Select the module with the highest priority. All
|
||||
* other modules will be closed and unloaded. The selected module
|
||||
* will have its initialization function invoked, and all of its
|
||||
* function pointers saved.
|
||||
* will have all of its function pointers saved and returned to the
|
||||
* caller.
|
||||
*/
|
||||
int mca_pml_base_select(mca_pml_t *selected)
|
||||
{
|
||||
int priority, best_priority;
|
||||
int bogus1, bogus2;
|
||||
bool allow_multi_user_threads, have_hidden_threads;
|
||||
lam_list_item_t *item;
|
||||
mca_base_module_list_item_t *mli;
|
||||
mca_pml_base_module_t *module, *best_module;
|
||||
mca_pml_t *actions;
|
||||
extern lam_list_t mca_pml_base_modules_available;
|
||||
lam_list_t opened;
|
||||
opened_module_t *om;
|
||||
|
||||
@ -61,8 +61,8 @@ int mca_pml_base_select(mca_pml_t *selected)
|
||||
lam_output_verbose(10, mca_pml_base_output,
|
||||
"select: no init function; ignoring module");
|
||||
} else {
|
||||
/* JMS Need to change this to take bools about threads */
|
||||
actions = module->pmlm_init(&priority, &bogus1, &bogus2);
|
||||
actions = module->pmlm_init(&priority, &allow_multi_user_threads,
|
||||
&have_hidden_threads);
|
||||
if (NULL == actions) {
|
||||
lam_output_verbose(10, mca_pml_base_output,
|
||||
"select: init returned failure");
|
||||
@ -103,13 +103,13 @@ int mca_pml_base_select(mca_pml_t *selected)
|
||||
|
||||
/* Finalize */
|
||||
|
||||
if (NULL != om->om_actions->pml_fini) {
|
||||
if (NULL != om->om_actions->pml_finalize) {
|
||||
|
||||
/* Blatently ignore the return code (what would we do to
|
||||
recover, anyway? This module is going away, so errors
|
||||
don't matter anymore) */
|
||||
|
||||
om->om_actions->pml_fini();
|
||||
om->om_actions->pml_finalize();
|
||||
lam_output_verbose(10, mca_pml_base_output,
|
||||
"select: module %s not selected / finalized",
|
||||
module->pmlm_version.mca_module_name);
|
||||
|
@ -35,15 +35,19 @@ typedef enum {
|
||||
/**
|
||||
* MCA->PML Called by MCA framework to initialize the module.
|
||||
*
|
||||
* @param priority (OUT) Relative priority or ranking used by MCA to selected a module.
|
||||
* @param thread_min (OUT) Minimum thread level supported by the module.
|
||||
* @param thread_max (OUT) Maximum thread level supported by the module.
|
||||
* @param priority (OUT) Relative priority or ranking used by MCA to
|
||||
* selected a module.
|
||||
*
|
||||
* @param allow_multi_user_threads (OUT) Whether this module can run
|
||||
* at MPI_THREAD_MULTIPLE or not.
|
||||
*
|
||||
* @param have_hidden_threads (OUT) Whether this module may use
|
||||
* hidden threads (e.g., progress threads) or not.
|
||||
*/
|
||||
|
||||
typedef struct mca_pml_1_0_0_t * (*mca_pml_base_module_init_fn_t)(
|
||||
int* priority,
|
||||
int* min_thread,
|
||||
int* max_thread);
|
||||
int *priority,
|
||||
bool *allow_multi_user_threads,
|
||||
bool *have_hidden_threads);
|
||||
|
||||
/**
|
||||
* PML module version and interface functions.
|
||||
@ -66,8 +70,8 @@ typedef int (*mca_pml_base_add_comm_fn_t)(struct lam_communicator_t*);
|
||||
typedef int (*mca_pml_base_del_comm_fn_t)(struct lam_communicator_t*);
|
||||
typedef int (*mca_pml_base_add_procs_fn_t)(struct lam_proc_t **procs, size_t nprocs);
|
||||
typedef int (*mca_pml_base_del_procs_fn_t)(struct lam_proc_t **procs, size_t nprocs);
|
||||
typedef int (*mca_pml_base_add_ptls_fn_t)(struct mca_ptl_t **ptls, size_t nptls);
|
||||
typedef int (*mca_pml_base_fini_fn_t)(void);
|
||||
typedef int (*mca_pml_base_add_ptls_fn_t)(lam_list_t *ptls);
|
||||
typedef int (*mca_pml_base_finalize_fn_t)(void);
|
||||
typedef int (*mca_pml_base_progress_fn_t)(void);
|
||||
|
||||
typedef int (*mca_pml_base_irecv_init_fn_t)(
|
||||
@ -142,7 +146,7 @@ struct mca_pml_1_0_0_t {
|
||||
mca_pml_base_add_procs_fn_t pml_add_procs;
|
||||
mca_pml_base_del_procs_fn_t pml_del_procs;
|
||||
mca_pml_base_add_ptls_fn_t pml_add_ptls;
|
||||
mca_pml_base_fini_fn_t pml_fini;
|
||||
mca_pml_base_finalize_fn_t pml_finalize;
|
||||
mca_pml_base_progress_fn_t pml_progress;
|
||||
|
||||
/* downcalls from MPI to PML */
|
||||
|
@ -65,12 +65,22 @@ static int ptl_exclusivity_compare(const void* arg1, const void* arg2)
|
||||
}
|
||||
|
||||
|
||||
int mca_pml_teg_add_ptls(struct mca_ptl_t** ptls, size_t nptls)
|
||||
int mca_pml_teg_add_ptls(lam_list_t *ptls)
|
||||
{
|
||||
/* sort the ptls by exclusivity */
|
||||
#if TIM_HASNT_IMPLEMENTED_THIS_YET
|
||||
|
||||
/* Tim: you now get a lam_list_t of
|
||||
(mca_ptl_base_selected_module_t*)'s (see
|
||||
mca/mpi/ptl/base/base.h).
|
||||
|
||||
You do not own this memory, and therefore do not need to free
|
||||
anything in the lam_list_t that you receive here. */
|
||||
|
||||
qsort(ptls, nptls, sizeof(struct mca_ptl_t*), ptl_exclusivity_compare);
|
||||
mca_pml_teg.teg_ptls = ptls;
|
||||
mca_pml_teg.teg_num_ptls = nptls;
|
||||
#endif
|
||||
return LAM_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,8 @@ extern int mca_pml_teg_module_close(void);
|
||||
|
||||
extern mca_pml_t* mca_pml_teg_module_init(
|
||||
int *priority,
|
||||
int *max_tag,
|
||||
int *max_cid
|
||||
bool *allow_multi_user_threads,
|
||||
bool *have_hidden_threads
|
||||
);
|
||||
|
||||
|
||||
@ -85,8 +85,7 @@ extern int mca_pml_teg_del_procs(
|
||||
);
|
||||
|
||||
extern int mca_pml_teg_add_ptls(
|
||||
struct mca_ptl_t **ptls,
|
||||
size_t nptls
|
||||
lam_list_t *ptls
|
||||
);
|
||||
|
||||
extern int mca_pml_teg_fini(void);
|
||||
|
@ -74,11 +74,13 @@ int mca_pml_teg_module_close(void)
|
||||
}
|
||||
|
||||
|
||||
mca_pml_t* mca_pml_teg_module_init(int* priority, int* min_thread, int* max_thread)
|
||||
mca_pml_t* mca_pml_teg_module_init(int* priority,
|
||||
bool *allow_multi_user_threads,
|
||||
bool *have_hidden_threads)
|
||||
{
|
||||
*priority = 0;
|
||||
*min_thread = MPI_THREAD_SINGLE;
|
||||
*max_thread = MPI_THREAD_MULTIPLE;
|
||||
*allow_multi_user_threads = true;
|
||||
*have_hidden_threads = false;
|
||||
|
||||
mca_pml_teg.teg_ptl_modules = 0;
|
||||
mca_pml_teg.teg_num_ptl_modules = 0;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user