George,

What do you mean by "cvar version " ? Is there cvar version of
"coll_tuned_bcast_algorithm" ?

If you meant using cvar APIs then I use them. For example, in the following
example I use MPI_T_cvar_write to set the variable. Despite I can read
using MPI_T_cvar_read, the write does not work.

I set the variable, then use MPI_Comm_split to create a new communicator,
after that I read the variable again to check if it was set or not.

Thanks.

int main(int argc, char** argv) {
    int cidx, nvals, err;
    int bcast_alg;
int provided;
    MPI_T_cvar_handle chandle;

    MPI_Init(&argc, &argv);

    err =  MPI_T_init_thread(MPI_THREAD_SINGLE, &provided);

    err = MPI_T_cvar_get_index("coll_tuned_bcast_algorithm", &cidx);

    if (err != MPI_SUCCESS) {
       fprintf(stdout, "Error getting cvar index\n");
       MPI_Abort(MPI_COMM_WORLD, 0);
    }

    int rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    err = MPI_T_cvar_handle_alloc(cidx, NULL, &chandle, &nvals);

    err = MPI_T_cvar_read(chandle, &bcast_alg);
    if (!rank)
        fprintf(stdout, "Bcast alg after first read: %d\n", bcast_alg);

    bcast_alg = 2;
    err = MPI_T_cvar_write(chandle, &bcast_alg);

    MPI_Comm sub_comm;
    MPI_Comm_split(MPI_COMM_WORLD, rank>0, rank, &sub_comm);

    err = MPI_T_cvar_read(chandle, &bcast_alg);

    if (!rank)
fprintf(stdout, "Bcast alg after second read: %d\n", bcast_alg);

    MPI_T_cvar_handle_free(&chandle);

    MPI_T_finalize();

    MPI_Finalize();

    return EXIT_SUCCESS;
}







On Fri, Aug 14, 2015 at 7:07 PM, George Bosilca <bosi...@icl.utk.edu> wrote:

> On Fri, Aug 14, 2015 at 1:56 PM, Jeff Squyres (jsquyres) <
> jsquy...@cisco.com> wrote:
>
>> Note, too, that these variables are likely only changeable before
>> MPI_INIT.
>>
>> I didn't check these specific variables, but at least the
>> btl_self_eager_limit variable is likely only read/used for setup during
>> MPI_INIT.  coll_tuned_bcast_algorithm may only be used before a
>> communicator is setup (although I don't know that for sure offhand).
>>
>
> It is read before every communicator creation. So technically one can
> change the algorithm dynamically for each communicator.
>
>   George.
>
>
>
>>
>>
>>
>> > On Aug 14, 2015, at 1:50 PM, George Bosilca <bosi...@icl.utk.edu>
>> wrote:
>> >
>> > They are considered as control variables, so use the cvar version and
>> you should get them.
>> >
>> >   George.
>> >
>> >
>> > On Fri, Aug 14, 2015 at 11:14 AM, Khalid Hasanov <xali...@gmail.com>
>> wrote:
>> > Hello,
>> >
>> > I am trying to use MPI_T interface to set coll_tuned_bcast_algorithm
>> mca parameter during run time, however I was not successful to do that.
>> >
>> > I wonder if is it currently supported in Open MPI.
>> >
>> > I had the same problem with setting btl_self_eager_limit parameter.
>> >
>> > The code I am using attached below.
>> >
>> >
>> > Thanks.
>> >
>> >
>> > --
>> > Best Regards,
>> > Khalid
>> >
>> > _______________________________________________
>> > users mailing list
>> > us...@open-mpi.org
>> > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> > Link to this post:
>> http://www.open-mpi.org/community/lists/users/2015/08/27470.php
>> >
>> > _______________________________________________
>> > users mailing list
>> > us...@open-mpi.org
>> > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> > Link to this post:
>> http://www.open-mpi.org/community/lists/users/2015/08/27473.php
>>
>>
>> --
>> Jeff Squyres
>> jsquy...@cisco.com
>> For corporate legal information go to:
>> http://www.cisco.com/web/about/doing_business/legal/cri/
>>
>> _______________________________________________
>> users mailing list
>> us...@open-mpi.org
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post:
>> http://www.open-mpi.org/community/lists/users/2015/08/27474.php
>>
>
>
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post:
> http://www.open-mpi.org/community/lists/users/2015/08/27475.php
>



-- 
Best Regards,
Khalid

Reply via email to