1
1

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.
Этот коммит содержится в:
Jeff Squyres 2005-04-04 22:55:26 +00:00
родитель 4e23a21803
Коммит 1701010301
15 изменённых файлов: 93 добавлений и 65 удалений

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

@ -38,7 +38,6 @@
#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"
@ -99,7 +98,7 @@ int main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {

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

@ -37,7 +37,6 @@
#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"
@ -65,7 +64,7 @@ int main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {

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

@ -26,7 +26,6 @@
#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"
@ -133,7 +132,7 @@ int main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {

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

@ -40,7 +40,6 @@
#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"
@ -75,7 +74,7 @@ int main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {

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

@ -40,7 +40,6 @@
#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"
@ -85,7 +84,7 @@ int main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {
@ -437,6 +436,7 @@ 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");
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);
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);
if(seed == NULL || atoi(seed) != 0) {
ompi_process_info.seed = true;
ompi_setenv("OMPI_MCA_pcmclient_env_procid", "0", true, &environ);
setenv("OMPI_MCA_pcmclient_env_procid", "0", 1);
} else {
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 */
ompi_setenv("OMPI_MCA_oob_base_include", "tcp", true, &environ);
setenv("OMPI_MCA_oob_base_include", "tcp", 1);
/* basic ompi init */
if (OMPI_SUCCESS != ompi_init(argc, argv)) {

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

@ -34,7 +34,6 @@
#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"
@ -67,7 +66,7 @@ int main (int argc, char* argv[])
orte_process_info.seed = true;
/* 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 */
orte_proc_info();
@ -174,12 +173,12 @@ static bool test2(void)
return false;
}
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);
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);
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");
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);
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);
if(seed == NULL || atoi(seed) != 0) {
ompi_process_info.seed = true;
ompi_setenv("OMPI_MCA_pcmclient_env_procid", "0", true, &environ);
setenv("OMPI_MCA_pcmclient_env_procid", "0", 1);
} else {
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 */
ompi_setenv("OMPI_MCA_oob_base_include", "tcp", true, &environ);
setenv("OMPI_MCA_oob_base_include", "tcp", 1);
/* basic ompi init */
if (OMPI_SUCCESS != ompi_init(argc, argv)) {

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

@ -18,7 +18,6 @@
#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"
@ -63,7 +62,7 @@ int main(int argc, char **argv)
orte_process_info.seed = true;
/* 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 */
orte_proc_info();

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

@ -21,7 +21,6 @@
#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"
@ -51,7 +50,7 @@ main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {

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

@ -21,7 +21,6 @@
#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"
@ -51,7 +50,7 @@ main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {

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

@ -21,7 +21,6 @@
#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"
@ -51,7 +50,7 @@ main(int argc, char **argv)
}
/* 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 */
if (!ompi_output_init()) {

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

@ -151,18 +151,18 @@ static bool test2(void)
/* 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",
ompi_system_info.user, NULL, NULL, NULL, NULL)) {
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
unsetenv("OMPI_PREFIX_ENV");
return(false);
}
ompi_session_dir_finalize ();
free(tmp);
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
unsetenv("OMPI_PREFIX_ENV");
return(true);
@ -174,18 +174,18 @@ static bool test3(void)
/* use the TMPDIR enviro variable */
char *tmp;
ompi_setenv("TMPDIR", "/tmp/trythis", true, &environ);
setenv("TMPDIR", "/tmp/trythis", 1);
if (OMPI_ERROR == ompi_session_dir(true, NULL, "test-universe",
ompi_system_info.user, NULL, NULL, NULL, NULL)) {
ompi_unsetenv("TMPDIR", &environ);
unsetenv("TMPDIR");
return(false);
}
ompi_session_dir_finalize ();
free(tmp);
ompi_unsetenv("TMPDIR", &environ);
unsetenv("TMPDIR");
return(true);
}
@ -196,18 +196,18 @@ static bool test4(void)
/* use the TMP enviro variable */
char *tmp;
ompi_setenv("TMP", "/tmp/trythis", true, &environ);
setenv("TMP", "/tmp/trythis", 1);
if (OMPI_ERROR == ompi_session_dir(true, NULL, "test-universe",
ompi_system_info.user, NULL, NULL, NULL, NULL)) {
ompi_unsetenv("TMP", &environ);
unsetenv("TMP");
return(false);
}
ompi_session_dir_finalize ();
free(tmp);
ompi_unsetenv("TMP", &environ);
unsetenv("TMP");
return(true);
}
@ -218,17 +218,17 @@ static bool test5(void)
/* use the HOME enviro variable */
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)) {
ompi_unsetenv("HOME", &environ);
unsetenv("HOME");
return(false);
}
ompi_session_dir_finalize ();
free(tmp);
ompi_unsetenv("HOME", &environ);
unsetenv("HOME");
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 return_value;

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

@ -35,7 +35,6 @@
#include "util/os_create_dirpath.h"
#include "util/session_dir.h"
#include "util/proc_info.h"
#include "util/environ.h"
#include "support.h"
@ -180,10 +179,10 @@ static bool test2(void)
/* 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)) {
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
unsetenv("OMPI_PREFIX_ENV");
return(false);
}
@ -192,7 +191,7 @@ static bool test2(void)
rmdir(tmp);
free(tmp);
ompi_unsetenv("OMPI_PREFIX_ENV", &environ);
unsetenv("OMPI_PREFIX_ENV");
return(true);
@ -206,10 +205,10 @@ static bool test3(void)
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)) {
ompi_unsetenv("TMPDIR", &environ);
unsetenv("TMPDIR");
return(false);
}
@ -218,7 +217,7 @@ static bool test3(void)
rmdir(tmp);
free(tmp);
ompi_unsetenv("TMPDIR", &environ);
unsetenv("TMPDIR");
return(true);
}
@ -231,10 +230,10 @@ static bool test4(void)
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)) {
ompi_unsetenv("TMP", &environ);
unsetenv("TMP");
return(false);
}
@ -243,7 +242,7 @@ static bool test4(void)
rmdir(tmp);
free(tmp);
ompi_unsetenv("TMP", &environ);
unsetenv("TMP");
return(true);
}
@ -256,10 +255,10 @@ static bool test5(void)
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)) {
ompi_unsetenv("HOME", &environ);
unsetenv("HOME");
return(false);
}
@ -268,7 +267,7 @@ static bool test5(void)
rmdir(tmp);
free(tmp);
ompi_unsetenv("HOME", &environ);
unsetenv("HOME");
return(true);
}