1
1

For consistency reasons always use opal_home_directory and

opal_tmp_directory.

This commit was SVN r18043.
Этот коммит содержится в:
George Bosilca 2008-03-31 18:13:41 +00:00
родитель d8eb0eeec3
Коммит ee784b601e
8 изменённых файлов: 25 добавлений и 45 удалений

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -34,6 +34,7 @@
#include "opal/mca/base/base.h" #include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h" #include "opal/mca/base/mca_base_component_repository.h"
#include "opal/constants.h" #include "opal/constants.h"
#include "opal/util/opal_environ.h"
/* /*
* Public variables * Public variables
@ -54,7 +55,7 @@ static void parse_verbose(char *e, opal_output_stream_t *lds);
int mca_base_open(void) int mca_base_open(void)
{ {
int param_index; int param_index;
char *value, *home; char *value;
opal_output_stream_t lds; opal_output_stream_t lds;
char hostname[64]; char hostname[64];
@ -65,13 +66,7 @@ int mca_base_open(void)
} }
/* Register some params */ /* Register some params */
#if !defined(__WINDOWS__) asprintf(&value, "%s:%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_install_dirs.pkglibdir, opal_home_directory() );
home = getenv("HOME");
asprintf(&value, "%s:%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_install_dirs.pkglibdir, home);
#else
home = getenv("USERPROFILE");
asprintf(&value, "%s;%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_install_dirs.pkglibdir, home);
#endif /* !defined(__WINDOWS__) */
mca_base_param_component_path = mca_base_param_component_path =
mca_base_param_reg_string_name("mca", "component_path", mca_base_param_reg_string_name("mca", "component_path",

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -46,6 +46,7 @@
#include "opal/mca/base/mca_base_param_internal.h" #include "opal/mca/base/mca_base_param_internal.h"
#include "opal/constants.h" #include "opal/constants.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/opal_environ.h"
/* /*
* Public variables * Public variables
@ -154,11 +155,7 @@ int mca_base_param_recache_files(bool rel_path_search)
char * new_agg_path = NULL, *agg_default_path = NULL; char * new_agg_path = NULL, *agg_default_path = NULL;
/* We may need this later */ /* We may need this later */
#if !defined(__WINDOWS__) home = (char*)opal_home_directory();
home = getenv("HOME");
#else
home = getenv("USERPROFILE");
#endif /* !defined(__WINDOWS__) */
if(NULL == cwd) { if(NULL == cwd) {
cwd = (char *) malloc(sizeof(char) * MAXPATHLEN); cwd = (char *) malloc(sizeof(char) * MAXPATHLEN);

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@ -116,7 +116,6 @@ OBJ_CLASS_INSTANCE(opal_output_stream_t, opal_object_t, construct, NULL);
bool opal_output_init(void) bool opal_output_init(void)
{ {
int i; int i;
char *str;
char hostname[32]; char hostname[32];
if (initialized) { if (initialized) {
@ -154,20 +153,9 @@ bool opal_output_init(void)
/* Set some defaults */ /* Set some defaults */
asprintf(&output_prefix, "output-pid%d-", getpid()); asprintf(&output_prefix, "output-pid%d-", getpid());
if (NULL != (str = getenv("TMPDIR"))) { output_dir = strdup(opal_tmp_directory());
output_dir = strdup(str);
} else if (NULL != (str = getenv("TEMP"))) {
output_dir = strdup(str);
} else if (NULL != (str = getenv("TMP"))) {
output_dir = strdup(str);
} else if (NULL != (str = getenv("HOME"))) {
output_dir = strdup(str);
} else {
output_dir = strdup(".");
}
/* Open the default verbose stream */ /* Open the default verbose stream */
verbose_stream = opal_output_open(&verbose); verbose_stream = opal_output_open(&verbose);
return true; return true;
} }
@ -192,7 +180,7 @@ int opal_output_reopen(int output_id, opal_output_stream_t * lds)
/* /*
* Enable and disable outptu streams * Enable and disable output streams
*/ */
bool opal_output_switch(int output_id, bool enable) bool opal_output_switch(int output_id, bool enable)
{ {

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -73,6 +73,7 @@
#include "opal/util/opal_environ.h" #include "opal/util/opal_environ.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/basename.h" #include "opal/util/basename.h"
#include "opal/util/opal_environ.h"
#include "orte/util/name_fns.h" #include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h" #include "orte/runtime/orte_globals.h"
@ -448,7 +449,7 @@ static int plm_gridengine_launch_job(orte_job_t *jdata)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
orted_path)); orted_path));
var = getenv("HOME"); var = opal_home_directory();
if (NULL != var) { if (NULL != var) {
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
"%s plm:gridengine: changing to directory %s", "%s plm:gridengine: changing to directory %s",

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2007 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@ -68,6 +68,7 @@
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/trace.h" #include "opal/util/trace.h"
#include "opal/util/basename.h" #include "opal/util/basename.h"
#include "opal/util/opal_environ.h"
#include "orte/util/session_dir.h" #include "orte/util/session_dir.h"
#include "orte/util/name_fns.h" #include "orte/util/name_fns.h"
@ -742,7 +743,7 @@ int orte_plm_process_launch(orte_job_t *jdata)
not the local node. If the user does not start not the local node. If the user does not start
in $HOME on the remote nodes... well... let's in $HOME on the remote nodes... well... let's
hope they start in $HOME. :-) */ hope they start in $HOME. :-) */
var = getenv("HOME"); var = opal_home_directory();
if (NULL != var) { if (NULL != var) {
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
"%s plm:process: changing to directory %s", "%s plm:process: changing to directory %s",

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

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2004-2007 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -60,6 +60,7 @@
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/trace.h" #include "opal/util/trace.h"
#include "opal/util/basename.h" #include "opal/util/basename.h"
#include "opal/util/opal_environ.h"
#include "orte/util/proc_info.h" #include "orte/util/proc_info.h"
#include "orte/util/univ_info.h" #include "orte/util/univ_info.h"
@ -756,7 +757,7 @@ int orte_plm_submit_launch(orte_job_t *jdata)
not the local node. If the user does not start not the local node. If the user does not start
in $HOME on the remote nodes... well... let's in $HOME on the remote nodes... well... let's
hope they start in $HOME. :-) */ hope they start in $HOME. :-) */
var = getenv("HOME"); var = opal_home_directory();
if (NULL != var) { if (NULL != var) {
if (mca_plm_submit_component.debug) { if (mca_plm_submit_component.debug) {
opal_output(0, "plm:submit: changing to directory %s", var); opal_output(0, "plm:submit: changing to directory %s", var);

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

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2004-2007 The Trustees of Indiana University. * Copyright (c) 2004-2007 The Trustees of Indiana University.
* All rights reserved. * All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * Copyright (c) 2004-2008 The Trustees of the University of Tennessee.
* All rights reserved. * All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
@ -23,8 +23,8 @@
#include "opal/mca/base/base.h" #include "opal/mca/base/base.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/opal_environ.h"
#include "opal/mca/base/mca_base_param.h" #include "opal/mca/base/mca_base_param.h"
#include "opal/util/opal_environ.h"
#include "orte/mca/snapc/snapc.h" #include "orte/mca/snapc/snapc.h"
#include "orte/mca/snapc/base/base.h" #include "orte/mca/snapc/base/base.h"
@ -62,7 +62,6 @@ int orte_snapc_base_open(void)
{ {
int value = 0; int value = 0;
char * str_value = NULL; char * str_value = NULL;
const char * home = NULL;
OPAL_OUTPUT_VERBOSE((10, orte_snapc_base_output, OPAL_OUTPUT_VERBOSE((10, orte_snapc_base_output,
"snapc:base: open()")); "snapc:base: open()"));
@ -84,14 +83,12 @@ int orte_snapc_base_open(void)
"snapc:base: open: verbose = %d", "snapc:base: open: verbose = %d",
value)); value));
home = opal_home_directory();
/* Global Snapshot directory */ /* Global Snapshot directory */
mca_base_param_reg_string_name("snapc", mca_base_param_reg_string_name("snapc",
"base_global_snapshot_dir", "base_global_snapshot_dir",
"The base directory to use when storing global snapshots", "The base directory to use when storing global snapshots",
false, false, false, false,
home, opal_home_directory(),
&orte_snapc_base_global_snapshot_dir); &orte_snapc_base_global_snapshot_dir);
OPAL_OUTPUT_VERBOSE((20, orte_snapc_base_output, OPAL_OUTPUT_VERBOSE((20, orte_snapc_base_output,

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -55,7 +55,7 @@ int orte_util_check_context_cwd(orte_app_context_t *context,
bool want_chdir) bool want_chdir)
{ {
bool good = true; bool good = true;
char *tmp; const char *tmp;
char hostname[MAXHOSTNAMELEN]; char hostname[MAXHOSTNAMELEN];
/* Use hostname in a few messages below */ /* Use hostname in a few messages below */
@ -81,7 +81,7 @@ int orte_util_check_context_cwd(orte_app_context_t *context,
was a system-supplied default directory, so it's ok was a system-supplied default directory, so it's ok
to not go there. Try to go to the $HOME directory to not go there. Try to go to the $HOME directory
instead. */ instead. */
tmp = getenv("HOME"); tmp = opal_home_directory();
if (NULL != tmp) { if (NULL != tmp) {
/* Try $HOME. Same test as above. */ /* Try $HOME. Same test as above. */
good = true; good = true;