2004-05-20 17:54:14 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 07:32:36 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. 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.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* 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
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "orte_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
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#ifndef _ORTE_SYS_INFO_H_
|
|
|
|
#define _ORTE_SYS_INFO_H_
|
2004-10-25 18:14:20 +04:00
|
|
|
|
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
|
|
|
|
*
|
2005-03-14 23:57:21 +03:00
|
|
|
* The orte_sys_info() function fills the sysname, nodename, release, version, machine,
|
2006-08-23 07:32:36 +04:00
|
|
|
* and user fields
|
2004-05-27 20:26:36 +04:00
|
|
|
*
|
|
|
|
*/
|
2005-03-14 23:57:21 +03:00
|
|
|
struct orte_sys_info_t {
|
2004-05-27 20:26:36 +04:00
|
|
|
bool init; /**< Certifies that values have been filled.
|
2005-03-14 23:57:21 +03:00
|
|
|
* Certifies that the orte_sys_info() function has been
|
2004-05-27 20:26:36 +04:00
|
|
|
* 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 *user; /**< User id on this system. */
|
|
|
|
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
|
|
|
};
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef struct orte_sys_info_t orte_sys_info_t;
|
2004-05-20 17:54:14 +04:00
|
|
|
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC extern orte_sys_info_t orte_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
|
2005-03-14 23:57:21 +03:00
|
|
|
* upon which this code is executing. orte_sys_info populates a global
|
2004-08-10 08:59:34 +04:00
|
|
|
* variable with information about the system upon which the process
|
|
|
|
* is executing.
|
|
|
|
*
|
2005-03-14 23:57:21 +03:00
|
|
|
* Called from \c orte_init.
|
2004-05-26 23:11:55 +04:00
|
|
|
*
|
2005-03-14 23:57:21 +03:00
|
|
|
* @retval ORTE_SUCCESS If values are successfully determined.
|
|
|
|
* @retval ORTE_ERROR If the system does not provide the requested information.
|
2004-05-27 20:26:36 +04:00
|
|
|
*/
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC int orte_sys_info(void);
|
2004-10-29 02:21:20 +04:00
|
|
|
|
2005-03-19 02:40:08 +03:00
|
|
|
/*
|
|
|
|
* \internal
|
|
|
|
*
|
|
|
|
* Free any memory held in the system_info structure
|
|
|
|
*
|
|
|
|
* Called from \c orte_finalize
|
|
|
|
*
|
|
|
|
* @retval ORTE_SUCCESS If all values successfully released
|
|
|
|
* @retval ORTE_ERROR If any problems occur
|
|
|
|
*/
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC int orte_sys_info_finalize(void);
|
2005-03-19 02:40:08 +03:00
|
|
|
|
2004-10-29 02:21:20 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-10-25 18:14:20 +04:00
|
|
|
#endif
|