1
1

fixed multiple problems w/ ompi_sys_info()

- moved to ompi_mpi_init after call to ompi_common_cmd_line_init
 - added call to ompi_common_cmd_line_init
 - fixed issues w/ string handling

This commit was SVN r1368.
Этот коммит содержится в:
Tim Woodall 2004-06-17 17:29:47 +00:00
родитель f05e7b4f0e
Коммит 6401dffd57
5 изменённых файлов: 15 добавлений и 6 удалений

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

@ -5,7 +5,7 @@
include $(top_srcdir)/config/Makefile.options include $(top_srcdir)/config/Makefile.options
SUBDIRS = config include src test SUBDIRS = config include src
EXTRA_DIST = README INSTALL VERSION Doxyfile EXTRA_DIST = README INSTALL VERSION Doxyfile

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

@ -9,7 +9,6 @@
#include "mpi.h" #include "mpi.h"
#include "mpi/c/bindings.h" #include "mpi/c/bindings.h"
#include "runtime/runtime.h" #include "runtime/runtime.h"
#include "util/sys_info.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Init = PMPI_Init #pragma weak MPI_Init = PMPI_Init
@ -38,9 +37,6 @@ int MPI_Init(int *argc, char ***argv)
} }
} }
/* Get the local system information and populate the ompi_system_info structure */
ompi_sys_info();
/* Call the back-end initialization function (we need to put as /* Call the back-end initialization function (we need to put as
little in this function as possible so that if it's profiled, we little in this function as possible so that if it's profiled, we
don't lose anything) */ don't lose anything) */

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

@ -6,10 +6,12 @@
#include "include/constants.h" #include "include/constants.h"
#include "runtime/runtime.h" #include "runtime/runtime.h"
#include "util/sys_info.h"
#include "mpi.h" #include "mpi.h"
#include "runtime/runtime.h" #include "runtime/runtime.h"
#include "communicator/communicator.h" #include "communicator/communicator.h"
#include "group/group.h" #include "group/group.h"
#include "util/common_cmd_line.h"
#include "errhandler/errhandler.h" #include "errhandler/errhandler.h"
#include "op/op.h" #include "op/op.h"
#include "mca/base/base.h" #include "mca/base/base.h"
@ -50,6 +52,15 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
ompi_proc_t** procs; ompi_proc_t** procs;
size_t nprocs; size_t nprocs;
/* Save command line parameters */
if (OMPI_SUCCESS != (ret = ompi_common_cmd_line_init(argc, argv))) {
return ret;
}
/* Get the local system information and populate the ompi_system_info structure */
ompi_sys_info();
/* Become a OMPI process */ /* Become a OMPI process */
if (OMPI_SUCCESS != (ret = ompi_init(argc, argv))) { if (OMPI_SUCCESS != (ret = ompi_init(argc, argv))) {

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

@ -45,6 +45,7 @@ char *ompi_os_path(bool relative, ...)
if (0 == num_elements) { /* must be looking for a simple answer */ if (0 == num_elements) { /* must be looking for a simple answer */
path = (char *)malloc(2); path = (char *)malloc(2);
path[0] = 0;
if (relative) { if (relative) {
strcpy(path, "."); strcpy(path, ".");
} }
@ -65,6 +66,7 @@ char *ompi_os_path(bool relative, ...)
if (NULL == path) { if (NULL == path) {
return(NULL); return(NULL);
} }
path[0] = 0;
if (relative) { if (relative) {
strcpy(path, "."); strcpy(path, ".");

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

@ -58,7 +58,7 @@ static int ompi_check_dir(bool create, char *directory)
char *ompi_find_session_dir(bool create, char *prefix) char *ompi_find_session_dir(bool create, char *prefix)
{ {
char *tmpprefix=NULL, *tmp=NULL; char *tmpprefix=NULL, *tmp=NULL;
char *sessions=NULL; char sessions[PATH_MAX];
sprintf(sessions, "openmpi-sessions-%s", ompi_system_info.user); sprintf(sessions, "openmpi-sessions-%s", ompi_system_info.user);