- 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;
|
mca_pml_t *om_actions;
|
||||||
} opened_module_t;
|
} opened_module_t;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function for selecting one module from all those that are
|
* Function for selecting one module from all those that are
|
||||||
* available.
|
* available.
|
||||||
@ -26,18 +27,17 @@ typedef struct opened_module_t {
|
|||||||
* Call the init function on all available modules and get their
|
* Call the init function on all available modules and get their
|
||||||
* priorities. Select the module with the highest priority. All
|
* priorities. Select the module with the highest priority. All
|
||||||
* other modules will be closed and unloaded. The selected module
|
* other modules will be closed and unloaded. The selected module
|
||||||
* will have its initialization function invoked, and all of its
|
* will have all of its function pointers saved and returned to the
|
||||||
* function pointers saved.
|
* caller.
|
||||||
*/
|
*/
|
||||||
int mca_pml_base_select(mca_pml_t *selected)
|
int mca_pml_base_select(mca_pml_t *selected)
|
||||||
{
|
{
|
||||||
int priority, best_priority;
|
int priority, best_priority;
|
||||||
int bogus1, bogus2;
|
bool allow_multi_user_threads, have_hidden_threads;
|
||||||
lam_list_item_t *item;
|
lam_list_item_t *item;
|
||||||
mca_base_module_list_item_t *mli;
|
mca_base_module_list_item_t *mli;
|
||||||
mca_pml_base_module_t *module, *best_module;
|
mca_pml_base_module_t *module, *best_module;
|
||||||
mca_pml_t *actions;
|
mca_pml_t *actions;
|
||||||
extern lam_list_t mca_pml_base_modules_available;
|
|
||||||
lam_list_t opened;
|
lam_list_t opened;
|
||||||
opened_module_t *om;
|
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,
|
lam_output_verbose(10, mca_pml_base_output,
|
||||||
"select: no init function; ignoring module");
|
"select: no init function; ignoring module");
|
||||||
} else {
|
} else {
|
||||||
/* JMS Need to change this to take bools about threads */
|
actions = module->pmlm_init(&priority, &allow_multi_user_threads,
|
||||||
actions = module->pmlm_init(&priority, &bogus1, &bogus2);
|
&have_hidden_threads);
|
||||||
if (NULL == actions) {
|
if (NULL == actions) {
|
||||||
lam_output_verbose(10, mca_pml_base_output,
|
lam_output_verbose(10, mca_pml_base_output,
|
||||||
"select: init returned failure");
|
"select: init returned failure");
|
||||||
@ -103,13 +103,13 @@ int mca_pml_base_select(mca_pml_t *selected)
|
|||||||
|
|
||||||
/* Finalize */
|
/* 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
|
/* Blatently ignore the return code (what would we do to
|
||||||
recover, anyway? This module is going away, so errors
|
recover, anyway? This module is going away, so errors
|
||||||
don't matter anymore) */
|
don't matter anymore) */
|
||||||
|
|
||||||
om->om_actions->pml_fini();
|
om->om_actions->pml_finalize();
|
||||||
lam_output_verbose(10, mca_pml_base_output,
|
lam_output_verbose(10, mca_pml_base_output,
|
||||||
"select: module %s not selected / finalized",
|
"select: module %s not selected / finalized",
|
||||||
module->pmlm_version.mca_module_name);
|
module->pmlm_version.mca_module_name);
|
||||||
|
@ -35,15 +35,19 @@ typedef enum {
|
|||||||
/**
|
/**
|
||||||
* MCA->PML Called by MCA framework to initialize the module.
|
* 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 priority (OUT) Relative priority or ranking used by MCA to
|
||||||
* @param thread_min (OUT) Minimum thread level supported by the module.
|
* selected a module.
|
||||||
* @param thread_max (OUT) Maximum thread level supported by the 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)(
|
typedef struct mca_pml_1_0_0_t * (*mca_pml_base_module_init_fn_t)(
|
||||||
int* priority,
|
int *priority,
|
||||||
int* min_thread,
|
bool *allow_multi_user_threads,
|
||||||
int* max_thread);
|
bool *have_hidden_threads);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PML module version and interface functions.
|
* 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_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_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_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_add_ptls_fn_t)(lam_list_t *ptls);
|
||||||
typedef int (*mca_pml_base_fini_fn_t)(void);
|
typedef int (*mca_pml_base_finalize_fn_t)(void);
|
||||||
typedef int (*mca_pml_base_progress_fn_t)(void);
|
typedef int (*mca_pml_base_progress_fn_t)(void);
|
||||||
|
|
||||||
typedef int (*mca_pml_base_irecv_init_fn_t)(
|
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_add_procs_fn_t pml_add_procs;
|
||||||
mca_pml_base_del_procs_fn_t pml_del_procs;
|
mca_pml_base_del_procs_fn_t pml_del_procs;
|
||||||
mca_pml_base_add_ptls_fn_t pml_add_ptls;
|
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;
|
mca_pml_base_progress_fn_t pml_progress;
|
||||||
|
|
||||||
/* downcalls from MPI to PML */
|
/* 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 */
|
/* 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);
|
qsort(ptls, nptls, sizeof(struct mca_ptl_t*), ptl_exclusivity_compare);
|
||||||
mca_pml_teg.teg_ptls = ptls;
|
mca_pml_teg.teg_ptls = ptls;
|
||||||
mca_pml_teg.teg_num_ptls = nptls;
|
mca_pml_teg.teg_num_ptls = nptls;
|
||||||
|
#endif
|
||||||
return LAM_SUCCESS;
|
return LAM_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ extern int mca_pml_teg_module_close(void);
|
|||||||
|
|
||||||
extern mca_pml_t* mca_pml_teg_module_init(
|
extern mca_pml_t* mca_pml_teg_module_init(
|
||||||
int *priority,
|
int *priority,
|
||||||
int *max_tag,
|
bool *allow_multi_user_threads,
|
||||||
int *max_cid
|
bool *have_hidden_threads
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -85,8 +85,7 @@ extern int mca_pml_teg_del_procs(
|
|||||||
);
|
);
|
||||||
|
|
||||||
extern int mca_pml_teg_add_ptls(
|
extern int mca_pml_teg_add_ptls(
|
||||||
struct mca_ptl_t **ptls,
|
lam_list_t *ptls
|
||||||
size_t nptls
|
|
||||||
);
|
);
|
||||||
|
|
||||||
extern int mca_pml_teg_fini(void);
|
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;
|
*priority = 0;
|
||||||
*min_thread = MPI_THREAD_SINGLE;
|
*allow_multi_user_threads = true;
|
||||||
*max_thread = MPI_THREAD_MULTIPLE;
|
*have_hidden_threads = false;
|
||||||
|
|
||||||
mca_pml_teg.teg_ptl_modules = 0;
|
mca_pml_teg.teg_ptl_modules = 0;
|
||||||
mca_pml_teg.teg_num_ptl_modules = 0;
|
mca_pml_teg.teg_num_ptl_modules = 0;
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user