[mvapich-discuss] Request to read value of environment variables, rather than just checking whether they are defined

Adam Moody moody20 at llnl.gov
Fri Dec 29 18:58:34 EST 2006


Hello all,
In our batch system, we automatically set a handful of environment 
variables so that users don't need to worry about the details.  In some 
cases, however, users would like to override our default settings.  With 
our setup, it's easy for them to change a setting, but much more 
difficult for them to undefine a variable we've set for them.  For this 
reason, it would be very helpful if MPI could read and process the value 
of an environment variable, rather than just checking whether it's 
defined.  It seems that MPI reads the value for most variables, but 
there are a few which are not.

For, example, the following code segment from comm_rdma_init.c forces us 
to jump through some hoops we'd like to elminate:

    if(NULL != getenv("DISABLE_RDMA_ALLTOALL")) {
        comm->is_alltoall_enabled = 0;
    } else {
        /* User has enabled Alltoall in general */
        comm->is_alltoall_enabled = 1;
    }

It would help a lot if you could change the above to something like:

    int value;
    if ((value = getenv("DISABLE_RDMA_ALLTOALL")) != NULL) {
        comm->is_alltoall_enabled = atoi(value);
    } else {
        /* User has enabled Alltoall in general */
        comm->is_alltoall_enabled = 1;
    }

Of course, doing this would change the behavior for those accustomed to 
simply defining the variable and not caring about its value.  Perhaps 
you'd want to define a new set of variables like 
"USE_RDMA_ALLTOALL={0,1}" in order to preserve this backwards compatibility.

Thanks and have a Happy New Years!
-Adam


More information about the mvapich-discuss mailing list