Convert to use portable ompi_setenv() and ompi_unsetenv()
This commit was SVN r5164.
Этот коммит содержится в:
родитель
11ea2b7e4e
Коммит
38b814b0cc
@ -38,6 +38,7 @@
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
|
||||
#include "mca/gpr/gpr.h"
|
||||
#include "mca/gpr/base/base.h"
|
||||
@ -98,7 +99,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
|
||||
#include "mca/gpr/base/base.h"
|
||||
#include "mca/gpr/gpr.h"
|
||||
@ -64,7 +65,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
#include "mca/errmgr/errmgr.h"
|
||||
#include "mca/ns/ns_types.h"
|
||||
#include "mca/gpr/gpr.h"
|
||||
@ -132,7 +133,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
|
||||
#include "mca/gpr/base/base.h"
|
||||
#include "mca/gpr/replica/api_layer/gpr_replica_api.h"
|
||||
@ -74,7 +75,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "util/output.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
|
||||
#include "mca/errmgr/errmgr.h"
|
||||
#include "mca/errmgr/base/base.h"
|
||||
@ -84,7 +85,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
@ -436,7 +437,6 @@ static int test1(void)
|
||||
}
|
||||
|
||||
orte_gpr.dump_triggers(0);
|
||||
return ORTE_SUCCESS;
|
||||
|
||||
fprintf(test_out, "incrementing until trigger\n");
|
||||
/* increment the value in keys[1] until the trig fires */
|
||||
|
@ -62,19 +62,19 @@ int main(int argc, char **argv)
|
||||
|
||||
/* setup environment for rte */
|
||||
seed = getenv("OMPI_DAEMON_SEED");
|
||||
setenv("OMPI_MCA_pcmclient_env_num_procs", "2", 1);
|
||||
setenv("OMPI_MCA_pcmclient_env_vpid_start", "0", 1);
|
||||
setenv("OMPI_MCA_pcmclient_env_cellid", "0", 1);
|
||||
setenv("OMPI_MCA_pcmclient_env_jobid", "0", 1);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_num_procs", "2", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_vpid_start", "0", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_cellid", "0", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_jobid", "0", true, &environ);
|
||||
if(seed == NULL || atoi(seed) != 0) {
|
||||
ompi_process_info.seed = true;
|
||||
setenv("OMPI_MCA_pcmclient_env_procid", "0", 1);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_procid", "0", true, &environ);
|
||||
} else {
|
||||
ompi_process_info.seed = false;
|
||||
setenv("OMPI_MCA_pcmclient_env_procid", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_procid", "1", true, &environ);
|
||||
}
|
||||
/* require tcp oob */
|
||||
setenv("OMPI_MCA_oob_base_include", "tcp", 1);
|
||||
ompi_setenv("OMPI_MCA_oob_base_include", "tcp", true, &environ);
|
||||
|
||||
/* basic ompi init */
|
||||
if (OMPI_SUCCESS != ompi_init(argc, argv)) {
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "support.h"
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/environ.h"
|
||||
#include "mca/base/base.h"
|
||||
#include "mca/ns/ns.h"
|
||||
#include "mca/ns/base/base.h"
|
||||
@ -66,7 +67,7 @@ int main (int argc, char* argv[])
|
||||
orte_process_info.seed = true;
|
||||
|
||||
/* ensure the replica is isolated */
|
||||
setenv("OMPI_MCA_ns_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_ns_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* init the proc info structure */
|
||||
orte_proc_info();
|
||||
@ -173,12 +174,12 @@ static bool test2(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
setenv("OMPI_MCA_ns_nds", "env", 1);
|
||||
setenv("OMPI_MCA_ns_nds_cellid", "2", 1);
|
||||
setenv("OMPI_MCA_ns_nds_jobid", "5", 1);
|
||||
setenv("OMPI_MCA_ns_nds_vpid", "21456", 1);
|
||||
setenv("OMPI_MCA_ns_nds_vpid_start", "0", 1);
|
||||
setenv("OMPI_MCA_ns_nds_num_procs", "100000", 1);
|
||||
ompi_setenv("OMPI_MCA_ns_nds", "env", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_ns_nds_cellid", "2", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_ns_nds_jobid", "5", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_ns_nds_vpid", "21456", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_ns_nds_vpid_start", "0", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_ns_nds_num_procs", "100000", true, &environ);
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_ns.set_my_name())) {
|
||||
test_comment("set_my_name failed for env case");
|
||||
|
@ -57,19 +57,19 @@ int main(int argc, char **argv)
|
||||
|
||||
/* setup environment for rte */
|
||||
seed = getenv("OMPI_DAEMON_SEED");
|
||||
setenv("OMPI_MCA_pcmclient_env_num_procs", "2", 1);
|
||||
setenv("OMPI_MCA_pcmclient_env_vpid_start", "0", 1);
|
||||
setenv("OMPI_MCA_pcmclient_env_cellid", "0", 1);
|
||||
setenv("OMPI_MCA_pcmclient_env_jobid", "0", 1);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_num_procs", "2", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_vpid_start", "0", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_cellid", "0", true, &environ);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_jobid", "0", true, &environ);
|
||||
if(seed == NULL || atoi(seed) != 0) {
|
||||
ompi_process_info.seed = true;
|
||||
setenv("OMPI_MCA_pcmclient_env_procid", "0", 1);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_procid", "0", true, &environ);
|
||||
} else {
|
||||
ompi_process_info.seed = false;
|
||||
setenv("OMPI_MCA_pcmclient_env_procid", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_pcmclient_env_procid", "1", true, &environ);
|
||||
}
|
||||
/* require tcp oob */
|
||||
setenv("OMPI_MCA_oob_base_include", "tcp", 1);
|
||||
ompi_setenv("OMPI_MCA_oob_base_include", "tcp", true, &environ);
|
||||
|
||||
/* basic ompi init */
|
||||
if (OMPI_SUCCESS != ompi_init(argc, argv)) {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "include/orte_constants.h"
|
||||
#include "include/orte_schema.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/environ.h"
|
||||
#include "mca/mca.h"
|
||||
#include "mca/base/base.h"
|
||||
#include "mca/ns/base/base.h"
|
||||
@ -62,7 +63,7 @@ int main(int argc, char **argv)
|
||||
orte_process_info.seed = true;
|
||||
|
||||
/* ensure the replica is isolated */
|
||||
setenv("OMPI_MCA_ns_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_ns_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* init the proc info structure */
|
||||
orte_proc_info();
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
|
||||
#include "mca/gpr/base/base.h"
|
||||
#include "mca/rds/base/base.h"
|
||||
@ -50,7 +51,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE GPR REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
|
||||
#include "mca/gpr/base/base.h"
|
||||
#include "mca/rds/base/base.h"
|
||||
@ -50,7 +51,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE GPR REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/environ.h"
|
||||
|
||||
#include "mca/gpr/base/base.h"
|
||||
#include "mca/rds/base/base.h"
|
||||
@ -50,7 +51,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* ENSURE THE GPR REPLICA IS ISOLATED */
|
||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||
ompi_setenv("OMPI_MCA_gpr_replica_isolate", "1", true, &environ);
|
||||
|
||||
/* Open up the output streams */
|
||||
if (!ompi_output_init()) {
|
||||
|
@ -151,18 +151,18 @@ static bool test2(void)
|
||||
|
||||
/* use the OMPI_PREFIX_ENV variable */
|
||||
|
||||
setenv("OMPI_PREFIX_ENV", "/tmp/trythis", 1);
|
||||
ompi_setenv("OMPI_PREFIX_ENV", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == ompi_session_dir(true, NULL, "test-universe",
|
||||
ompi_system_info.user, NULL, NULL, NULL, NULL)) {
|
||||
unsetenv("OMPI_PREFIX_ENV");
|
||||
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
ompi_session_dir_finalize ();
|
||||
free(tmp);
|
||||
|
||||
unsetenv("OMPI_PREFIX_ENV");
|
||||
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
|
||||
|
||||
return(true);
|
||||
|
||||
@ -174,18 +174,18 @@ static bool test3(void)
|
||||
/* use the TMPDIR enviro variable */
|
||||
char *tmp;
|
||||
|
||||
setenv("TMPDIR", "/tmp/trythis", 1);
|
||||
ompi_setenv("TMPDIR", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == ompi_session_dir(true, NULL, "test-universe",
|
||||
ompi_system_info.user, NULL, NULL, NULL, NULL)) {
|
||||
unsetenv("TMPDIR");
|
||||
ompi_unsetenv("TMPDIR", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
ompi_session_dir_finalize ();
|
||||
free(tmp);
|
||||
|
||||
unsetenv("TMPDIR");
|
||||
ompi_unsetenv("TMPDIR", &environ);
|
||||
|
||||
return(true);
|
||||
}
|
||||
@ -196,18 +196,18 @@ static bool test4(void)
|
||||
/* use the TMP enviro variable */
|
||||
char *tmp;
|
||||
|
||||
setenv("TMP", "/tmp/trythis", 1);
|
||||
ompi_setenv("TMP", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == ompi_session_dir(true, NULL, "test-universe",
|
||||
ompi_system_info.user, NULL, NULL, NULL, NULL)) {
|
||||
unsetenv("TMP");
|
||||
ompi_unsetenv("TMP", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
ompi_session_dir_finalize ();
|
||||
free(tmp);
|
||||
|
||||
unsetenv("TMP");
|
||||
ompi_unsetenv("TMP", &environ);
|
||||
|
||||
return(true);
|
||||
}
|
||||
@ -218,17 +218,17 @@ static bool test5(void)
|
||||
/* use the HOME enviro variable */
|
||||
char *tmp;
|
||||
|
||||
setenv("HOME", "/tmp/trythis", 1);
|
||||
ompi_setenv("HOME", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == ompi_session_dir(true, NULL, "test-universe", ompi_system_info.user, NULL, NULL, NULL, NULL)) {
|
||||
unsetenv("HOME");
|
||||
ompi_unsetenv("HOME", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
ompi_session_dir_finalize ();
|
||||
free(tmp);
|
||||
|
||||
unsetenv("HOME");
|
||||
ompi_unsetenv("HOME", &environ);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "util/os_create_dirpath.h"
|
||||
#include "util/session_dir.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/environ.h"
|
||||
#include "support.h"
|
||||
|
||||
|
||||
@ -179,10 +180,10 @@ static bool test2(void)
|
||||
|
||||
/* use the OMPI_PREFIX_ENV variable */
|
||||
|
||||
setenv("OMPI_PREFIX_ENV", "/tmp/trythis", 1);
|
||||
ompi_setenv("OMPI_PREFIX_ENV", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
|
||||
unsetenv("OMPI_PREFIX_ENV");
|
||||
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -191,7 +192,7 @@ static bool test2(void)
|
||||
rmdir(tmp);
|
||||
free(tmp);
|
||||
|
||||
unsetenv("OMPI_PREFIX_ENV");
|
||||
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
|
||||
|
||||
return(true);
|
||||
|
||||
@ -205,10 +206,10 @@ static bool test3(void)
|
||||
|
||||
clear_proc_info();
|
||||
|
||||
setenv("TMPDIR", "/tmp/trythis", 1);
|
||||
ompi_setenv("TMPDIR", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
|
||||
unsetenv("TMPDIR");
|
||||
ompi_unsetenv("TMPDIR", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -217,7 +218,7 @@ static bool test3(void)
|
||||
rmdir(tmp);
|
||||
free(tmp);
|
||||
|
||||
unsetenv("TMPDIR");
|
||||
ompi_unsetenv("TMPDIR", &environ);
|
||||
|
||||
return(true);
|
||||
}
|
||||
@ -230,10 +231,10 @@ static bool test4(void)
|
||||
|
||||
clear_proc_info();
|
||||
|
||||
setenv("TMP", "/tmp/trythis", 1);
|
||||
ompi_setenv("TMP", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
|
||||
unsetenv("TMP");
|
||||
ompi_unsetenv("TMP", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -242,7 +243,7 @@ static bool test4(void)
|
||||
rmdir(tmp);
|
||||
free(tmp);
|
||||
|
||||
unsetenv("TMP");
|
||||
ompi_unsetenv("TMP", &environ);
|
||||
|
||||
return(true);
|
||||
}
|
||||
@ -255,10 +256,10 @@ static bool test5(void)
|
||||
|
||||
clear_proc_info();
|
||||
|
||||
setenv("HOME", "/tmp/trythis", 1);
|
||||
ompi_setenv("HOME", "/tmp/trythis", true, &environ);
|
||||
|
||||
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
|
||||
unsetenv("HOME");
|
||||
ompi_unsetenv("HOME", &environ);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -267,7 +268,7 @@ static bool test5(void)
|
||||
rmdir(tmp);
|
||||
free(tmp);
|
||||
|
||||
unsetenv("HOME");
|
||||
ompi_unsetenv("HOME", &environ);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user