Could you explain the comment about opal_setenv getting “picky”? You can pass a flag that tells opal_setenv whether or not to overwrite a pre-existing value, and it tells you if the value was found (which is exactly what you asked for) - why isn’t it adequate to just pass a “false” for overwrite and check the return for OPAL_EXISTS?
> On Jan 19, 2015, at 10:48 AM, git...@crest.iu.edu wrote: > > This is an automated email from the git hooks/post-receive script. It was > generated because a ref change was pushed to the repository containing > the project "open-mpi/ompi". > > The branch, master has been updated > via 06d3b57c07a3e028d660d747848e320369185d06 (commit) > via fd807aee69675a0b0602eb6971bacf61db5b10a5 (commit) > from da83b084f506ea3c34ebe9da3c6dd6f44e2537a8 (commit) > > Those revisions listed above that are new to this repository have > not appeared on any other notification email; so we list those > revisions in full, below. > > - Log ----------------------------------------------------------------- > https://github.com/open-mpi/ompi/commit/06d3b57c07a3e028d660d747848e320369185d06 > > commit 06d3b57c07a3e028d660d747848e320369185d06 > Merge: da83b08 fd807ae > Author: Howard Pritchard <hpprit...@users.noreply.github.com> > Date: Mon Jan 19 11:48:24 2015 -0700 > > Merge pull request #351 from hppritcha/topic/alps_odls_spawn_bug > > odls/alps: check if PMI gni rdma creds already set > > > > https://github.com/open-mpi/ompi/commit/fd807aee69675a0b0602eb6971bacf61db5b10a5 > > commit fd807aee69675a0b0602eb6971bacf61db5b10a5 > Author: Howard Pritchard <hpprit...@gmail.com> > Date: Mon Jan 19 10:12:38 2015 -0800 > > odls/alps: check if PMI gni rdma creds already set > > Need to check if the alps odls component has already > read the rdma creds from alps. Its okay to ask apshepherd > multiple times for rdma creds, but opal_setenv gets > a bit picky about this. Rather than check for the OPAL_EXISTS > return value from opal_setenv, for now just check with > a static variable whether or not orte_odls_alps_get_rdma_creds > has already been successfully called before. > > Would be nice to have an opal_getenv function for checking > if an env. variable had already been set by opal_putenv. > > diff --git a/orte/mca/odls/alps/odls_alps_utils.c > b/orte/mca/odls/alps/odls_alps_utils.c > index 8236038..2ffee05 100644 > --- a/orte/mca/odls/alps/odls_alps_utils.c > +++ b/orte/mca/odls/alps/odls_alps_utils.c > @@ -53,6 +53,17 @@ int orte_odls_alps_get_rdma_creds(void) > alpsAppGni_t *rdmacred_buf; > char *ptr; > char env_buffer[1024]; > + static int already_got_creds = 0; > + > + /* > + * If we already put the GNI RDMA credentials into orte_launch_environ, > + * no need to do anything. > + * TODO: kind of ugly, need to implement an opal_getenv > + */ > + > + if (1 == already_got_creds) { > + return ORTE_SUCCESS; > + } > > /* > * get the Cray HSN RDMA credentials here and stuff them in to the > @@ -234,6 +245,7 @@ int orte_odls_alps_get_rdma_creds(void) > } > > fn_exit: > + if (ORTE_SUCCESS == ret) already_got_creds = 1; > return ret; > } > > > > ----------------------------------------------------------------------- > > Summary of changes: > orte/mca/odls/alps/odls_alps_utils.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > > hooks/post-receive > -- > open-mpi/ompi > _______________________________________________ > ompi-commits mailing list > ompi-comm...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/ompi-commits