1
1

Adds the ompi_sys_info() function to the MPI_init function to initialize the system information structure. Added process id to the structure.

This commit was SVN r1204.
Этот коммит содержится в:
Ralph Castain 2004-06-08 15:20:16 +00:00
родитель 3772597c82
Коммит 8270768e62
3 изменённых файлов: 8 добавлений и 0 удалений

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

@ -9,6 +9,7 @@
#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
@ -36,6 +37,9 @@ int MPI_Init(int *argc, char ***argv)
exit(1); exit(1);
} }
} }
/* 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

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

@ -86,5 +86,8 @@ void ompi_sys_info(void)
ompi_system_info.user = strdup("unknown"); ompi_system_info.user = strdup("unknown");
} }
/* get the process id */
ompi_system_info.pid = getpid();
ompi_system_info.init = true; /* only indicates that we have been through here once - still have to test for NULL values */ ompi_system_info.init = true; /* only indicates that we have been through here once - still have to test for NULL values */
} }

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

@ -25,6 +25,7 @@ struct ompi_sys_info_t {
* Certifies that the ompi_sys_info() function has been * Certifies that the ompi_sys_info() function has been
* called at least once so fields have valid values * called at least once so fields have valid values
*/ */
int pid; /* Process ID for this process */
char *sysname; /**< Name of OS in use on this node. */ char *sysname; /**< Name of OS in use on this node. */
char *nodename; /**< Fully qualified host name on the network. */ char *nodename; /**< Fully qualified host name on the network. */
char *release; /**< Release level of the operating system. */ char *release; /**< Release level of the operating system. */