1
1
openmpi/orte/mca/ras/ras.h

143 строки
4.5 KiB
C
Исходник Обычный вид История

/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 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.
2015-06-24 06:59:57 +03:00
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
2015-06-24 06:59:57 +03:00
* reserved.
* $COPYRIGHT$
2015-06-24 06:59:57 +03:00
*
* Additional copyrights may follow
2015-06-24 06:59:57 +03:00
*
* $HEADER$
*/
/** @file:
*
* The Open RTE Resource Allocation Subsystem (RAS)
2015-06-24 06:59:57 +03:00
*
* The resource allocation subsystem is responsible for determining
* what (if any) resources have been allocated to the specified job
* (via some prior action), and to obtain an allocation (if possible)
* if resources have NOT been previously allocated. It is anticipated
* that ORTE users will execute an "mpirun" or other command that
* invokes ORTE through one of two channels:
2015-06-24 06:59:57 +03:00
*
* 1. the user will login to the computing resource they intend
* to use, request a resource allocation from that system, and then
* execute the mpirun or other command. Thus, the allocation has
* already been obtained prior to ORTE's initialization. In most
* cases, systems pass allocation information via environmental
* parameters. Thus, the RAS components must know the correct
* environmental parameter to look for within the environment they
* seek to support (e.g., an LSF component should know that LSF passes
* allocation parameters as a specific LSF-named entity).
2015-06-24 06:59:57 +03:00
*
* 2. the user issues an mpirun command or an application that uses
* ORTE without obtaining an allocation in advance. Thus, the associated
* RAS component must know how to request an allocation from the
* designated resource. If it doesn't, or it cannot obtain the allocation,
* then it shall indicate this by setting the system to an appropriate
* state.
*/
#ifndef ORTE_MCA_RAS_H
#define ORTE_MCA_RAS_H
#include "orte_config.h"
#include "orte/constants.h"
#include "orte/types.h"
#include "orte/mca/mca.h"
#include "opal/mca/event/event.h"
#include "opal/class/opal_list.h"
#include "orte/runtime/orte_globals.h"
#include "ras_types.h"
BEGIN_C_DECLS
/* allocation event - the event one activates to schedule resource
* allocation for pending jobs
*/
ORTE_DECLSPEC extern opal_event_t orte_allocate_event;
/*
* ras module functions - these are not accessible to the outside world,
* but are defined here by convention
*/
/* init the module */
typedef int (*orte_ras_base_module_init_fn_t)(void);
/**
* Allocate resources to a job.
*/
typedef int (*orte_ras_base_module_allocate_fn_t)(orte_job_t *jdata,
opal_list_t *nodes);
/* deallocate resources */
typedef void (*orte_ras_base_module_dealloc_fn_t)(orte_job_t *jdata,
orte_app_context_t *app);
/**
* Cleanup module resources.
*/
typedef int (*orte_ras_base_module_finalize_fn_t)(void);
Quite a range of small changes. ns_replica.c - Removed the error logging since I use this function in orte_init_stage1 to check if we have created a cellid yet or not. ras_types.h & rase_base_node.h - This was an empty file. moved the orte_ras_node_t from base/ras_base_node.h to this file. - Changed the name of orte_ras_base_node_t to orte_ras_node_t to match the naming mechanisms in place. ras.h - Exposed 2 functions: - node_insert: This takes a list of orte_ras_base_node_t's and places them in the Node Segment of the GPR. This is to be used in orte_init_stage1 for singleton processes, and the hostfile parsing (see rds_hostfile.c). This just puts in the appropriate API interface to keep from calling the orte_ras_base_node_insert function directly. - node_query: This is used in hostfile parsing. This just puts in the appropriate API interface to keep from calling the orte_ras_base_node_query function directly. - Touched all of the implemented components to add reference to these new function pointers ras_base_select.c & ras_base_open.c - Add and set the global module reference rds.h - Exposed 1 function: - store_resource: This stores a list of rds_cell_desc_t's to the Resource Segment. This is used in conjunction with the orte_ras.node_insert function in both the orte_init_stage1 for singleton processes and rds_hostfile.c rds_base_select.c & rds_base_open.c - Add and set the global module reference rds_hostfile.c - Added functionality to create a new cellid for each hostfile, placing each entry in the hostfile into the same cellid. Currently this is commented out with the cellid hard coded to 0, with the intention of taking this out once ORTE is able to handle multiple cellid's - Instead of just adding hosts to the Node Segment via a direct call to the ras_base_node_insert() function. First add the hosts to the Resource Segment of the GPR using the orte_rds.store_resource() function then use the API version of orte_ras.node_insert() to store the hosts on the Node Segment. - Add 1 new function pointer to module as required by the API. rds_hostfile_component.c - Converted this to use the new MCA parameter registration orte_init_stage1.c - It is possible that a cellid was not created yet for the current environment. So I put in some logic to test if the cellid 0 existed. If it does then continue, otherwise create the cellid so we can properly interact with the GPR via the RDS. - For the singleton case we insert some 'dummy' data into the GPR. The RAS matches this logic, so I took out the duplicate GPR put logic, and replaced it with a call to the orte_ras.node_insert() function. - Further before calling orte_ras.node_insert() in the singleton case, we also call orte_rds.store_resource() to add the singleton node to the Resource Segment. Console: - Added a bunch of new functions. Still experimenting with many aspects of the implementation. This is a checkpoint, and has very limited functionality. - Should not be considered stable at the moment. This commit was SVN r6813.
2005-08-11 23:51:50 +04:00
/**
* ras module
*/
struct orte_ras_base_module_2_0_0_t {
/** init */
orte_ras_base_module_init_fn_t init;
/** Allocation function pointer */
orte_ras_base_module_allocate_fn_t allocate;
orte_ras_base_module_dealloc_fn_t deallocate;
/** Finalization function pointer */
orte_ras_base_module_finalize_fn_t finalize;
};
/** Convenience typedef */
typedef struct orte_ras_base_module_2_0_0_t orte_ras_base_module_2_0_0_t;
/** Convenience typedef */
typedef orte_ras_base_module_2_0_0_t orte_ras_base_module_t;
/*
* ras component
*/
/**
* Component init / selection
* ras component
*/
struct orte_ras_base_component_2_0_0_t {
/** Base MCA structure */
mca_base_component_t base_version;
/** Base MCA data */
mca_base_component_data_t base_data;
};
/** Convenience typedef */
typedef struct orte_ras_base_component_2_0_0_t orte_ras_base_component_2_0_0_t;
/** Convenience typedef */
typedef orte_ras_base_component_2_0_0_t orte_ras_base_component_t;
/**
* Macro for use in components that are of type ras
*/
#define ORTE_RAS_BASE_VERSION_2_0_0 \
ORTE_MCA_BASE_VERSION_2_1_0("ras", 2, 0, 0)
END_C_DECLS
#endif