This adds into the system a utility for detecting what kind of system we are on. The utility provides a global variable ompi_system_info that contains information on the operating system, release and version, machine architecture, and network node name. I'll provide additional documentation via Doxygen once I figure out how to put it into the .h file.
Code was reviewed by Jeff - thanks Jeff! This commit was SVN r1141.
Этот коммит содержится в:
родитель
9fa9cd9b0a
Коммит
2d709f768a
@ -827,5 +827,7 @@ AC_CONFIG_FILES([
|
|||||||
src/tools/laminfo/Makefile
|
src/tools/laminfo/Makefile
|
||||||
src/tools/mpirun/Makefile
|
src/tools/mpirun/Makefile
|
||||||
src/tools/wrappers/Makefile
|
src/tools/wrappers/Makefile
|
||||||
|
|
||||||
|
src/RTE/universe/Makefile
|
||||||
])
|
])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
@ -17,6 +17,7 @@ headers = \
|
|||||||
if.h \
|
if.h \
|
||||||
output.h \
|
output.h \
|
||||||
path.h \
|
path.h \
|
||||||
|
sys_info.h \
|
||||||
strncpy.h
|
strncpy.h
|
||||||
|
|
||||||
libutil_la_SOURCES = \
|
libutil_la_SOURCES = \
|
||||||
@ -27,6 +28,7 @@ libutil_la_SOURCES = \
|
|||||||
if.c \
|
if.c \
|
||||||
output.c \
|
output.c \
|
||||||
path.c \
|
path.c \
|
||||||
|
sys_info.c \
|
||||||
strncpy.c
|
strncpy.c
|
||||||
|
|
||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
14
src/util/sys_info.c
Обычный файл
14
src/util/sys_info.c
Обычный файл
@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "util/sys_info.h"
|
||||||
|
|
||||||
|
ompi_sys_info_t ompi_system_info;
|
||||||
|
|
||||||
|
int ompi_sys_info(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
return (uname(&ompi_system_info));
|
||||||
|
|
||||||
|
}
|
15
src/util/sys_info.h
Обычный файл
15
src/util/sys_info.h
Обычный файл
@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file **/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct utsname ompi_sys_info_t;
|
||||||
|
|
||||||
|
extern ompi_sys_info_t ompi_system_info;
|
||||||
|
|
||||||
|
int ompi_sys_info(void);
|
Загрузка…
Ссылка в новой задаче
Block a user