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