This will have zero impact on current operations. It adds some functionality for monitoring system state-of-health to support the Eclipse interface project. No use is made of that functionality in the system yet, but this will come along soon. I'll provide more info on exactly what information is now being stored later.
This commit was SVN r3672.
Этот коммит содержится в:
родитель
4ee157b366
Коммит
bf4bfd7472
src
include
mca
ns
svc/bproc_soh
mpi/runtime
runtime
Makefile.amompi_rte_job_startup.compi_rte_process_status.compi_rte_vm_status.compi_vm_register.cruntime.hruntime_types.h
util
@ -48,7 +48,12 @@ enum {
|
||||
OMPI_PROC_TERMINATING = -28,
|
||||
OMPI_PROC_ALIVE = -29,
|
||||
OMPI_PROC_RUNNING = -30,
|
||||
OMPI_PROC_KILLED = -31
|
||||
OMPI_PROC_KILLED = -31,
|
||||
OMPI_PROC_EXITED = -32,
|
||||
OMPI_NODE_UP = -33,
|
||||
OMPI_NODE_DOWN = -34,
|
||||
OMPI_NODE_BOOTING = -35,
|
||||
OMPI_NODE_ERROR = -36
|
||||
};
|
||||
|
||||
#endif /* OMPI_CONSTANTS_H */
|
||||
|
@ -68,6 +68,10 @@ OMPI_DECLSPEC char* mca_ns_base_get_proc_name_string(const ompi_process_name_
|
||||
|
||||
OMPI_DECLSPEC char* mca_ns_base_get_vpid_string(const ompi_process_name_t* name);
|
||||
|
||||
OMPI_DECLSPEC char* mca_ns_base_convert_vpid_to_string(const mca_ns_base_vpid_t vpid);
|
||||
|
||||
OMPI_DECLSPEC mca_ns_base_vpid_t mca_ns_base_convert_string_to_vpid(const char* vpid_string);
|
||||
|
||||
OMPI_DECLSPEC char* mca_ns_base_get_jobid_string(const ompi_process_name_t* name);
|
||||
|
||||
OMPI_DECLSPEC char* mca_ns_base_convert_jobid_to_string(const mca_ns_base_jobid_t jobid);
|
||||
@ -76,6 +80,10 @@ OMPI_DECLSPEC mca_ns_base_jobid_t mca_ns_base_convert_string_to_jobid(const c
|
||||
|
||||
OMPI_DECLSPEC char* mca_ns_base_get_cellid_string(const ompi_process_name_t* name);
|
||||
|
||||
OMPI_DECLSPEC mca_ns_base_cellid_t mca_ns_base_convert_string_to_cellid(const char* cellid_string);
|
||||
|
||||
OMPI_DECLSPEC char* mca_ns_base_convert_cellid_to_string(const mca_ns_base_cellid_t cellid);
|
||||
|
||||
OMPI_DECLSPEC mca_ns_base_vpid_t mca_ns_base_get_vpid(const ompi_process_name_t* name);
|
||||
|
||||
OMPI_DECLSPEC mca_ns_base_jobid_t mca_ns_base_get_jobid(const ompi_process_name_t* name);
|
||||
@ -90,6 +98,10 @@ OMPI_DECLSPEC int mca_ns_base_pack_name(void *dest, void *src, int n);
|
||||
|
||||
OMPI_DECLSPEC int mca_ns_base_unpack_name(void *dest, void *src, int n);
|
||||
|
||||
OMPI_DECLSPEC int mca_ns_base_pack_cellid(void *dest, void *src, int n);
|
||||
|
||||
OMPI_DECLSPEC int mca_ns_base_unpack_cellid(void *dest, void *src, int n);
|
||||
|
||||
OMPI_DECLSPEC int mca_ns_base_pack_jobid(void *dest, void *src, int n);
|
||||
|
||||
OMPI_DECLSPEC int mca_ns_base_unpack_jobid(void *dest, void *src, int n);
|
||||
|
@ -185,6 +185,34 @@ char* mca_ns_base_get_vpid_string(const ompi_process_name_t* name)
|
||||
}
|
||||
|
||||
|
||||
char* mca_ns_base_convert_vpid_to_string(const mca_ns_base_vpid_t vpid)
|
||||
{
|
||||
char *vpid_string;
|
||||
|
||||
if (0 > asprintf(&vpid_string, "%0X", vpid)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return vpid_string;
|
||||
}
|
||||
|
||||
|
||||
mca_ns_base_vpid_t mca_ns_base_convert_string_to_vpid(const char* vpidstring)
|
||||
{
|
||||
unsigned long int tmpint;
|
||||
mca_ns_base_vpid_t vpid;
|
||||
|
||||
tmpint = strtoul(vpidstring, NULL, 16);
|
||||
if (MCA_NS_BASE_VPID_MAX >= tmpint) {
|
||||
vpid = (mca_ns_base_vpid_t)tmpint;
|
||||
} else {
|
||||
vpid = MCA_NS_BASE_VPID_MAX;
|
||||
}
|
||||
|
||||
return vpid;
|
||||
}
|
||||
|
||||
|
||||
char* mca_ns_base_get_jobid_string(const ompi_process_name_t* name)
|
||||
{
|
||||
char *name_string;
|
||||
@ -245,6 +273,34 @@ char* mca_ns_base_get_cellid_string(const ompi_process_name_t* name)
|
||||
}
|
||||
|
||||
|
||||
char *mca_ns_base_convert_cellid_to_string(const mca_ns_base_cellid_t cellid)
|
||||
{
|
||||
char *cellid_string;
|
||||
|
||||
if (0 > asprintf(&cellid_string, "%0X", cellid)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return cellid_string;
|
||||
}
|
||||
|
||||
|
||||
mca_ns_base_cellid_t mca_ns_base_convert_string_to_cellid(const char *cellidstring)
|
||||
{
|
||||
unsigned long int tmpint;
|
||||
mca_ns_base_cellid_t cellid;
|
||||
|
||||
tmpint = strtoul(cellidstring, NULL, 16);
|
||||
if (MCA_NS_BASE_CELLID_MAX >= tmpint) {
|
||||
cellid = (mca_ns_base_cellid_t)tmpint;
|
||||
} else {
|
||||
cellid = MCA_NS_BASE_CELLID_MAX;
|
||||
}
|
||||
|
||||
return cellid;
|
||||
}
|
||||
|
||||
|
||||
mca_ns_base_vpid_t mca_ns_base_get_vpid(const ompi_process_name_t* name)
|
||||
{
|
||||
if (NULL == name) { /* got an error */
|
||||
@ -362,6 +418,40 @@ int mca_ns_base_unpack_name(void *dest, void *src, int n)
|
||||
}
|
||||
|
||||
|
||||
int mca_ns_base_pack_cellid(void *dest, void *src, int n)
|
||||
{
|
||||
mca_ns_base_cellid_t *dj, *sj;
|
||||
int i;
|
||||
|
||||
dj = (mca_ns_base_cellid_t*) dest;
|
||||
sj = (mca_ns_base_cellid_t*) src;
|
||||
|
||||
for (i=0; i<n; i++) {
|
||||
*dj = htonl(*sj);
|
||||
dj++; sj++;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int mca_ns_base_unpack_cellid(void *dest, void *src, int n)
|
||||
{
|
||||
mca_ns_base_cellid_t *dj, *sj;
|
||||
int i;
|
||||
|
||||
dj = (mca_ns_base_cellid_t*) dest;
|
||||
sj = (mca_ns_base_cellid_t*) src;
|
||||
|
||||
for (i=0; i<n; i++) {
|
||||
*dj = ntohl(*sj);
|
||||
dj++; sj++;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int mca_ns_base_pack_jobid(void *dest, void *src, int n)
|
||||
{
|
||||
mca_ns_base_jobid_t *dj, *sj;
|
||||
|
116
src/mca/ns/ns.h
116
src/mca/ns/ns.h
@ -342,6 +342,40 @@ typedef char* (*mca_ns_base_module_get_proc_name_string_fn_t)(const ompi_process
|
||||
*/
|
||||
typedef char* (*mca_ns_base_module_get_vpid_string_fn_t)(const ompi_process_name_t *name);
|
||||
|
||||
/**
|
||||
* Convert vpid to character string
|
||||
* Returns the vpid in a character string representation. The string is created
|
||||
* by expressing the provided vpid in hexadecimal. Memory for the string is
|
||||
* allocated by the function - releasing that allocation is the responsibility of
|
||||
* the calling program.
|
||||
*
|
||||
* @param vpid The vpid to be converted.
|
||||
*
|
||||
* @retval *vpid_string A pointer to a character string representation of the vpid.
|
||||
* @retval NULL Indicates an error occurred - probably no memory could be allocated.
|
||||
*
|
||||
* @code
|
||||
* vpid-string = ompi_name_server.convert_vpid_to_string(vpid);
|
||||
* @endcode
|
||||
*/
|
||||
typedef char* (*mca_ns_base_module_convert_vpid_to_string_fn_t)(const mca_ns_base_vpid_t vpid);
|
||||
|
||||
/**
|
||||
* Convert a string to a vpid.
|
||||
* Converts a characters string into a vpid. The character string must be a
|
||||
* hexadecimal representation of a valid vpid.
|
||||
*
|
||||
* @param vpidstring The string to be converted.
|
||||
*
|
||||
* @retval vpid The resulting vpid
|
||||
* @retval MCA_NS_BASE_VPID_MAX String could not be converted.
|
||||
*
|
||||
* @code
|
||||
* vpid = ompi_name_server.convert_string_to_vpid(vpidstring);
|
||||
* @endcode
|
||||
*/
|
||||
typedef mca_ns_base_vpid_t (*mca_ns_base_module_convert_string_to_vpid_fn_t)(const char *vpidstring);
|
||||
|
||||
/**
|
||||
* Get the job id as a character string.
|
||||
* The get_jobid_string() function returns the job id in a character string
|
||||
@ -420,6 +454,40 @@ typedef mca_ns_base_jobid_t (*mca_ns_base_module_convert_string_to_jobid_fn_t)(c
|
||||
*/
|
||||
typedef char* (*mca_ns_base_module_get_cellid_string_fn_t)(const ompi_process_name_t *name);
|
||||
|
||||
/**
|
||||
* Convert cellid to character string
|
||||
* Returns the cellid in a character string representation. The string is created
|
||||
* by expressing the provided cellid in hexadecimal. Memory for the string is
|
||||
* allocated by the function - releasing that allocation is the responsibility of
|
||||
* the calling program.
|
||||
*
|
||||
* @param cellid The cellid to be converted.
|
||||
*
|
||||
* @retval *cellid_string A pointer to a character string representation of the cellid.
|
||||
* @retval NULL Indicates an error occurred - probably no memory could be allocated.
|
||||
*
|
||||
* @code
|
||||
* cellid-string = ompi_name_server.convert_cellid_to_string(cellid);
|
||||
* @endcode
|
||||
*/
|
||||
typedef char* (*mca_ns_base_module_convert_cellid_to_string_fn_t)(const mca_ns_base_cellid_t cellid);
|
||||
|
||||
/**
|
||||
* Convert a string to a cellid.
|
||||
* Converts a characters string into a cellid. The character string must be a
|
||||
* hexadecimal representation of a valid cellid.
|
||||
*
|
||||
* @param cellidstring The string to be converted.
|
||||
*
|
||||
* @retval cellid The resulting cellid
|
||||
* @retval MCA_NS_BASE_CELLID_MAX String could not be converted.
|
||||
*
|
||||
* @code
|
||||
* cellid = ompi_name_server.convert_string_to_cellid(cellidstring);
|
||||
* @endcode
|
||||
*/
|
||||
typedef mca_ns_base_cellid_t (*mca_ns_base_module_convert_string_to_cellid_fn_t)(const char *cellidstring);
|
||||
|
||||
/**
|
||||
* Get the virtual process id as a numeric value.
|
||||
* The get_vpid() function returns the vpid in a numeric representation -
|
||||
@ -542,6 +610,48 @@ typedef int (*mca_ns_base_module_pack_name_fn_t)(void *dest, void *src, int n);
|
||||
*/
|
||||
typedef int (*mca_ns_base_module_unpack_name_fn_t)(void *dest, void *src, int n);
|
||||
|
||||
/*
|
||||
* Pack a cellid for transmission and/or registry storage
|
||||
* Given a source location and the number of contiguous cellids stored there,
|
||||
* this function packs those values into the given destination, converting
|
||||
* each value into network byte order.
|
||||
*
|
||||
* @param dest A void* pointing to the starting location for the destination
|
||||
* memory. Note that this memory MUST be preallocated and adequately sized.
|
||||
* @param src A void* pointing to the starting location of the source data.
|
||||
* @param n The number of cellids to be packed.
|
||||
*
|
||||
* @retval OMPI_SUCCESS Indicates that the cellids were successfully packed.
|
||||
*
|
||||
* @code
|
||||
* status_code = ompi_name_server.pack_cellid(&dest, &src, n);
|
||||
* @endcode
|
||||
*
|
||||
*/
|
||||
typedef int (*mca_ns_base_module_pack_cellid_fn_t)(void *dest, void *src, int n);
|
||||
|
||||
/*
|
||||
* Unpack a cellid
|
||||
* Given a source location and the number of contiguous cellids stored there,
|
||||
* this function unpacks those values into the given destination, converting
|
||||
* each jobid from network byte order to the host environment.
|
||||
*
|
||||
* @param dest A void* pointing to the starting location for the destination
|
||||
* memory. Note that this memory MUST be preallocated and adequately sized.
|
||||
* @param src A void* pointing to the starting location of the source data.
|
||||
* @param n The number of cellids to be unpacked.
|
||||
*
|
||||
* @retval OMPI_SUCCESS Indicates that the jobids were successfully unpacked.
|
||||
*
|
||||
* @code
|
||||
* status_code = ompi_name_server.unpack_cellid(&dest, &src, n);
|
||||
* @endcode
|
||||
*
|
||||
*/
|
||||
typedef int (*mca_ns_base_module_unpack_cellid_fn_t)(void *dest, void *src, int n);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Pack a jobid for transmission and/or registry storage
|
||||
* Given a source location and the number of contiguous jobids stored there,
|
||||
@ -598,16 +708,22 @@ struct mca_ns_base_module_1_0_0_t {
|
||||
mca_ns_base_module_free_name_fn_t free_name;
|
||||
mca_ns_base_module_get_proc_name_string_fn_t get_proc_name_string;
|
||||
mca_ns_base_module_get_vpid_string_fn_t get_vpid_string;
|
||||
mca_ns_base_module_convert_vpid_to_string_fn_t convert_vpid_to_string;
|
||||
mca_ns_base_module_convert_string_to_vpid_fn_t convert_string_to_vpid;
|
||||
mca_ns_base_module_get_jobid_string_fn_t get_jobid_string;
|
||||
mca_ns_base_module_convert_jobid_to_string_fn_t convert_jobid_to_string;
|
||||
mca_ns_base_module_convert_string_to_jobid_fn_t convert_string_to_jobid;
|
||||
mca_ns_base_module_get_cellid_string_fn_t get_cellid_string;
|
||||
mca_ns_base_module_convert_cellid_to_string_fn_t convert_cellid_to_string;
|
||||
mca_ns_base_module_convert_string_to_cellid_fn_t convert_string_to_cellid;
|
||||
mca_ns_base_module_get_vpid_fn_t get_vpid;
|
||||
mca_ns_base_module_get_jobid_fn_t get_jobid;
|
||||
mca_ns_base_module_get_cellid_fn_t get_cellid;
|
||||
mca_ns_base_module_compare_fn_t compare;
|
||||
mca_ns_base_module_pack_name_fn_t pack_name;
|
||||
mca_ns_base_module_unpack_name_fn_t unpack_name;
|
||||
mca_ns_base_module_pack_cellid_fn_t pack_cellid;
|
||||
mca_ns_base_module_unpack_cellid_fn_t unpack_cellid;
|
||||
mca_ns_base_module_pack_jobid_fn_t pack_jobid;
|
||||
mca_ns_base_module_unpack_jobid_fn_t unpack_jobid;
|
||||
};
|
||||
|
@ -71,16 +71,22 @@ static mca_ns_base_module_t mca_ns_proxy = {
|
||||
mca_ns_base_free_name,
|
||||
mca_ns_base_get_proc_name_string,
|
||||
mca_ns_base_get_vpid_string,
|
||||
mca_ns_base_convert_vpid_to_string,
|
||||
mca_ns_base_convert_string_to_vpid,
|
||||
mca_ns_base_get_jobid_string,
|
||||
mca_ns_base_convert_jobid_to_string,
|
||||
mca_ns_base_convert_string_to_jobid,
|
||||
mca_ns_base_get_cellid_string,
|
||||
mca_ns_base_convert_cellid_to_string,
|
||||
mca_ns_base_convert_string_to_cellid,
|
||||
mca_ns_base_get_vpid,
|
||||
mca_ns_base_get_jobid,
|
||||
mca_ns_base_get_cellid,
|
||||
mca_ns_base_compare,
|
||||
mca_ns_base_pack_name,
|
||||
mca_ns_base_unpack_name,
|
||||
mca_ns_base_pack_cellid,
|
||||
mca_ns_base_unpack_cellid,
|
||||
mca_ns_base_pack_jobid,
|
||||
mca_ns_base_unpack_jobid
|
||||
};
|
||||
|
@ -73,10 +73,14 @@ static mca_ns_base_module_t mca_ns_replica = {
|
||||
mca_ns_base_free_name,
|
||||
mca_ns_base_get_proc_name_string,
|
||||
mca_ns_base_get_vpid_string,
|
||||
mca_ns_base_convert_vpid_to_string,
|
||||
mca_ns_base_convert_string_to_vpid,
|
||||
mca_ns_base_get_jobid_string,
|
||||
mca_ns_base_convert_jobid_to_string,
|
||||
mca_ns_base_convert_string_to_jobid,
|
||||
mca_ns_base_get_cellid_string,
|
||||
mca_ns_base_convert_cellid_to_string,
|
||||
mca_ns_base_convert_string_to_cellid,
|
||||
mca_ns_base_get_vpid,
|
||||
mca_ns_base_get_jobid,
|
||||
mca_ns_base_get_cellid,
|
||||
|
21
src/mca/svc/bproc_soh/Makefile.am
Обычный файл
21
src/mca/svc/bproc_soh/Makefile.am
Обычный файл
@ -0,0 +1,21 @@
|
||||
#
|
||||
# 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.
|
||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
include $(top_ompi_srcdir)/config/Makefile.options
|
||||
|
||||
noinst_LTLIBRARIES = libmca_svc_bproc_soh.la
|
||||
libmca_svc_bproc_soh_la_SOURCES = \
|
||||
svc_bproc_soh.c \
|
||||
svc_bproc_soh.h \
|
||||
svc_bproc_soh_component.c
|
94
src/mca/svc/bproc_soh/svc_bproc_soh.c
Обычный файл
94
src/mca/svc/bproc_soh/svc_bproc_soh.c
Обычный файл
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <sys/bproc.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "include/constants.h"
|
||||
#include "mca/oob/oob.h"
|
||||
#include "mca/oob/base/base.h"
|
||||
#include "svc_bproc_soh.h"
|
||||
|
||||
|
||||
mca_svc_base_module_t mca_svc_bproc_soh_module = {
|
||||
mca_svc_bproc_soh_module_init,
|
||||
mca_svc_bproc_soh_module_fini
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Process a BProc update notice
|
||||
*/
|
||||
|
||||
static void mca_svc_bproc_soh_cbfunc()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register a callback to receive BProc update notifications
|
||||
*/
|
||||
|
||||
int mca_svc_bproc_soh_module_init(mca_svc_base_module_t* module)
|
||||
{
|
||||
bool registration_successful=true; /* added strictly to allow compilation
|
||||
- should be removed by Greg/Nathan */
|
||||
|
||||
bproc_node_info_t node_info;
|
||||
int node_num;
|
||||
char *segment, *jobid_string;
|
||||
|
||||
jobid_string = ompi_name_server.get_jobid_string(ompi_rte_get_self());
|
||||
asprintf(&segment, "%s-bproc", OMPI_RTE_VM_STATUS_SEGMENT);
|
||||
|
||||
/* Greg/Nathan - we need to initialize a registry segment that
|
||||
* has info from each node on the BProc cluster. From what I read
|
||||
* in the BProc documentation, we want each process to call this
|
||||
* function and add that info to our segment. Please feel free
|
||||
* to correct this info if incorrect...
|
||||
*/
|
||||
node_num = bproc_currnode();
|
||||
|
||||
|
||||
/* Greg/Nathan - this is where you need to add code so that
|
||||
* BProc will call you back whenever there is a change
|
||||
* or info that you want to get. I have named the callback
|
||||
* function "mca_svc_bproc_soh_cbfunc".
|
||||
*/
|
||||
if (registration_successful) {
|
||||
return OMPI_SUCCESS;
|
||||
} else {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cleanup
|
||||
*/
|
||||
|
||||
int mca_svc_bproc_soh_module_fini(mca_svc_base_module_t* module)
|
||||
{
|
||||
/* Greg/Nathan - all you need to do here is de-register the
|
||||
* callback from BProc.
|
||||
*/
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
53
src/mca/svc/bproc_soh/svc_bproc_soh.h
Обычный файл
53
src/mca/svc/bproc_soh/svc_bproc_soh.h
Обычный файл
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
#ifndef _MCA_SVC_BPROC_SOH_
|
||||
#define _MCA_SVC_BPROC_SOH_
|
||||
|
||||
#include "mca/svc/svc.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Component open/close/init
|
||||
*/
|
||||
int mca_svc_bproc_soh_component_open(void);
|
||||
int mca_svc_bproc_soh_component_close(void);
|
||||
mca_svc_base_module_t* mca_svc_bproc_soh_component_init(void);
|
||||
|
||||
/**
|
||||
* Module init/fini
|
||||
*/
|
||||
int mca_svc_bproc_soh_module_init(mca_svc_base_module_t*);
|
||||
int mca_svc_bproc_soh_module_fini(mca_svc_base_module_t*);
|
||||
|
||||
struct mca_svc_bproc_soh_component_t {
|
||||
mca_svc_base_component_t base;
|
||||
int debug;
|
||||
};
|
||||
typedef struct mca_svc_bproc_soh_component_t mca_svc_bproc_soh_component_t;
|
||||
|
||||
extern mca_svc_base_module_t mca_svc_bproc_soh_module;
|
||||
extern mca_svc_soh_component_t mca_svc_bproc_soh_component;
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
95
src/mca/svc/bproc_soh/svc_bproc_soh_component.c
Обычный файл
95
src/mca/svc/bproc_soh/svc_bproc_soh_component.c
Обычный файл
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "include/constants.h"
|
||||
|
||||
#include "svc_bproc_soh.h"
|
||||
|
||||
|
||||
mca_svc_bproc_soh_component_t mca_svc_bproc_soh_component = {
|
||||
{
|
||||
/* First, the mca_base_module_t struct containing meta
|
||||
information about the module itself */
|
||||
{
|
||||
/* Indicate that we are a bproc soh v1.0.0 module (which also
|
||||
implies a specific MCA version) */
|
||||
|
||||
MCA_SVC_BASE_VERSION_1_0_0,
|
||||
|
||||
"bproc_soh", /* MCA module name */
|
||||
1, /* MCA module major version */
|
||||
0, /* MCA module minor version */
|
||||
0, /* MCA module release version */
|
||||
mca_svc_bproc_soh_component_open, /* component open */
|
||||
mca_svc_bproc_soh_component_close /* component close */
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 module meta data */
|
||||
|
||||
{
|
||||
/* Whether the module is checkpointable or not */
|
||||
|
||||
false
|
||||
},
|
||||
|
||||
mca_svc_bproc_soh_component_init
|
||||
},
|
||||
0 /* exec_debug */
|
||||
};
|
||||
|
||||
/**
|
||||
* Utility function to register parameters
|
||||
*/
|
||||
static inline int mca_svc_bproc_soh_param_register_int(
|
||||
const char* param_name,
|
||||
int default_value)
|
||||
{
|
||||
int id = mca_base_param_register_int("svc","bproc_soh",param_name,NULL,default_value);
|
||||
int param_value = default_value;
|
||||
mca_base_param_lookup_int(id,¶m_value);
|
||||
return param_value;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
int mca_svc_bproc_soh_component_open(void)
|
||||
{
|
||||
mca_svc_bproc_soh_component.debug =
|
||||
mca_svc_bproc_soh_param_register_int("debug", 0);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
mca_svc_base_module_t* mca_svc_bproc_soh_component_init(void)
|
||||
{
|
||||
return &mca_svc_bproc_soh_module;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
int mca_svc_bproc_soh_component_close(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,9 @@ int ompi_mpi_finalize(void)
|
||||
ompi_registry.begin_compound_cmd();
|
||||
|
||||
/* Set process status to "terminating"*/
|
||||
my_status.rank = mca_ns_base_get_vpid(ompi_rte_get_self());
|
||||
my_status.local_pid = (int32_t)ompi_process_info.pid;
|
||||
my_status.nodename = strdup(ompi_system_info.nodename);
|
||||
my_status.status_key = OMPI_PROC_TERMINATING;
|
||||
my_status.exit_code = 0;
|
||||
if (OMPI_SUCCESS != (ret = ompi_rte_set_process_status(&my_status, ompi_rte_get_self()))) {
|
||||
|
@ -271,6 +271,9 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
||||
ompi_registry.assume_ownership(segment);
|
||||
free(segment);
|
||||
|
||||
my_status.rank = mca_ns_base_get_vpid(ompi_rte_get_self());
|
||||
my_status.local_pid = (int32_t)ompi_process_info.pid;
|
||||
my_status.nodename = strdup(ompi_system_info.nodename);
|
||||
my_status.status_key = OMPI_PROC_STARTING;
|
||||
my_status.exit_code = 0;
|
||||
if (OMPI_SUCCESS != (ret = ompi_rte_set_process_status(&my_status, ompi_rte_get_self()))) {
|
||||
|
@ -44,7 +44,7 @@ libruntime_la_SOURCES = \
|
||||
ompi_rte_wait_startup_shutdown_msg.c \
|
||||
ompi_rte_process_status.c \
|
||||
ompi_rte_cmd_line_setup.c \
|
||||
ompi_vm_register.c \
|
||||
ompi_rte_vm_status.c \
|
||||
universe_exists.c \
|
||||
ompi_rte_parse_environ.c \
|
||||
ompi_rte_parse_cmd_line.c \
|
||||
|
@ -35,7 +35,7 @@ int ompi_rte_job_startup(mca_ns_base_jobid_t jobid)
|
||||
ompi_list_t *recipients;
|
||||
ompi_buffer_t startup_msg;
|
||||
ompi_name_server_namelist_t *ptr;
|
||||
ompi_rte_process_status_t proc_status;
|
||||
ompi_rte_process_status_t *proc_status;
|
||||
int num_procs;
|
||||
|
||||
if (ompi_rte_debug_flag) {
|
||||
@ -59,10 +59,13 @@ int ompi_rte_job_startup(mca_ns_base_jobid_t jobid)
|
||||
mca_oob_xcast(ompi_rte_get_self(), recipients, startup_msg, NULL);
|
||||
|
||||
/* for each recipient, set process status to "running" */
|
||||
proc_status.status_key = OMPI_PROC_RUNNING;
|
||||
proc_status.exit_code = 0;
|
||||
|
||||
while (NULL != (ptr = (ompi_name_server_namelist_t*)ompi_list_remove_first(recipients))) {
|
||||
ompi_rte_set_process_status(&proc_status, ptr->name);
|
||||
proc_status = ompi_rte_get_process_status(ptr->name);
|
||||
proc_status->status_key = OMPI_PROC_RUNNING;
|
||||
proc_status->exit_code = 0;
|
||||
ompi_rte_set_process_status(proc_status, ptr->name);
|
||||
free(proc_status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,8 +74,11 @@ int ompi_rte_set_process_status(ompi_rte_process_status_t *status,
|
||||
|
||||
/* create the buffer to store the status information */
|
||||
ompi_buffer_init(&buffer, 0);
|
||||
ompi_pack(buffer, &status->status_key, 1, MCA_GPR_OOB_PACK_STATUS_KEY);
|
||||
ompi_pack(buffer, &status->exit_code, 1, MCA_GPR_OOB_PACK_EXIT_CODE);
|
||||
ompi_pack(buffer, &status->rank, 1, OMPI_INT32);
|
||||
ompi_pack(buffer, &status->local_pid, 1, OMPI_INT32);
|
||||
ompi_pack_string(buffer, status->nodename);
|
||||
ompi_pack(buffer, &status->status_key, 1, OMPI_PROCESS_STATUS);
|
||||
ompi_pack(buffer, &status->exit_code, 1, OMPI_EXIT_CODE);
|
||||
|
||||
/* peek the buffer and resulting size */
|
||||
ompi_buffer_get(buffer, &addr, &size);
|
||||
@ -84,7 +87,8 @@ int ompi_rte_set_process_status(ompi_rte_process_status_t *status,
|
||||
segment, tokens, addr, size);
|
||||
|
||||
if ((OMPI_PROC_STOPPED == status->status_key) ||
|
||||
(OMPI_PROC_KILLED == status->status_key)) {
|
||||
(OMPI_PROC_KILLED == status->status_key) ||
|
||||
(OMPI_PROC_EXITED == status->status_key)) {
|
||||
ompi_registry.cleanup_process(true, proc); /* purge subscriptions */
|
||||
} else if (OMPI_PROC_TERMINATING == status->status_key) {
|
||||
ompi_registry.cleanup_process(false, proc); /* just cleanup - don't purge subs */
|
||||
@ -113,8 +117,11 @@ ompi_rte_process_status_t
|
||||
value->object_size = 0;
|
||||
OBJ_RELEASE(value);
|
||||
|
||||
ompi_unpack(buffer, &stat_ptr->status_key, 1, MCA_GPR_OOB_PACK_STATUS_KEY);
|
||||
ompi_unpack(buffer, &stat_ptr->exit_code, 1, MCA_GPR_OOB_PACK_EXIT_CODE);
|
||||
ompi_unpack(buffer, &stat_ptr->rank, 1, OMPI_INT32);
|
||||
ompi_unpack(buffer, &stat_ptr->local_pid, 1, OMPI_INT32);
|
||||
ompi_unpack_string(buffer, &stat_ptr->nodename);
|
||||
ompi_unpack(buffer, &stat_ptr->status_key, 1, OMPI_PROCESS_STATUS);
|
||||
ompi_unpack(buffer, &stat_ptr->exit_code, 1, OMPI_EXIT_CODE);
|
||||
|
||||
return stat_ptr;
|
||||
}
|
||||
|
214
src/runtime/ompi_rte_vm_status.c
Обычный файл
214
src/runtime/ompi_rte_vm_status.c
Обычный файл
@ -0,0 +1,214 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file **/
|
||||
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "include/constants.h"
|
||||
|
||||
#include "util/output.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/bufpack.h"
|
||||
|
||||
#include "mca/oob/base/base.h"
|
||||
#include "mca/ns/base/base.h"
|
||||
#include "mca/gpr/base/base.h"
|
||||
|
||||
#include "runtime/runtime.h"
|
||||
|
||||
|
||||
ompi_rte_vm_status_t
|
||||
*ompi_rte_get_vm_status(mca_ns_base_cellid_t cellid, char *nodename)
|
||||
{
|
||||
char *segment, *tokens[2];
|
||||
ompi_registry_value_t *value;
|
||||
ompi_rte_vm_status_t *stat_ptr;
|
||||
ompi_list_t *returned_list;
|
||||
|
||||
/* setup the segment */
|
||||
asprintf(&segment, "%s-%s", OMPI_RTE_VM_STATUS_SEGMENT,
|
||||
mca_ns_base_convert_cellid_to_string(cellid));
|
||||
|
||||
tokens[0] = strdup(nodename);
|
||||
tokens[1] = NULL;
|
||||
|
||||
returned_list = ompi_registry.get(OMPI_REGISTRY_XAND, segment, tokens);
|
||||
|
||||
free(segment);
|
||||
free(tokens[0]);
|
||||
|
||||
if (NULL != (value = (ompi_registry_value_t*)ompi_list_remove_first(returned_list))) {
|
||||
stat_ptr = ompi_rte_unpack_vm_status(value);
|
||||
return stat_ptr;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int ompi_rte_set_vm_status(ompi_rte_vm_status_t *status)
|
||||
{
|
||||
char *segment, *tokens[2];
|
||||
void *addr;
|
||||
int size;
|
||||
ompi_buffer_t buffer;
|
||||
|
||||
/* setup the segment */
|
||||
asprintf(&segment, "%s-%s", OMPI_RTE_VM_STATUS_SEGMENT,
|
||||
mca_ns_base_convert_cellid_to_string(status->cell));
|
||||
|
||||
tokens[0] = strdup(status->nodename);
|
||||
tokens[1] = NULL;
|
||||
|
||||
/* create the buffer to store the status information */
|
||||
ompi_buffer_init(&buffer, 0);
|
||||
ompi_pack(buffer, &status->cell, 1, OMPI_CELLID);
|
||||
ompi_pack_string(buffer, status->nodename);
|
||||
ompi_pack(buffer, &status->num_cpus, 1, OMPI_INT16);
|
||||
ompi_pack(buffer, &status->mem_size, 1, OMPI_INT32);
|
||||
ompi_pack_string(buffer, status->arch);
|
||||
ompi_pack_string(buffer, status->op_sys);
|
||||
ompi_pack_string(buffer, status->release);
|
||||
ompi_pack_string(buffer, status->user);
|
||||
ompi_pack_string(buffer, status->group);
|
||||
ompi_pack(buffer, &status->permission, 1, OMPI_INT32);
|
||||
ompi_pack(buffer, &status->state, 1, OMPI_NODE_STATE);
|
||||
|
||||
/* peek the buffer and resulting size */
|
||||
ompi_buffer_get(buffer, &addr, &size);
|
||||
|
||||
ompi_registry.put(OMPI_REGISTRY_XAND | OMPI_REGISTRY_OVERWRITE,
|
||||
segment, tokens, addr, size);
|
||||
|
||||
/* cleanup */
|
||||
free(tokens[0]);
|
||||
free(segment);
|
||||
ompi_buffer_free(buffer);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ompi_rte_vm_status_t
|
||||
*ompi_rte_unpack_vm_status(ompi_registry_value_t *value)
|
||||
{
|
||||
ompi_buffer_t buffer;
|
||||
ompi_rte_vm_status_t *stat_ptr;
|
||||
|
||||
stat_ptr = (ompi_rte_vm_status_t*)malloc(sizeof(ompi_rte_vm_status_t));
|
||||
|
||||
/* transfer ownership of registry object to buffer and unpack */
|
||||
ompi_buffer_init_preallocated(&buffer, value->object, value->object_size);
|
||||
value->object = NULL;
|
||||
value->object_size = 0;
|
||||
OBJ_RELEASE(value);
|
||||
|
||||
ompi_unpack(buffer, &stat_ptr->cell, 1, OMPI_CELLID);
|
||||
ompi_unpack_string(buffer, &stat_ptr->nodename);
|
||||
ompi_unpack(buffer, &stat_ptr->num_cpus, 1, OMPI_INT16);
|
||||
ompi_unpack(buffer, &stat_ptr->mem_size, 1, OMPI_INT32);
|
||||
ompi_unpack_string(buffer, &stat_ptr->arch);
|
||||
ompi_unpack_string(buffer, &stat_ptr->op_sys);
|
||||
ompi_unpack_string(buffer, &stat_ptr->release);
|
||||
ompi_unpack_string(buffer, &stat_ptr->user);
|
||||
ompi_unpack_string(buffer, &stat_ptr->group);
|
||||
ompi_unpack(buffer, &stat_ptr->permission, 1, OMPI_INT32);
|
||||
ompi_unpack(buffer, &stat_ptr->state, 1, OMPI_NODE_STATE);
|
||||
|
||||
return stat_ptr;
|
||||
}
|
||||
|
||||
int ompi_vm_register(void)
|
||||
{
|
||||
ompi_rte_vm_status_t status;
|
||||
|
||||
status.cell = ompi_name_server.get_cellid(ompi_rte_get_self());
|
||||
status.nodename = strdup(ompi_system_info.nodename);
|
||||
status.arch = strdup(ompi_system_info.machine);
|
||||
status.op_sys = strdup(ompi_system_info.sysname);
|
||||
asprintf(&status.release, "%s %s", ompi_system_info.release,
|
||||
ompi_system_info.version);
|
||||
status.state = OMPI_NODE_UP;
|
||||
|
||||
#ifdef BPROC
|
||||
bproc_node_info_t info;
|
||||
int node;
|
||||
|
||||
node = bproc_currnode();
|
||||
bproc_nodeinfo(node, &info);
|
||||
status.permission = (uint32_t)info.mode;
|
||||
asprintf(&status.user, "%0X", (int)info.user);
|
||||
asprintf(&status.group, "%0X", (int)info.group);
|
||||
status.node_address = info.addr;
|
||||
|
||||
status.num_cpus = 2;
|
||||
status.mem_size = 1000;
|
||||
|
||||
#else
|
||||
status.permission = 0;
|
||||
status.user = strdup(ompi_system_info.user);
|
||||
status.group = strdup("unknown");
|
||||
status.node_address = 0;
|
||||
|
||||
status.num_cpus = 1;
|
||||
status.mem_size = 500;
|
||||
#endif /* BPROC */
|
||||
|
||||
return ompi_rte_set_vm_status(&status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* under windows, there is a SystemInfo structure that contains following info:
|
||||
* Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo _
|
||||
As SYSTEM_INFO)
|
||||
|
||||
Private Type SYSTEM_INFO
|
||||
dwOemID As Long
|
||||
dwPageSize As Long
|
||||
lpMinimumApplicationAddress As Long
|
||||
lpMaximumApplicationAddress As Long
|
||||
dwActiveProcessorMask As Long
|
||||
dwNumberOfProcessors As Long
|
||||
dwProcessorType As Long
|
||||
dwAllocationGranularity As Long
|
||||
dwReserved As Long
|
||||
End Type
|
||||
|
||||
Public Enum etProcessorType
|
||||
PROCESSOR_INTEL_386 = 386
|
||||
PROCESSOR_INTEL_486 = 486
|
||||
PROCESSOR_INTEL_PENTIUM = 586
|
||||
PROCESSOR_MIPS_R4000 = 4000
|
||||
PROCESSOR_ALPHA_21064 = 21064
|
||||
End Enum
|
||||
|
||||
Private m_typSystemInfo As SYSTEM_INFO
|
||||
|
||||
* Under Linux and BSD, get it from the /proc/cpuinfo file. There will be info for each cpu in node.
|
||||
|
||||
|
||||
* Under IRIX, sysmp() is supposed to gather various multiprocessor-related functionality.
|
||||
* The most commonly-used request is PGSIZE, which returns the memory page size. There are
|
||||
* also requests to get well-known kernel structure offsets in /dev/kmem (KERNADDR), or the
|
||||
* number of available processors (NPROCS). All of the requests are defined in
|
||||
* IRIX's <sys/sysmp.h>.
|
||||
|
||||
|
||||
Not sure what to do about Mac yet...
|
||||
*/
|
@ -1,120 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file **/
|
||||
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "include/constants.h"
|
||||
|
||||
#include "util/output.h"
|
||||
#include "util/sys_info.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/bufpack.h"
|
||||
|
||||
#include "mca/oob/base/base.h"
|
||||
#include "mca/ns/base/base.h"
|
||||
#include "mca/gpr/base/base.h"
|
||||
|
||||
#include "runtime/runtime.h"
|
||||
|
||||
int ompi_vm_register(void)
|
||||
{
|
||||
ompi_buffer_t buffer;
|
||||
int ret_code;
|
||||
int32_t num;
|
||||
char *keys[2];
|
||||
|
||||
if (OMPI_SUCCESS != ompi_buffer_init(&buffer, 0)) {
|
||||
ret_code = OMPI_ERROR;
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
if (OMPI_SUCCESS != ompi_pack_string(buffer, ompi_system_info.nodename)) {
|
||||
ret_code = OMPI_ERROR;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (OMPI_SUCCESS != ompi_pack(buffer, ompi_rte_get_self(), 1, OMPI_NAME)) {
|
||||
ret_code = OMPI_ERROR;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (OMPI_SUCCESS != ompi_pack_string(buffer, mca_oob_get_contact_info())) {
|
||||
ret_code = OMPI_ERROR;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (0 == strncmp(ompi_system_info.sysname, "Darwin", strlen("Darwin"))) {
|
||||
num = 1;
|
||||
} else if (0 == strncmp(ompi_system_info.sysname, "Linux", strlen("Linux"))) {
|
||||
/* get it from proc/cpuinfo */
|
||||
num = 1;
|
||||
} else {
|
||||
num = 1;
|
||||
}
|
||||
|
||||
if (OMPI_SUCCESS != ompi_pack(buffer, &num, 1, OMPI_INT32)) {
|
||||
ret_code = OMPI_ERROR;
|
||||
goto error;
|
||||
}
|
||||
|
||||
keys[0] = ompi_name_server.get_proc_name_string(ompi_rte_get_self());
|
||||
keys[1] = NULL;
|
||||
|
||||
ret_code = ompi_registry.put(OMPI_REGISTRY_XAND, OMPI_RTE_VM_STATUS_SEGMENT, keys, buffer, sizeof(buffer));
|
||||
|
||||
error:
|
||||
ompi_buffer_free(buffer);
|
||||
return ret_code;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* under windows, there is a SystemInfo structure that contains following info:
|
||||
* Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo _
|
||||
As SYSTEM_INFO)
|
||||
|
||||
Private Type SYSTEM_INFO
|
||||
dwOemID As Long
|
||||
dwPageSize As Long
|
||||
lpMinimumApplicationAddress As Long
|
||||
lpMaximumApplicationAddress As Long
|
||||
dwActiveProcessorMask As Long
|
||||
dwNumberOfProcessors As Long
|
||||
dwProcessorType As Long
|
||||
dwAllocationGranularity As Long
|
||||
dwReserved As Long
|
||||
End Type
|
||||
|
||||
Public Enum etProcessorType
|
||||
PROCESSOR_INTEL_386 = 386
|
||||
PROCESSOR_INTEL_486 = 486
|
||||
PROCESSOR_INTEL_PENTIUM = 586
|
||||
PROCESSOR_MIPS_R4000 = 4000
|
||||
PROCESSOR_ALPHA_21064 = 21064
|
||||
End Enum
|
||||
|
||||
Private m_typSystemInfo As SYSTEM_INFO
|
||||
|
||||
* Under Linux and BSD, get it from the /proc/cpuinfo file. There will be info for each cpu in node.
|
||||
|
||||
|
||||
* Under IRIX, sysmp() is supposed to gather various multiprocessor-related functionality. The most commonly-used request is PGSIZE, which returns the memory page size. There are also requests to get well-known kernel structure offsets in /dev/kmem (KERNADDR), or the number of available processors (NPROCS). All of the requests are defined in IRIX's <sys/sysmp.h>.
|
||||
|
||||
|
||||
Not sure what to do about Mac yet...
|
||||
*/
|
@ -39,11 +39,12 @@
|
||||
/* constants defining runtime-related segment naming conventions for the
|
||||
* registry
|
||||
*/
|
||||
#define OMPI_RTE_JOB_STATUS_SEGMENT "ompi-job-status"
|
||||
#define OMPI_RTE_OOB_SEGMENT "ompi-oob"
|
||||
#define OMPI_RTE_VM_STATUS_SEGMENT "ompi-vm-status"
|
||||
#define OMPI_RTE_SCHED_SEGMENT "ompi-sched"
|
||||
#define OMPI_RTE_MODEX_SEGMENT "ompi_modex"
|
||||
#define OMPI_RTE_JOB_STATUS_SEGMENT "ompi-job-status"
|
||||
#define OMPI_RTE_OOB_SEGMENT "ompi-oob"
|
||||
#define OMPI_RTE_VM_STATUS_SEGMENT "ompi-vm-status"
|
||||
#define OMPI_RTE_CELL_STATUS_SEGMENT "ompi-cell-status"
|
||||
#define OMPI_RTE_SCHED_SEGMENT "ompi-sched"
|
||||
#define OMPI_RTE_MODEX_SEGMENT "ompi_modex"
|
||||
|
||||
/* constants for spawn constraints */
|
||||
|
||||
@ -102,6 +103,9 @@ OMPI_DECLSPEC extern ompi_universe_t ompi_universe_info;
|
||||
|
||||
|
||||
struct ompi_rte_process_status_t {
|
||||
int32_t rank;
|
||||
int32_t local_pid;
|
||||
char *nodename;
|
||||
ompi_status_key_t status_key;
|
||||
ompi_exit_code_t exit_code;
|
||||
};
|
||||
@ -109,18 +113,31 @@ OMPI_DECLSPEC extern ompi_universe_t ompi_universe_info;
|
||||
|
||||
|
||||
struct ompi_rte_vm_status_t {
|
||||
char *nodename;
|
||||
ompi_list_t processes;
|
||||
mca_ns_base_cellid_t cell; /* cell id for this vm */
|
||||
char *nodename; /* name of the node */
|
||||
uint32_t node_address; /* node address */
|
||||
uint16_t num_cpus; /* number of CPU's in this node */
|
||||
uint32_t mem_size; /* size of memory, in MB */
|
||||
char *arch; /* architecture of the CPU's */
|
||||
char *op_sys; /* operating system */
|
||||
char *release; /* operating system release */
|
||||
char *user; /* userid of the owner of this node */
|
||||
char *group; /* name of the owning group */
|
||||
uint32_t permission; /* Unix-style permissions for the node */
|
||||
ompi_node_state_t state; /* state of this node */
|
||||
};
|
||||
typedef struct ompi_rte_vm_status_t ompi_rte_vm_status_t;
|
||||
|
||||
struct ompi_rte_vm_process_t {
|
||||
ompi_list_item_t *item;
|
||||
ompi_process_name_t *name;
|
||||
int32_t local_pid;
|
||||
struct ompi_rte_cell_status_t {
|
||||
mca_ns_base_cellid_t cell; /* cellid for this cell */
|
||||
char *cell_name; /* name for this cell */
|
||||
char *system_type; /* cluster, grid, SMP, etc. */
|
||||
char *launch_mech; /* launch mechanism for this cell */
|
||||
uint32_t num_nodes; /* number of nodes in cell */
|
||||
ompi_node_state_t state; /* state of the cell */
|
||||
};
|
||||
typedef struct ompi_rte_vm_process_t ompi_rte_vm_process_t;
|
||||
|
||||
typedef struct ompi_rte_cell_status_t ompi_rte_cell_status_t;
|
||||
|
||||
/**
|
||||
* Initialize the Open MPI support code
|
||||
*
|
||||
@ -315,6 +332,21 @@ OMPI_DECLSPEC int ompi_rte_set_process_status(ompi_rte_process_status_t *stat
|
||||
*/
|
||||
OMPI_DECLSPEC ompi_rte_process_status_t *ompi_rte_unpack_process_status(ompi_registry_value_t *value);
|
||||
|
||||
/**
|
||||
* Get virtual machine node status
|
||||
*/
|
||||
OMPI_DECLSPEC ompi_rte_vm_status_t *ompi_rte_get_vm_status(mca_ns_base_cellid_t cellid, char *nodename);
|
||||
|
||||
/**
|
||||
* Set virtual machine node status
|
||||
*/
|
||||
OMPI_DECLSPEC int ompi_rte_set_vm_status(ompi_rte_vm_status_t *status);
|
||||
|
||||
/**
|
||||
* Upack the virtual machine node status stored on the registry
|
||||
*/
|
||||
OMPI_DECLSPEC ompi_rte_vm_status_t *ompi_rte_unpack_vm_status(ompi_registry_value_t *value);
|
||||
|
||||
/**
|
||||
* Hold for startup message to arrive, then decode it.
|
||||
*/
|
||||
|
@ -42,6 +42,7 @@ extern "C" {
|
||||
*/
|
||||
typedef int8_t ompi_exit_code_t;
|
||||
typedef int8_t ompi_status_key_t;
|
||||
typedef int8_t ompi_node_state_t;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -395,6 +395,9 @@ return (OMPI_SUCCESS);
|
||||
switch(type) {
|
||||
case OMPI_BYTE:
|
||||
case OMPI_INT8:
|
||||
case OMPI_NODE_STATE:
|
||||
case OMPI_PROCESS_STATUS:
|
||||
case OMPI_EXIT_CODE:
|
||||
op_size = n;
|
||||
break;
|
||||
case OMPI_STRING:
|
||||
@ -415,14 +418,17 @@ return (OMPI_SUCCESS);
|
||||
if (OMPI_ERROR==rc) { return OMPI_ERROR; }
|
||||
break;
|
||||
case OMPI_INT16:
|
||||
op_size = n*sizeof(uint16_t);
|
||||
break;
|
||||
op_size = n*sizeof(uint16_t);
|
||||
break;
|
||||
case OMPI_INT32:
|
||||
op_size = n*sizeof(uint32_t);
|
||||
break;
|
||||
op_size = n*sizeof(uint32_t);
|
||||
break;
|
||||
case OMPI_JOBID:
|
||||
op_size = n*sizeof(mca_ns_base_jobid_t);
|
||||
break;
|
||||
op_size = n*sizeof(mca_ns_base_jobid_t);
|
||||
break;
|
||||
case OMPI_CELLID:
|
||||
op_size = n*sizeof(mca_ns_base_cellid_t);
|
||||
break;
|
||||
case OMPI_NAME:
|
||||
op_size = n*sizeof(ompi_process_name_t);
|
||||
break;
|
||||
@ -442,6 +448,9 @@ return (OMPI_SUCCESS);
|
||||
switch(type) {
|
||||
case OMPI_BYTE:
|
||||
case OMPI_INT8:
|
||||
case OMPI_NODE_STATE:
|
||||
case OMPI_PROCESS_STATUS:
|
||||
case OMPI_EXIT_CODE:
|
||||
memcpy(dest, src, n);
|
||||
break;
|
||||
case OMPI_PACKED:
|
||||
@ -468,10 +477,13 @@ return (OMPI_SUCCESS);
|
||||
*((char *) dest + n - 1) = '\0';
|
||||
break;
|
||||
case OMPI_JOBID:
|
||||
mca_ns_base_pack_jobid(dest, src, n);
|
||||
break;
|
||||
mca_ns_base_pack_jobid(dest, src, n);
|
||||
break;
|
||||
case OMPI_CELLID:
|
||||
mca_ns_base_pack_cellid(dest, src, n);
|
||||
break;
|
||||
case OMPI_NAME:
|
||||
mca_ns_base_pack_name(dest, src, n);
|
||||
mca_ns_base_pack_name(dest, src, n);
|
||||
break;
|
||||
default:
|
||||
return OMPI_ERROR;
|
||||
@ -523,6 +535,9 @@ ompi_unpack(ompi_buffer_t buffer, void * dest, size_t n, ompi_pack_type_t type)
|
||||
case OMPI_BYTE:
|
||||
case OMPI_STRING:
|
||||
case OMPI_INT8:
|
||||
case OMPI_NODE_STATE:
|
||||
case OMPI_PROCESS_STATUS:
|
||||
case OMPI_EXIT_CODE:
|
||||
op_size = n;
|
||||
break;
|
||||
case OMPI_PACKED:
|
||||
@ -536,8 +551,11 @@ ompi_unpack(ompi_buffer_t buffer, void * dest, size_t n, ompi_pack_type_t type)
|
||||
op_size = n*sizeof(uint32_t);
|
||||
break;
|
||||
case OMPI_JOBID:
|
||||
op_size = n*sizeof(mca_ns_base_jobid_t);
|
||||
break;
|
||||
op_size = n*sizeof(mca_ns_base_jobid_t);
|
||||
break;
|
||||
case OMPI_CELLID:
|
||||
op_size = n*sizeof(mca_ns_base_cellid_t);
|
||||
break;
|
||||
case OMPI_NAME:
|
||||
op_size = n*sizeof(ompi_process_name_t);
|
||||
break;
|
||||
@ -559,6 +577,9 @@ ompi_unpack(ompi_buffer_t buffer, void * dest, size_t n, ompi_pack_type_t type)
|
||||
switch(type) {
|
||||
case OMPI_BYTE:
|
||||
case OMPI_INT8:
|
||||
case OMPI_NODE_STATE:
|
||||
case OMPI_PROCESS_STATUS:
|
||||
case OMPI_EXIT_CODE:
|
||||
memcpy(dest, src, n);
|
||||
break;
|
||||
case OMPI_PACKED:
|
||||
@ -584,10 +605,13 @@ ompi_unpack(ompi_buffer_t buffer, void * dest, size_t n, ompi_pack_type_t type)
|
||||
*((char *) dest + n - 1) = '\0';
|
||||
break;
|
||||
case OMPI_JOBID:
|
||||
mca_ns_base_unpack_jobid(dest, src, n);
|
||||
break;
|
||||
mca_ns_base_unpack_jobid(dest, src, n);
|
||||
break;
|
||||
case OMPI_CELLID:
|
||||
mca_ns_base_unpack_cellid(dest, src, n);
|
||||
break;
|
||||
case OMPI_NAME:
|
||||
mca_ns_base_unpack_name(dest, src, n);
|
||||
mca_ns_base_unpack_name(dest, src, n);
|
||||
break;
|
||||
default:
|
||||
return OMPI_ERROR;
|
||||
|
@ -49,6 +49,10 @@ typedef enum {
|
||||
OMPI_STRING, /**< a NULL terminated string */
|
||||
OMPI_NAME, /**< an ompi_process_name_t */
|
||||
OMPI_JOBID, /**< a jobid */
|
||||
OMPI_CELLID, /**< a cellid */
|
||||
OMPI_NODE_STATE, /**< node status flag */
|
||||
OMPI_PROCESS_STATUS, /**< process status key */
|
||||
OMPI_EXIT_CODE, /**< process exit code */
|
||||
OMPI_PACKED /**< already packed data. */
|
||||
} ompi_pack_type_t;
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user