2004-05-20 17:54:14 +04:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-05-20 17:54:14 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-05-27 20:26:36 +04:00
|
|
|
/** @file:
|
2004-05-26 06:23:01 +04:00
|
|
|
*
|
2004-05-27 20:26:36 +04:00
|
|
|
* Populates global structure with system-specific information.
|
2004-06-12 14:56:32 +04:00
|
|
|
*
|
|
|
|
* Notes: add limits.h, compute size of integer and other types via sizeof(type)*CHAR_BIT
|
|
|
|
*
|
2004-05-20 21:38:54 +04:00
|
|
|
*/
|
|
|
|
|
2004-10-22 20:06:05 +04:00
|
|
|
#include "ompi_config.h"
|
2004-05-27 20:26:36 +04:00
|
|
|
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_SYS_UTSNAME_H
|
2004-05-20 17:54:14 +04:00
|
|
|
#include <sys/utsname.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-06-11 20:54:05 +04:00
|
|
|
#include <sys/types.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#endif
|
2004-05-20 17:54:14 +04:00
|
|
|
|
2004-10-25 18:14:20 +04:00
|
|
|
#ifndef _OMPI_SYS_INFO_H_
|
|
|
|
#define _OMPI_SYS_INFO_H_
|
|
|
|
|
2004-10-29 02:21:20 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-05-27 20:26:36 +04:00
|
|
|
/**
|
|
|
|
* System information structure
|
|
|
|
*
|
|
|
|
* The ompi_sys_info() function fills the sysname, nodename, release, version, machine,
|
2004-06-29 11:02:57 +04:00
|
|
|
* path_sep, and user fields
|
2004-05-27 20:26:36 +04:00
|
|
|
*
|
|
|
|
*/
|
2004-05-21 01:28:59 +04:00
|
|
|
struct ompi_sys_info_t {
|
2004-05-27 20:26:36 +04:00
|
|
|
bool init; /**< Certifies that values have been filled.
|
|
|
|
* Certifies that the ompi_sys_info() function has been
|
|
|
|
* called at least once so fields have valid values
|
|
|
|
*/
|
|
|
|
char *sysname; /**< Name of OS in use on this node. */
|
|
|
|
char *nodename; /**< Fully qualified host name on the network. */
|
|
|
|
char *release; /**< Release level of the operating system. */
|
|
|
|
char *version; /**< Version of the operating system release. */
|
|
|
|
char *machine; /**< Type of hardware composing this node. */
|
|
|
|
char *path_sep; /**< Path separation char, saved as string.
|
|
|
|
* The character used to separate directories in the path -
|
|
|
|
* a value that is usually either a '\' or '/', depending
|
|
|
|
* upon the operating system
|
|
|
|
*/
|
|
|
|
char *user; /**< User id on this system. */
|
|
|
|
char *enviro; /**< Computing environment employed on this system.
|
|
|
|
* Indicates the local computing environment for managing
|
|
|
|
* and scheduling resources - e.g., SLURM, PBS, LSF, or BProc
|
|
|
|
*/
|
|
|
|
char *suffix; /**< Automatic suffix added to file names.
|
|
|
|
* Some computing environments automatically "tag" files
|
|
|
|
* created by applications with a computer-generated suffix
|
|
|
|
* to ensure uniqueness of the file name. This field records
|
|
|
|
* that value for future use.
|
|
|
|
*/
|
2004-05-21 01:28:59 +04:00
|
|
|
};
|
|
|
|
typedef struct ompi_sys_info_t ompi_sys_info_t;
|
2004-05-20 17:54:14 +04:00
|
|
|
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC extern ompi_sys_info_t ompi_system_info;
|
2004-05-20 17:54:14 +04:00
|
|
|
|
2004-08-10 08:59:34 +04:00
|
|
|
|
2004-05-26 23:11:55 +04:00
|
|
|
/**
|
2004-08-10 08:59:34 +04:00
|
|
|
* \internal
|
|
|
|
*
|
|
|
|
* Discover and record a wide range of information about the system
|
|
|
|
* upon which this code is executing. ompi_sys_info populates a global
|
|
|
|
* variable with information about the system upon which the process
|
|
|
|
* is executing.
|
|
|
|
*
|
|
|
|
* Called from \c ompi_init.
|
2004-05-26 23:11:55 +04:00
|
|
|
*
|
2004-06-29 11:02:57 +04:00
|
|
|
* @retval OMPI_SUCCESS If values are successfully determined.
|
|
|
|
* @retval OMPI_ERROR If the system does not provide the requested information.
|
2004-05-27 20:26:36 +04:00
|
|
|
*/
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC int ompi_sys_info(void);
|
2004-10-29 02:21:20 +04:00
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-10-25 18:14:20 +04:00
|
|
|
#endif
|