1
1

Finally get this right: move orte_sys_info.[ch] back into the orte

tree.
- fix up #include's throughout the tree (yay contrib/search_replace.pl!)
- remove a few extraneous #include's
- remove orte_sys_info*() from opal_init()/opal_finalize() (it's
  already in orte_init_stage1() and orte_system_finalize())
- remove dependencies in opal on orte_system_info -- util/os_path.c
  and util/os_create_dirpath.c (they only used path_sep, anyway --
  easily changed to #defines)

This commit was SVN r7059.
Этот коммит содержится в:
Jeff Squyres 2005-08-26 21:03:41 +00:00
родитель b3bd549331
Коммит c9cdb36b0b
21 изменённых файлов: 44 добавлений и 48 удалений

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

@ -83,7 +83,6 @@
#include "ompi/errhandler/errclass.h"
#include "ompi/communicator/communicator.h"
#include "orte/util/proc_info.h"
#include "opal/util/sys_info.h"
#include "ompi/mca/pml/pml.h"
#include "orte/mca/ns/ns.h"
#include "orte/mca/gpr/gpr.h"

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

@ -20,7 +20,7 @@
#include "opal/threads/mutex.h"
#include "opal/util/output.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "orte/dps/dps.h"
#include "orte/mca/oob/oob.h"
#include "orte/mca/ns/ns.h"

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

@ -17,7 +17,6 @@
#include "orte_config.h"
#include "opal/event/event.h"
#include "opal/util/sys_info.h"
#include "opal/runtime/opal_progress.h"
#include "opal/mca/maffinity/base/base.h"
#include "opal/mca/base/base.h"

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

@ -21,13 +21,13 @@
#include "opal/mca/paffinity/base/base.h"
#include "opal/mca/maffinity/base/base.h"
#include "opal/runtime/opal_progress.h"
#include "opal/util/sys_info.h"
#include "opal/threads/threads.h"
#include "opal/util/show_help.h"
#include "opal/util/stacktrace.h"
#include "opal/runtime/opal.h"
#include "opal/event/event.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/runtime/runtime.h"

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

@ -22,7 +22,6 @@
#include "opal/util/output.h"
#include "opal/util/malloc.h"
#include "opal/util/if.h"
#include "opal/util/sys_info.h"
#include "opal/memory/memory.h"
#include "opal/mca/base/base.h"
#include "opal/runtime/opal.h"
@ -61,9 +60,6 @@ int opal_finalize(void)
/* finalize the mca */
mca_base_close();
/* free memory associated with sys_info struct */
orte_sys_info_finalize();
/* finalize the memory manager / tracker */
opal_mem_free_finalize();

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

@ -20,7 +20,6 @@
#include "opal/util/malloc.h"
#include "opal/util/output.h"
#include "opal/util/sys_info.h"
#include "opal/memory/memory.h"
#include "opal/mca/base/base.h"
#include "opal/runtime/opal.h"
@ -82,9 +81,6 @@ int opal_init(void)
/* register handler for errnum -> string converstion */
opal_error_register(opal_err2str);
/* get system information */
orte_sys_info();
/* initialize the mca */
mca_base_open();

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

@ -47,8 +47,7 @@ headers = \
show_help.h \
show_help_lex.h \
stacktrace.h \
strncpy.h \
sys_info.h
strncpy.h
libopalutil_la_SOURCES = \
$(headers) \
@ -73,8 +72,7 @@ libopalutil_la_SOURCES = \
show_help.c \
show_help_lex.l \
stacktrace.c \
strncpy.c \
sys_info.c
strncpy.c
# Conditionally install the header files

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

@ -28,9 +28,17 @@
#include "opal/util/os_create_dirpath.h"
#include "opal/util/argv.h"
#include "opal/util/sys_info.h"
#include "ompi/include/constants.h"
#ifdef WIN32
#define PATH_SEP "\\"
#else
#define PATH_SEP "/"
#endif
static const char *path_sep = PATH_SEP;
int opal_os_create_dirpath(const char *path, const mode_t mode)
{
struct stat buf;
@ -57,12 +65,9 @@ int opal_os_create_dirpath(const char *path, const mode_t mode)
}
/* didnt work, so now have to build our way down the tree */
/* ensure system info is valid */
orte_sys_info();
/* Split the requested path up into its individual parts */
parts = opal_argv_split(path, orte_system_info.path_sep[0]);
parts = opal_argv_split(path, path_sep[0]);
/* Ensure to allocate enough space for tmp: the strlen of the
incoming path + 1 (for \0) */
@ -101,7 +106,7 @@ int opal_os_create_dirpath(const char *path, const mode_t mode)
if (2 == strlen(parts[0]) && isalpha(parts[0][0]) &&
':' == parts[0][1]) {
strcat(tmp, parts[i]);
strcat(tmp, orte_system_info.path_sep);
strcat(tmp, path_sep);
}
/* Otherwise, it's a relative path. Per the comment
@ -116,7 +121,7 @@ int opal_os_create_dirpath(const char *path, const mode_t mode)
name with path_sep */
if ('/' == path[0]) {
strcat(tmp, orte_system_info.path_sep);
strcat(tmp, path_sep);
}
strcat(tmp, parts[i]);
#endif
@ -126,8 +131,8 @@ int opal_os_create_dirpath(const char *path, const mode_t mode)
preceeding path_sep and then append this part */
else {
if (orte_system_info.path_sep[0] != tmp[strlen(tmp) - 1]) {
strcat(tmp, orte_system_info.path_sep);
if (path_sep[0] != tmp[strlen(tmp) - 1]) {
strcat(tmp, path_sep);
}
strcat(tmp, parts[i]);
}

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

@ -29,11 +29,18 @@
#include <stdlib.h>
#include <stdarg.h>
#include "opal/util/sys_info.h"
#include "opal/util/os_path.h"
#include "opal/util/sys_info.h"
#include "ompi/include/constants.h"
#ifdef WIN32
#define PATH_SEP "\\"
#else
#define PATH_SEP "/"
#endif
static const char *path_sep = PATH_SEP;
char *opal_os_path(bool relative, ...)
{
va_list ap, ap1;
@ -43,14 +50,8 @@ char *opal_os_path(bool relative, ...)
va_start(ap, relative);
va_start(ap1, relative);
/* make sure system info is filled and separator is non-NULL */
orte_sys_info();
if (NULL == orte_system_info.path_sep) {
return(NULL);
}
/* no way to protect ourselves from reading too far, so have to trust caller
that they ended the list with the NULL */
/* no way to protect ourselves from reading too far, so have to
trust caller that they ended the list with the NULL */
num_elements = 0;
total_length = 0;
@ -64,11 +65,11 @@ char *opal_os_path(bool relative, ...)
path[0] = '\0';
if (relative) {
strcpy(path, ".");
strcat(path, orte_system_info.path_sep);
strcat(path, path_sep);
}
else {
#ifndef WIN32
strcpy(path, orte_system_info.path_sep);
strcpy(path, path_sep);
#endif
}
return(path);
@ -92,8 +93,8 @@ char *opal_os_path(bool relative, ...)
}
while (NULL != (element=va_arg(ap1, char*))) {
if (orte_system_info.path_sep[0] != element[0]) {
strcat(path, orte_system_info.path_sep);
if (path_sep[0] != element[0]) {
strcat(path, path_sep);
}
strcat(path, element);
}

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

@ -36,7 +36,7 @@
#include "opal/util/opal_environ.h"
#include "opal/util/path.h"
#include "opal/util/show_help.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/iof/iof.h"
#include "orte/mca/ns/base/base.h"

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

@ -32,7 +32,7 @@
#include "opal/util/os_create_dirpath.h"
#include "opal/util/os_path.h"
#include "opal/util/output.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "orte/include/orte_constants.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/gpr/gpr.h"

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

@ -38,7 +38,7 @@
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "opal/mca/paffinity/base/base.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/univ_info.h"
#include "opal/util/opal_environ.h"
#include "orte/util/session_dir.h"

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

@ -55,7 +55,7 @@
#include "orte/mca/soh/base/base.h"
#include "orte/mca/pls/rsh/pls_rsh.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "opal/util/if.h"
#include "opal/util/if.h"
#include "opal/util/path.h"

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

@ -31,7 +31,7 @@
#include "orte/mca/ns/ns.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/ns/base/base.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "opal/util/argv.h"
orte_sds_base_module_t orte_sds_slurm_module = {

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

@ -20,11 +20,11 @@
#include <string.h>
#include "opal/util/sys_info.h"
#include "opal/util/output.h"
#include "opal/event/event.h"
#include "opal/threads/mutex.h"
#include "opal/threads/condition.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/runtime.h"
#include "orte/include/orte_constants.h"
#include "orte/util/proc_info.h"

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

@ -25,6 +25,7 @@ noinst_LTLIBRARIES = liborteutil.la
headers = \
proc_info.h \
session_dir.h \
sys_info.h \
universe_setup_file_io.h \
univ_info.h
@ -32,6 +33,7 @@ liborteutil_la_SOURCES = \
$(headers) \
proc_info.c \
session_dir.c \
sys_info.c \
universe_setup_file_io.c \
univ_info.c

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

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

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

@ -36,7 +36,7 @@
#include "support.h"
#include "orte/runtime/runtime.h"
#include "orte/util/proc_info.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "opal/util/malloc.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"

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

@ -30,7 +30,7 @@
#include "support.h"
#include "opal/runtime/opal.h"
#include "opal/include/constants.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "opal/util/os_path.h"
#include "opal/util/os_create_dirpath.h"

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

@ -34,7 +34,7 @@
#include "orte/include/orte_constants.h"
#include "orte/mca/ns/ns_types.h"
#include "orte/util/proc_info.h"
#include "opal/util/sys_info.h"
#include "orte/util/sys_info.h"
#include "opal/util/os_path.h"
#include "opal/util/os_create_dirpath.h"
#include "orte/util/session_dir.h"