Folks,
i was thinking of using the MPI_T interface in order to try within the
same MPI test program *all* the available algo of a given collective.
That cannot currently be done because the mca parameter is registered with
{flag=0, scope=MCA_BASE_VAR_SCOPE_READONLY}
i made a proof of concept by changing this to
{flag=MCA_BASE_VAR_FLAG_SETTABLE, scope=MCA_VAR_SCOPE_ALL}
(see the inline patch below)
strictly speaking, it does not work since the updated values are used
next time a communicator is created.
for example, changing a value on MPI_COMM_WORLD has no effect,
but changing a value, MPI_Comm_dup(MPI_COMM_WORLD) and using the dup'ed
communicator works.
btw, i guess any communicator could be used to set the value.
as far as i am concerned, that is good enough for me
any objections to make some coll/tuned parameters writable by MPI_T ?
if no, did i implement it correctly ?
Cheers,
Gilles
here is the function that sets a value :
int setValue_int_comm(int index, MPI_Comm comm, int *val) {
int err,count;
MPI_T_cvar_handle handle;
/* This example assumes that the variable index */
/* can be bound to a communicator */
err=MPI_T_cvar_handle_alloc(index,&comm,&handle,&count);
if (err!=MPI_SUCCESS) return err;
/* The following assumes that the variable is */
/* represented by a single integer */
err=MPI_T_cvar_write(handle,val);
if (err!=MPI_SUCCESS) return err;
err=MPI_T_cvar_handle_free(&handle);
return err;
}
and here is the proof of concept
diff --git a/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c
b/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c
index 81345b2..31ca217 100644
--- a/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c
+++ b/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c
@@ -76,9 +76,9 @@ int ompi_coll_tuned_bcast_intra_check_forced_init
(coll_tuned_force_algorithm_mc
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
"bcast_algorithm",
"Which bcast algorithm is
used. Can be locked down to choice of: 0 ignore, 1 basic linear, 2
chain, 3: pipeline, 4: split binary tree, 5: binary tree, 6: binomial
tree.",
- MCA_BASE_VAR_TYPE_INT,
new_enum, 0, 0,
+ MCA_BASE_VAR_TYPE_INT,
new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_5,
- MCA_BASE_VAR_SCOPE_READONLY,
+ MCA_BASE_VAR_SCOPE_ALL,
&coll_tuned_bcast_forced_algorithm);
OBJ_RELEASE(new_enum);
if (mca_param_indices->algorithm_param_index < 0) {
diff --git a/ompi/mca/coll/tuned/coll_tuned_component.c
b/ompi/mca/coll/tuned/coll_tuned_component.c
index 9756359..ea389fd 100644
--- a/ompi/mca/coll/tuned/coll_tuned_component.c
+++ b/ompi/mca/coll/tuned/coll_tuned_component.c
@@ -164,9 +164,9 @@ static int tuned_register(void)
(void)
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
"use_dynamic_rules",
"Switch used to decide if
we use static (compiled/if statements) or dynamic (built at runtime)
decision function rules",
- MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
+ MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_6,
- MCA_BASE_VAR_SCOPE_READONLY,
+ MCA_BASE_VAR_SCOPE_ALL,
&ompi_coll_tuned_use_dynamic_rules);
ompi_coll_tuned_dynamic_rules_filename = NULL;