From 2d709f768af904f820cd8bef27bc8250174c3b2f Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 20 May 2004 13:54:14 +0000 Subject: [PATCH] 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. --- configure.ac | 2 ++ src/util/Makefile.am | 2 ++ src/util/sys_info.c | 14 ++++++++++++++ src/util/sys_info.h | 15 +++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 src/util/sys_info.c create mode 100644 src/util/sys_info.h diff --git a/configure.ac b/configure.ac index 37d8eb4b2b..b959855c48 100644 --- a/configure.ac +++ b/configure.ac @@ -827,5 +827,7 @@ AC_CONFIG_FILES([ src/tools/laminfo/Makefile src/tools/mpirun/Makefile src/tools/wrappers/Makefile + + src/RTE/universe/Makefile ]) AC_OUTPUT diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 7bbb5ba131..f7a7419b00 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -17,6 +17,7 @@ headers = \ if.h \ output.h \ path.h \ + sys_info.h \ strncpy.h libutil_la_SOURCES = \ @@ -27,6 +28,7 @@ libutil_la_SOURCES = \ if.c \ output.c \ path.c \ + sys_info.c \ strncpy.c # Conditionally install the header files diff --git a/src/util/sys_info.c b/src/util/sys_info.c new file mode 100644 index 0000000000..61485492c2 --- /dev/null +++ b/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)); + +} diff --git a/src/util/sys_info.h b/src/util/sys_info.h new file mode 100644 index 0000000000..770d5fd89f --- /dev/null +++ b/src/util/sys_info.h @@ -0,0 +1,15 @@ +/* + * $HEADER$ + */ + +/** @file **/ + +#include +#include + + +typedef struct utsname ompi_sys_info_t; + +extern ompi_sys_info_t ompi_system_info; + +int ompi_sys_info(void);