1
1

opal-restart: fix variable passing from opal-restart to CRS

opal-restart.c disables crs module selection by setting
crs_base_do_not_select to true using opal_setenv() before
opal_init(). After opal_init() it enables module selection
by changing the variable back to false using opal_setenv().
This does not work anymore as the variables are only read
from the environment during variable registration.
This changes the second opal_setenv() to mca_base_var_set_value()

This commit was SVN r31108.
Этот коммит содержится в:
Adrian Reber 2014-03-18 15:28:42 +00:00
родитель 84a6330b27
Коммит 62dea2be84

Просмотреть файл

@ -15,6 +15,7 @@
* Copyright (c) 2007 Evergrid, Inc. All rights reserved. * Copyright (c) 2007 Evergrid, Inc. All rights reserved.
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Hochschule Esslingen. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -167,8 +168,10 @@ main(int argc, char *argv[])
int ret, exit_status = OPAL_SUCCESS; int ret, exit_status = OPAL_SUCCESS;
int child_pid; int child_pid;
int prev_pid = 0; int prev_pid = 0;
int idx;
opal_crs_base_snapshot_t *snapshot = NULL; opal_crs_base_snapshot_t *snapshot = NULL;
char * tmp_env_var = NULL; char * tmp_env_var = NULL;
bool select = false;
/*************** /***************
* Initialize * Initialize
@ -189,12 +192,20 @@ main(int argc, char *argv[])
} }
/* Re-enable the selection of the CRS component, so we can choose the right one */ /* Re-enable the selection of the CRS component, so we can choose the right one */
(void) mca_base_var_env_name("crs_base_do_not_select", &tmp_env_var); idx = mca_base_var_find(NULL, "crs", "base", "do_not_select");
opal_setenv(tmp_env_var,
"0", /* turn on the selection */ if (0 > idx) {
true, &environ); opal_output(opal_restart_globals.output,
free(tmp_env_var); "MCA variable opal_crs_base_do_not_select not found\n");
tmp_env_var = NULL; exit_status = OPAL_ERROR;
goto cleanup;
}
ret = mca_base_var_set_value(idx, &select, 0, MCA_BASE_VAR_SOURCE_DEFAULT, NULL);
if (OPAL_SUCCESS != ret) {
exit_status = ret;
goto cleanup;
}
/* /*
* Make sure we are using the correct checkpointer * Make sure we are using the correct checkpointer