2005-03-14 23:57:21 +03: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.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-03-14 23:57:21 +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.
|
2005-03-14 23:57:21 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
* The Open RTE Resource Discovery Subsystem (RDS)
|
|
|
|
*
|
|
|
|
* The resource discovery subsystem is responsible for discovering information about
|
|
|
|
* computing resources available to the ORTE universe. The information provided is
|
|
|
|
* stored on the registry for use by other subsystems, and is assumed to represent
|
|
|
|
* some base state - in other words, the resource discovery information provides a
|
|
|
|
* picture of what COULD be available, and not what necessarily IS available at a
|
|
|
|
* specific point in time.
|
|
|
|
*
|
|
|
|
* This can best be understood by considering two examples:
|
|
|
|
*
|
|
|
|
* 1. A resource file (e.g., etc/lanl_resources.xml) describes one or more computing
|
|
|
|
* resources in a given site. Information included in the file tells the ORTE system
|
|
|
|
* how many compute nodes are available on a given cluster, the type of interconnect
|
|
|
|
* used, the resource management software used, etc. This info subsequently is used
|
|
|
|
* by the system to assist ORTE in determining how best to interact with the cluster
|
|
|
|
* to provide the best performance for a user's application. Resource files are
|
|
|
|
* intended to be provided at the site (as opposed to user) level, though users can
|
|
|
|
* define their own resource files if desired (e.g., to describe resources they have
|
|
|
|
* access to at some foreign site).
|
|
|
|
*
|
|
|
|
* 2. A hostfile (e.g., etc/openmpi-default-hostfile) describes a set of hosts to
|
2005-05-17 01:01:09 +04:00
|
|
|
* which a specific user has access and may wish to use to run applications. The
|
2005-03-14 23:57:21 +03:00
|
|
|
* information in the hostfile is much less detailed than in a resource file - it
|
2005-05-17 01:01:09 +04:00
|
|
|
* is primarily intended to allow a user to specify which hosts are available for
|
|
|
|
* use in an unmanaged environment (e.g, one spawned by rsh/ssh as opposed
|
|
|
|
* to a BProc system), and potentially how the application's processes can/are to be
|
2005-03-14 23:57:21 +03:00
|
|
|
* distributed across them. Thus, one would not expect to find info on memory/node
|
|
|
|
* in a hostfile, but would expect to find info on user id for a given host and the
|
|
|
|
* maximum number of processes the user wants put on a given host.
|
|
|
|
*
|
|
|
|
* The location and name of the input files to be read (or whatever input information
|
|
|
|
* source the component utilizes) will be provided via the MCA parameter mechanism.
|
|
|
|
* Users will provide the information either via environmental parameters or as options
|
|
|
|
* on the command line. Thus, the RDS components must be aware that another application
|
|
|
|
* invocation may have already populated the registry with information on a given
|
|
|
|
* resource. In addition, each component must be capable of accepting and processing
|
|
|
|
* info from multiple input sources (e.g., a user may specify several resource files,
|
|
|
|
* one from the site and one or more that the user has pesonally created to describe
|
|
|
|
* foreign sites).
|
|
|
|
*
|
|
|
|
* NOTE: It is the responsibility of each component to define unique MCA
|
|
|
|
* parameters for passing their required input information.
|
|
|
|
*
|
|
|
|
* The information developed by the RDS is placed on the ORTE_RESOURCE_SEGMENT of the
|
|
|
|
* registry. To ensure proper operation, the information MUST be described by the
|
|
|
|
* following tokens:
|
|
|
|
*
|
|
|
|
* - site name: the name of the site wherein the resource resides (e.g., "lanl")
|
|
|
|
*
|
|
|
|
* - resource name: the name of the specific resource being described (e.g., "pink")
|
|
|
|
*
|
|
|
|
* - cellid: a unique id for this resource (termed a "cell") that is generated by
|
|
|
|
* the ORTE name services (NS) subsystem.
|
|
|
|
*
|
|
|
|
* Keywords to describe the individual data elements within the resource are mostly
|
|
|
|
* defined in the rds_types.h
|
|
|
|
* file. However, some higher level types (e.g., nodename) may be defined in the
|
|
|
|
* include/orte_names.h
|
|
|
|
* file as they need to be generally understandable across multiple subsystems.
|
|
|
|
*
|
|
|
|
* The resource allocation subsystem (RAS) is the primary consumer of this information,
|
|
|
|
* although other subsystems can also access it. The information is typically read at
|
|
|
|
* the start of any application, but can also be accessed dynamically when an application
|
|
|
|
* requests additional resources as part of a spawn process. The RAS does NOT alter the
|
|
|
|
* information placed by the RDS on the ORTE_RESOURCE_SEGMENT, but augments it with
|
|
|
|
* a dynamic count of the resources currently allocated/consumed from each resource
|
|
|
|
* defined on the segment. Thus, the ORTE_RESOURCE_SEGMENT, contains both static and
|
|
|
|
* dynamic information. This allows the allocator, for example, to possibly determine
|
|
|
|
* that a request for additional resources should draw from another compute resource
|
|
|
|
* as the requested one is already fully consumed.
|
|
|
|
*
|
|
|
|
* Consumers of the information must always be prepared to find "holes" or "gaps" in
|
|
|
|
* the information itself. The RDS can ONLY provide information it is given - it has
|
|
|
|
* no dynamic discovery capabilities of its own at this time. Hence, if a resource
|
|
|
|
* file doesn't provide any info on the launcher used by a particular cluster, then
|
|
|
|
* other subsystems must be prepared to operate without it - or at least detect that
|
|
|
|
* this information is not available and act accordintly.
|
|
|
|
*
|
|
|
|
* Because the RDS operates as a multi-component subsystem (i.e., multiple components
|
|
|
|
* are instantiated at any one time), its functions should NOT be accessed directly.
|
|
|
|
* Instead, all calls to RDS functions should be made through the ORTE Resource
|
|
|
|
* Manager (RMGR) subsystem to ensure proper operation.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ORTE_MCA_RDS_H
|
|
|
|
#define ORTE_MCA_RDS_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* includes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/orte_constants.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "orte/mca/ns/ns_types.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/rds/rds_types.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-08-11 02:49:41 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Component functions - all MUST be provided!
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query/update a resource
|
|
|
|
* The query function requests that the component read its associated
|
|
|
|
* information and store/update it on the ORTE_RESOURCE_SEGMENT of the
|
|
|
|
* registry. It must be emphasized that this function has to support
|
|
|
|
* multiple calls in case the user updates an input file or data
|
|
|
|
* source while the ORTE system is in operation - the function should
|
|
|
|
* not assume that the registry is currently empty. The registry
|
|
|
|
* design accommodates this need by providing an "overwrite"
|
|
|
|
* capability that allows the user to permit updating of existing info
|
|
|
|
* if it exists, while still adding the info to the registry if prior
|
|
|
|
* info does not exist.
|
|
|
|
*
|
|
|
|
* Requests to update the resource information will be manually
|
|
|
|
* provided. The RDS is NOT responsible for detecting changes in input
|
|
|
|
* information and automatically updating itself.
|
|
|
|
*
|
|
|
|
* @code
|
|
|
|
* return_value = orte_rmgr.query();
|
|
|
|
* @endcode
|
|
|
|
*/
|
2006-12-06 18:59:34 +03:00
|
|
|
typedef int (*orte_rds_base_module_query_fn_t)(orte_jobid_t job);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-08-11 23:51:50 +04:00
|
|
|
/**
|
|
|
|
* Add a list of resources to the Resource Segment
|
|
|
|
*/
|
|
|
|
typedef int (*orte_rds_base_module_store_resource_fn_t)(opal_list_t *);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/*
|
2006-09-15 01:29:51 +04:00
|
|
|
* Ver 1.3.0
|
2005-03-14 23:57:21 +03:00
|
|
|
*/
|
2006-09-15 01:29:51 +04:00
|
|
|
struct orte_rds_base_module_1_3_0_t {
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_rds_base_module_query_fn_t query;
|
2005-08-11 23:51:50 +04:00
|
|
|
orte_rds_base_module_store_resource_fn_t store_resource;
|
2005-03-14 23:57:21 +03:00
|
|
|
};
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
typedef struct orte_rds_base_module_1_3_0_t orte_rds_base_module_1_3_0_t;
|
|
|
|
typedef orte_rds_base_module_1_3_0_t orte_rds_base_module_t;
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* RDS Component
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef orte_rds_base_module_t* (*orte_rds_base_component_init_fn_t)(void);
|
2006-09-15 01:29:51 +04:00
|
|
|
typedef int (*orte_rds_base_component_finalize_fn_t)(void);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* the standard component data structure
|
|
|
|
*/
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
struct orte_rds_base_component_1_3_0_t {
|
|
|
|
mca_base_component_t rds_version;
|
|
|
|
mca_base_component_data_1_0_0_t rds_data;
|
|
|
|
orte_rds_base_component_init_fn_t rds_init;
|
|
|
|
orte_rds_base_component_finalize_fn_t rds_fini;
|
2005-03-14 23:57:21 +03:00
|
|
|
};
|
2006-09-15 01:29:51 +04:00
|
|
|
typedef struct orte_rds_base_component_1_3_0_t orte_rds_base_component_1_3_0_t;
|
|
|
|
typedef orte_rds_base_component_1_3_0_t orte_rds_base_component_t;
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
2006-09-15 01:29:51 +04:00
|
|
|
* Macro for use in components that are of type rds v1.3.0
|
2005-03-14 23:57:21 +03:00
|
|
|
*/
|
2006-09-15 01:29:51 +04:00
|
|
|
#define ORTE_RDS_BASE_VERSION_1_3_0 \
|
|
|
|
/* rds v1.3 is chained to MCA v1.0 */ \
|
2005-03-14 23:57:21 +03:00
|
|
|
MCA_BASE_VERSION_1_0_0, \
|
2006-09-15 01:29:51 +04:00
|
|
|
/* rds v1.3 */ \
|
|
|
|
"rds", 1, 3, 0
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-08-11 02:49:41 +04:00
|
|
|
/*
|
|
|
|
* global module that holds function pointers
|
|
|
|
*/
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC extern orte_rds_base_module_t orte_rds;
|
2005-08-11 02:49:41 +04:00
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#endif
|
|
|
|
|