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.
Этот коммит содержится в:
родитель
e083c706dc
Коммит
22c7f2b3e0
@ -102,7 +102,7 @@ int orte_ns_replica_get_cell_info(orte_cellid_t cellid,
|
||||
}
|
||||
}
|
||||
}
|
||||
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
||||
|
||||
OPAL_THREAD_UNLOCK(&orte_ns_replica.mutex);
|
||||
return ORTE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ int pls_poe_launch_interactive_orted(orte_jobid_t jobid)
|
||||
for(item = opal_list_get_first(&nodes);
|
||||
item != opal_list_get_end(&nodes);
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
orte_process_name_t* name;
|
||||
pid_t pid;
|
||||
|
||||
@ -484,7 +484,7 @@ static inline int __poe_launch_interactive(orte_jobid_t jobid)
|
||||
for(item = opal_list_get_first(&nodes);
|
||||
item != opal_list_get_end(&nodes);
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
fprintf(hfp,"%s\n",node->node_name);
|
||||
}
|
||||
fclose(hfp);
|
||||
|
@ -87,7 +87,7 @@ orte_pls_base_module_1_0_0_t orte_pls_rsh_module = {
|
||||
universe if a daemon aborts */
|
||||
struct rsh_daemon_info_t {
|
||||
opal_object_t super;
|
||||
orte_ras_base_node_t* node;
|
||||
orte_ras_node_t* node;
|
||||
orte_jobid_t jobid;
|
||||
};
|
||||
typedef struct rsh_daemon_info_t rsh_daemon_info_t;
|
||||
@ -202,7 +202,7 @@ static void orte_pls_rsh_wait_daemon(pid_t pid, int status, void* cbdata)
|
||||
* Set the daemons name in the registry.
|
||||
*/
|
||||
|
||||
static int orte_pls_rsh_set_node_name(orte_ras_base_node_t* node, orte_jobid_t jobid, orte_process_name_t* name)
|
||||
static int orte_pls_rsh_set_node_name(orte_ras_node_t* node, orte_jobid_t jobid, orte_process_name_t* name)
|
||||
{
|
||||
orte_gpr_value_t* values[1];
|
||||
orte_gpr_value_t value;
|
||||
@ -449,7 +449,7 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
||||
for(item = opal_list_get_first(&nodes);
|
||||
item != opal_list_get_end(&nodes);
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
orte_process_name_t* name;
|
||||
pid_t pid;
|
||||
char *exec_path;
|
||||
|
@ -42,7 +42,7 @@ char **environ;
|
||||
*/
|
||||
|
||||
static int
|
||||
mca_pls_xgrid_set_node_name(orte_ras_base_node_t* node,
|
||||
mca_pls_xgrid_set_node_name(orte_ras_node_t* node,
|
||||
orte_jobid_t jobid,
|
||||
orte_process_name_t* name)
|
||||
{
|
||||
@ -265,7 +265,7 @@ mca_pls_xgrid_set_node_name(orte_ras_base_node_t* node,
|
||||
for (item = opal_list_get_first(&nodes);
|
||||
item != opal_list_get_end(&nodes);
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
orte_process_name_t* name;
|
||||
char *name_str, *nsuri, *gpruri;
|
||||
|
||||
|
@ -71,7 +71,7 @@ int orte_ras_base_allocate_nodes_by_node(orte_jobid_t jobid,
|
||||
for (item = opal_list_get_first(nodes);
|
||||
item != opal_list_get_end(nodes) && num_allocated < num_requested;
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
|
||||
/* are any slots available? */
|
||||
slots = (oversubscribe ? node->node_slots_max : node->node_slots);
|
||||
@ -105,7 +105,7 @@ int orte_ras_base_allocate_nodes_by_node(orte_jobid_t jobid,
|
||||
/* move all nodes w/ allocations to the allocated list */
|
||||
item = opal_list_get_first(nodes);
|
||||
while(item != opal_list_get_end(nodes)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
opal_list_item_t* next = opal_list_get_next(item);
|
||||
if(node->node_slots_alloc) {
|
||||
opal_list_remove_item(nodes, item);
|
||||
@ -155,7 +155,7 @@ int orte_ras_base_allocate_nodes_by_slot(orte_jobid_t jobid,
|
||||
for (item = opal_list_get_first(nodes);
|
||||
item != opal_list_get_end(nodes) && num_allocated < num_requested;
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
|
||||
/* are any slots available? */
|
||||
if (node->node_slots_inuse < node->node_slots) {
|
||||
@ -186,7 +186,7 @@ int orte_ras_base_allocate_nodes_by_slot(orte_jobid_t jobid,
|
||||
for (item = opal_list_get_first(nodes);
|
||||
item != opal_list_get_end(nodes) && num_allocated < num_requested;
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
|
||||
/* are any slots available? */
|
||||
if (node->node_slots_inuse < node->node_slots_max ||
|
||||
@ -210,7 +210,7 @@ int orte_ras_base_allocate_nodes_by_slot(orte_jobid_t jobid,
|
||||
/* move all nodes w/ allocations to the allocated list */
|
||||
item = opal_list_get_first(nodes);
|
||||
while(item != opal_list_get_end(nodes)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
opal_list_item_t* next = opal_list_get_next(item);
|
||||
if(node->node_slots_alloc) {
|
||||
opal_list_remove_item(nodes, item);
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "mca/ns/ns.h"
|
||||
#include "mca/ras/base/ras_base_node.h"
|
||||
|
||||
static void orte_ras_base_node_construct(orte_ras_base_node_t* node)
|
||||
static void orte_ras_base_node_construct(orte_ras_node_t* node)
|
||||
{
|
||||
node->node_name = NULL;
|
||||
node->node_arch = NULL;
|
||||
@ -39,7 +39,7 @@ static void orte_ras_base_node_construct(orte_ras_base_node_t* node)
|
||||
node->node_slots_max = 0;
|
||||
}
|
||||
|
||||
static void orte_ras_base_node_destruct(orte_ras_base_node_t* node)
|
||||
static void orte_ras_base_node_destruct(orte_ras_node_t* node)
|
||||
{
|
||||
if (NULL != node->node_name) {
|
||||
free(node->node_name);
|
||||
@ -51,7 +51,7 @@ static void orte_ras_base_node_destruct(orte_ras_base_node_t* node)
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
orte_ras_base_node_t,
|
||||
orte_ras_node_t,
|
||||
opal_list_item_t,
|
||||
orte_ras_base_node_construct,
|
||||
orte_ras_base_node_destruct);
|
||||
@ -83,7 +83,7 @@ int orte_ras_base_node_query(opal_list_t* nodes)
|
||||
/* parse the response */
|
||||
for(i=0; i<cnt; i++) {
|
||||
orte_gpr_value_t* value = values[i];
|
||||
orte_ras_base_node_t* node = OBJ_NEW(orte_ras_base_node_t);
|
||||
orte_ras_node_t* node = OBJ_NEW(orte_ras_node_t);
|
||||
size_t k;
|
||||
|
||||
for(k=0; k<value->cnt; k++) {
|
||||
@ -165,7 +165,7 @@ int orte_ras_base_node_query_alloc(opal_list_t* nodes, orte_jobid_t jobid)
|
||||
/* parse the response */
|
||||
for(i=0; i<cnt; i++) {
|
||||
orte_gpr_value_t* value = values[i];
|
||||
orte_ras_base_node_t* node = OBJ_NEW(orte_ras_base_node_t);
|
||||
orte_ras_node_t* node = OBJ_NEW(orte_ras_node_t);
|
||||
size_t k;
|
||||
|
||||
for(k=0; k<value->cnt; k++) {
|
||||
@ -219,7 +219,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
|
||||
orte_gpr_value_t **values;
|
||||
int rc;
|
||||
size_t num_values, i, j;
|
||||
orte_ras_base_node_t* node;
|
||||
orte_ras_node_t* node;
|
||||
|
||||
num_values = opal_list_get_size(nodes);
|
||||
if (0 >= num_values) {
|
||||
@ -274,7 +274,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
|
||||
i < num_values && item != opal_list_get_end(nodes);
|
||||
i++, item = opal_list_get_next(item)) {
|
||||
orte_gpr_value_t* value = values[i];
|
||||
node = (orte_ras_base_node_t*)item;
|
||||
node = (orte_ras_node_t*)item;
|
||||
|
||||
j = 0;
|
||||
(value->keyvals[j])->key = strdup(ORTE_NODE_NAME_KEY);
|
||||
@ -342,7 +342,7 @@ int orte_ras_base_node_delete(opal_list_t* nodes)
|
||||
opal_list_item_t* item;
|
||||
int rc;
|
||||
size_t num_values, num_tokens;
|
||||
orte_ras_base_node_t* node;
|
||||
orte_ras_node_t* node;
|
||||
char** tokens;
|
||||
|
||||
num_values = opal_list_get_size(nodes);
|
||||
@ -354,7 +354,7 @@ int orte_ras_base_node_delete(opal_list_t* nodes)
|
||||
for(item = opal_list_get_first(nodes);
|
||||
item != opal_list_get_end(nodes);
|
||||
item = opal_list_get_next(item)) {
|
||||
node = (orte_ras_base_node_t*)item;
|
||||
node = (orte_ras_node_t*)item;
|
||||
|
||||
/* setup index/keys for this node */
|
||||
rc = orte_schema.get_node_tokens(&tokens, &num_tokens, node->node_cellid, node->node_name);
|
||||
@ -386,7 +386,7 @@ int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
|
||||
orte_gpr_value_t **values;
|
||||
int rc;
|
||||
size_t num_values, i, j;
|
||||
orte_ras_base_node_t* node;
|
||||
orte_ras_node_t* node;
|
||||
char* jobid_str;
|
||||
|
||||
num_values = opal_list_get_size(nodes);
|
||||
@ -440,7 +440,7 @@ int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
|
||||
i < num_values && item != opal_list_get_end(nodes);
|
||||
i++, item = opal_list_get_next(item)) {
|
||||
int rc;
|
||||
node = (orte_ras_base_node_t*)item;
|
||||
node = (orte_ras_node_t*)item;
|
||||
|
||||
if(node->node_slots_alloc == 0)
|
||||
continue;
|
||||
|
@ -32,59 +32,6 @@ extern "C" {
|
||||
* Convience routines to query/set node state in the registry
|
||||
*/
|
||||
|
||||
/**
|
||||
* Struct for holding information about a node (a local copy of what
|
||||
* is in the node segment in the registry).
|
||||
*/
|
||||
struct orte_ras_base_node_t {
|
||||
/** Base object */
|
||||
opal_list_item_t super;
|
||||
/** String node name */
|
||||
char *node_name;
|
||||
/** String of the architecture for the node. This is permitted to
|
||||
be NULL if it is not known. */
|
||||
char *node_arch;
|
||||
/** The cell ID of this node */
|
||||
orte_cellid_t node_cellid;
|
||||
/** State of this node; see include/orte_types.h */
|
||||
orte_node_state_t node_state;
|
||||
/** A "soft" limit on the number of slots available on the node.
|
||||
This will typically correspond to the number of physical CPUs
|
||||
that we have been allocated on this note and would be the
|
||||
"ideal" number of processes for us to launch. */
|
||||
size_t node_slots;
|
||||
/** How many processes have already been launched, used by one or
|
||||
more jobs on this node. */
|
||||
size_t node_slots_inuse;
|
||||
/** This represents the number of slots we (the allocator) are
|
||||
attempting to allocate to the current job - or the number of
|
||||
slots allocated to a specific job on a query for the jobs
|
||||
allocations */
|
||||
size_t node_slots_alloc;
|
||||
/** A "hard" limit (if set -- a value of 0 implies no hard limit)
|
||||
on the number of slots that can be allocated on a given
|
||||
node. This is for some environments (e.g. grid) there may be
|
||||
fixed limits on the number of slots that can be used.
|
||||
|
||||
This value also could have been a boolean - but we may want to
|
||||
allow the hard limit be different than the soft limit - in
|
||||
other words allow the node to be oversubscribed up to a
|
||||
specified limit. For example, if we have two processors, we
|
||||
may want to allow up to four processes but no more. */
|
||||
size_t node_slots_max;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct orte_ras_base_node_t orte_ras_base_node_t;
|
||||
|
||||
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_ras_base_node_t);
|
||||
|
||||
|
||||
/*
|
||||
* Query the registry for all available nodes
|
||||
*/
|
||||
|
@ -71,6 +71,7 @@ static int compare(opal_list_item_t **a, opal_list_item_t **b)
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
orte_ras_base_module_t orte_ras;
|
||||
orte_ras_base_t orte_ras_base;
|
||||
OBJ_CLASS_INSTANCE(
|
||||
orte_ras_base_cmp_t,
|
||||
|
@ -36,11 +36,14 @@ static orte_ras_base_module_t *select_any(void);
|
||||
*/
|
||||
orte_ras_base_module_t* orte_ras_base_select(const char *preferred)
|
||||
{
|
||||
orte_ras_base_module_t *module;
|
||||
if (NULL != preferred) {
|
||||
return select_preferred(preferred);
|
||||
module = select_preferred(preferred);
|
||||
} else {
|
||||
return select_any();
|
||||
module = select_any();
|
||||
}
|
||||
orte_ras = *module;
|
||||
return module;
|
||||
}
|
||||
|
||||
static orte_ras_base_module_t *select_preferred(const char *name)
|
||||
|
@ -123,7 +123,7 @@ static int orte_ras_bjs_discover(opal_list_t* nodelist)
|
||||
opal_list_item_t* next = opal_list_get_next(item);
|
||||
int node_num;
|
||||
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
if(ORTE_SUCCESS != orte_ras_bjs_node_resolve(node->node_name, &node_num)) {
|
||||
opal_list_remove_item(nodelist,item);
|
||||
OBJ_DESTRUCT(item);
|
||||
@ -162,7 +162,7 @@ static int orte_ras_bjs_discover(opal_list_t* nodelist)
|
||||
|
||||
OBJ_CONSTRUCT(&new_nodes, opal_list_t);
|
||||
while(NULL != (ptr = strsep(&nodes,","))) {
|
||||
orte_ras_base_node_t *node;
|
||||
orte_ras_node_t *node;
|
||||
orte_node_state_t node_state;
|
||||
int node_num;
|
||||
|
||||
@ -170,7 +170,7 @@ static int orte_ras_bjs_discover(opal_list_t* nodelist)
|
||||
for(item = opal_list_get_first(nodelist);
|
||||
item != opal_list_get_end(nodelist);
|
||||
item = opal_list_get_next(item)) {
|
||||
node = (orte_ras_base_node_t*)item;
|
||||
node = (orte_ras_node_t*)item;
|
||||
if(strcmp(node->node_name, ptr) == 0)
|
||||
break;
|
||||
}
|
||||
@ -192,7 +192,7 @@ static int orte_ras_bjs_discover(opal_list_t* nodelist)
|
||||
}
|
||||
|
||||
/* create a new node entry */
|
||||
node = OBJ_NEW(orte_ras_base_node_t);
|
||||
node = OBJ_NEW(orte_ras_node_t);
|
||||
node->node_name = strdup(ptr);
|
||||
node->node_state = node_state;
|
||||
node->node_cellid = 0;
|
||||
@ -252,7 +252,15 @@ static int orte_ras_bjs_allocate(orte_jobid_t jobid)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int orte_ras_bjs_node_insert(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_insert(nodes);
|
||||
}
|
||||
|
||||
static int orte_ras_bjs_node_query(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_query(nodes);
|
||||
}
|
||||
|
||||
static int orte_ras_bjs_deallocate(orte_jobid_t jobid)
|
||||
{
|
||||
@ -268,6 +276,8 @@ static int orte_ras_bjs_finalize(void)
|
||||
|
||||
orte_ras_base_module_t orte_ras_bjs_module = {
|
||||
orte_ras_bjs_allocate,
|
||||
orte_ras_bjs_node_insert,
|
||||
orte_ras_bjs_node_query,
|
||||
orte_ras_bjs_deallocate,
|
||||
orte_ras_bjs_finalize
|
||||
};
|
||||
|
@ -62,6 +62,15 @@ cleanup:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int orte_ras_host_node_insert(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_insert(nodes);
|
||||
}
|
||||
|
||||
static int orte_ras_host_node_query(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_query(nodes);
|
||||
}
|
||||
|
||||
static int orte_ras_host_deallocate(orte_jobid_t jobid)
|
||||
{
|
||||
@ -77,6 +86,8 @@ static int orte_ras_host_finalize(void)
|
||||
|
||||
orte_ras_base_module_t orte_ras_host_module = {
|
||||
orte_ras_host_allocate,
|
||||
orte_ras_host_node_insert,
|
||||
orte_ras_host_node_query,
|
||||
orte_ras_host_deallocate,
|
||||
orte_ras_host_finalize
|
||||
};
|
||||
|
@ -27,6 +27,16 @@ static int orte_ras_lsf_bproc_allocate(orte_jobid_t jobid)
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int orte_ras_lsf_bproc_node_insert(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_insert(nodes);
|
||||
}
|
||||
|
||||
static int orte_ras_lsf_bproc_node_query(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_query(nodes);
|
||||
}
|
||||
|
||||
static int orte_ras_lsf_bproc_deallocate(orte_jobid_t jobid)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
@ -41,6 +51,8 @@ static int orte_ras_lsf_bproc_finalize(void)
|
||||
|
||||
orte_ras_base_module_t orte_ras_lsf_bproc_module = {
|
||||
orte_ras_lsf_bproc_allocate,
|
||||
orte_ras_lsf_bproc_node_insert,
|
||||
orte_ras_lsf_bproc_node_query,
|
||||
orte_ras_lsf_bproc_deallocate,
|
||||
orte_ras_lsf_bproc_finalize
|
||||
};
|
||||
|
@ -187,12 +187,26 @@ typedef int (*orte_ras_base_module_deallocate_fn_t)(orte_jobid_t jobid);
|
||||
*/
|
||||
typedef int (*orte_ras_base_module_finalize_fn_t)(void);
|
||||
|
||||
/**
|
||||
* Add a node to the current allocation
|
||||
*/
|
||||
typedef int (*orte_ras_base_module_node_insert_fn_t)(opal_list_t *);
|
||||
|
||||
/**
|
||||
* Query for a list of nodes in current allocation
|
||||
*/
|
||||
typedef int (*orte_ras_base_module_node_query_fn_t)(opal_list_t *);
|
||||
|
||||
/**
|
||||
* ras module version 1.0.0
|
||||
*/
|
||||
struct orte_ras_base_module_1_0_0_t {
|
||||
/** Allocation function pointer */
|
||||
orte_ras_base_module_allocate_fn_t allocate;
|
||||
/** Node Insertion function pointer */
|
||||
orte_ras_base_module_node_insert_fn_t node_insert;
|
||||
/** Node Query function pointer */
|
||||
orte_ras_base_module_node_query_fn_t node_query;
|
||||
/** Deallocation function pointer */
|
||||
orte_ras_base_module_deallocate_fn_t deallocate;
|
||||
/** Finalization function pointer */
|
||||
|
@ -1 +1,76 @@
|
||||
/*
|
||||
* 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 (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "mca/soh/soh_types.h"
|
||||
|
||||
#ifndef ORTE_MCA_RAS_TYPES_H
|
||||
#define ORTE_MCA_RAS_TYPES_H
|
||||
|
||||
/**
|
||||
* Struct for holding information about a node (a local copy of what
|
||||
* is in the node segment in the registry).
|
||||
*/
|
||||
struct orte_ras_node_t {
|
||||
/** Base object */
|
||||
opal_list_item_t super;
|
||||
/** String node name */
|
||||
char *node_name;
|
||||
/** String of the architecture for the node. This is permitted to
|
||||
be NULL if it is not known. */
|
||||
char *node_arch;
|
||||
/** The cell ID of this node */
|
||||
orte_cellid_t node_cellid;
|
||||
/** State of this node; see include/orte_types.h */
|
||||
orte_node_state_t node_state;
|
||||
/** A "soft" limit on the number of slots available on the node.
|
||||
This will typically correspond to the number of physical CPUs
|
||||
that we have been allocated on this note and would be the
|
||||
"ideal" number of processes for us to launch. */
|
||||
size_t node_slots;
|
||||
/** How many processes have already been launched, used by one or
|
||||
more jobs on this node. */
|
||||
size_t node_slots_inuse;
|
||||
/** This represents the number of slots we (the allocator) are
|
||||
attempting to allocate to the current job - or the number of
|
||||
slots allocated to a specific job on a query for the jobs
|
||||
allocations */
|
||||
size_t node_slots_alloc;
|
||||
/** A "hard" limit (if set -- a value of 0 implies no hard limit)
|
||||
on the number of slots that can be allocated on a given
|
||||
node. This is for some environments (e.g. grid) there may be
|
||||
fixed limits on the number of slots that can be used.
|
||||
|
||||
This value also could have been a boolean - but we may want to
|
||||
allow the hard limit be different than the soft limit - in
|
||||
other words allow the node to be oversubscribed up to a
|
||||
specified limit. For example, if we have two processors, we
|
||||
may want to allow up to four processes but no more. */
|
||||
size_t node_slots_max;
|
||||
};
|
||||
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct orte_ras_node_t orte_ras_node_t;
|
||||
|
||||
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_ras_node_t);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -34,6 +34,8 @@
|
||||
* Local functions
|
||||
*/
|
||||
static int allocate(orte_jobid_t jobid);
|
||||
static int node_insert(opal_list_t *);
|
||||
static int node_query(opal_list_t *);
|
||||
static int deallocate(orte_jobid_t jobid);
|
||||
static int finalize(void);
|
||||
|
||||
@ -46,6 +48,8 @@ static int get_tm_hostname(tm_node_id node, char **hostname, char **arch);
|
||||
*/
|
||||
orte_ras_base_module_t orte_ras_tm_module = {
|
||||
allocate,
|
||||
node_insert,
|
||||
node_query,
|
||||
deallocate,
|
||||
finalize
|
||||
};
|
||||
@ -102,6 +106,15 @@ static int allocate(orte_jobid_t jobid)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int node_insert(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_insert(nodes);
|
||||
}
|
||||
|
||||
static int node_query(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_query(nodes);
|
||||
}
|
||||
|
||||
/*
|
||||
* There's really nothing to do here
|
||||
@ -137,7 +150,7 @@ static int finalize(void)
|
||||
static int discover(opal_list_t* nodelist)
|
||||
{
|
||||
int i, ret, num_node_ids;
|
||||
orte_ras_base_node_t *node;
|
||||
orte_ras_node_t *node;
|
||||
opal_list_item_t* item;
|
||||
opal_list_t new_nodes;
|
||||
tm_node_id *tm_node_ids;
|
||||
@ -174,7 +187,7 @@ static int discover(opal_list_t* nodelist)
|
||||
for (item = opal_list_get_first(&new_nodes);
|
||||
opal_list_get_end(&new_nodes) != item;
|
||||
item = opal_list_get_next(item)) {
|
||||
node = (orte_ras_base_node_t*) item;
|
||||
node = (orte_ras_node_t*) item;
|
||||
if (0 == strcmp(node->node_name, hostname)) {
|
||||
++node->node_slots_max;
|
||||
++node->node_slots;
|
||||
@ -193,7 +206,7 @@ static int discover(opal_list_t* nodelist)
|
||||
|
||||
opal_output(orte_ras_base.ras_output,
|
||||
"ras:tm:allocate:discover: not found -- added to list");
|
||||
node = OBJ_NEW(orte_ras_base_node_t);
|
||||
node = OBJ_NEW(orte_ras_node_t);
|
||||
node->node_name = hostname;
|
||||
node->node_arch = arch;
|
||||
node->node_state = ORTE_NODE_STATE_UP;
|
||||
|
@ -33,6 +33,8 @@
|
||||
* Local functions
|
||||
*/
|
||||
static int allocate(orte_jobid_t jobid);
|
||||
static int node_insert(opal_list_t *);
|
||||
static int node_query(opal_list_t *);
|
||||
static int deallocate(orte_jobid_t jobid);
|
||||
static int finalize(void);
|
||||
|
||||
@ -44,6 +46,8 @@ static int discover(orte_jobid_t jobid, opal_list_t* nodelist);
|
||||
*/
|
||||
orte_ras_base_module_t orte_ras_xgrid_module = {
|
||||
allocate,
|
||||
node_insert,
|
||||
node_query,
|
||||
deallocate,
|
||||
finalize
|
||||
};
|
||||
@ -87,6 +91,15 @@ static int allocate(orte_jobid_t jobid)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int node_insert(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_insert(nodes);
|
||||
}
|
||||
|
||||
static int node_query(opal_list_t *nodes)
|
||||
{
|
||||
return orte_ras_base_node_query(nodes);
|
||||
}
|
||||
|
||||
/*
|
||||
* There's really nothing to do here
|
||||
@ -114,7 +127,7 @@ static int finalize(void)
|
||||
static int discover(orte_jobid_t jobid, opal_list_t* nodelist)
|
||||
{
|
||||
int ret;
|
||||
orte_ras_base_node_t *node;
|
||||
orte_ras_node_t *node;
|
||||
opal_list_item_t* item;
|
||||
opal_list_t new_nodes;
|
||||
size_t num_requested = 0;
|
||||
@ -130,7 +143,7 @@ static int discover(orte_jobid_t jobid, opal_list_t* nodelist)
|
||||
OBJ_CONSTRUCT(&new_nodes, opal_list_t);
|
||||
for (i = 0 ; i < num_requested ; ++i) {
|
||||
asprintf(&hostname, "xgrid-node-%d", (int) i);
|
||||
node = OBJ_NEW(orte_ras_base_node_t);
|
||||
node = OBJ_NEW(orte_ras_node_t);
|
||||
node->node_name = hostname;
|
||||
node->node_arch = strdup("unknown");
|
||||
node->node_state = ORTE_NODE_STATE_UP;
|
||||
|
@ -84,9 +84,9 @@ OBJ_CLASS_INSTANCE(
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
orte_rds_base_module_t orte_rds;
|
||||
orte_rds_base_t orte_rds_base;
|
||||
|
||||
|
||||
/**
|
||||
* Function for finding and opening either all MCA components, or the one
|
||||
* that was specifically requested via a MCA parameter.
|
||||
|
@ -69,6 +69,8 @@ int orte_rds_base_select(void)
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
orte_rds = *module;
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -27,13 +27,17 @@
|
||||
#include "mca/mca.h"
|
||||
#include "mca/base/base.h"
|
||||
#include "mca/ns/ns.h"
|
||||
#include "mca/ras/base/ras_base_node.h"
|
||||
#include "mca/errmgr/errmgr.h"
|
||||
#include "mca/ras/ras.h"
|
||||
#include "mca/rds/rds.h"
|
||||
#include "mca/rds/base/base.h"
|
||||
#include "mca/rds/hostfile/rds_hostfile.h"
|
||||
#include "mca/rds/hostfile/rds_hostfile_lex.h"
|
||||
|
||||
#include "runtime/runtime_types.h"
|
||||
|
||||
static orte_cellid_t local_cellid;
|
||||
static bool need_cellid = true;
|
||||
|
||||
static void orte_rds_hostfile_parse_error(void)
|
||||
{
|
||||
@ -52,13 +56,13 @@ static int orte_rds_hostfile_parse_int(void)
|
||||
}
|
||||
|
||||
|
||||
static orte_ras_base_node_t* orte_rds_hostfile_lookup(opal_list_t* nodes, const char* name)
|
||||
static orte_ras_node_t* orte_rds_hostfile_lookup(opal_list_t* nodes, const char* name)
|
||||
{
|
||||
opal_list_item_t* item;
|
||||
for(item = opal_list_get_first(nodes);
|
||||
item != opal_list_get_end(nodes);
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ras_base_node_t* node = (orte_ras_base_node_t*)item;
|
||||
orte_ras_node_t* node = (orte_ras_node_t*)item;
|
||||
if(strcmp(node->node_name, name) == 0) {
|
||||
opal_list_remove_item(nodes, item);
|
||||
return node;
|
||||
@ -70,7 +74,7 @@ static orte_ras_base_node_t* orte_rds_hostfile_lookup(opal_list_t* nodes, const
|
||||
static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_list_t* updates)
|
||||
{
|
||||
int rc;
|
||||
orte_ras_base_node_t* node;
|
||||
orte_ras_node_t* node;
|
||||
bool update = false;
|
||||
bool got_count = false;
|
||||
|
||||
@ -91,7 +95,7 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
|
||||
|
||||
if (NULL == (node = orte_rds_hostfile_lookup(updates,
|
||||
node_name))) {
|
||||
node = OBJ_NEW(orte_ras_base_node_t);
|
||||
node = OBJ_NEW(orte_ras_node_t);
|
||||
node->node_name = strdup(node_name);
|
||||
node->node_slots = 0;
|
||||
|
||||
@ -99,6 +103,9 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
|
||||
/* get a new cellid for this node */
|
||||
/* JMS Temporarily turned off until cell IDs are
|
||||
properly handled elsewhere in the code */
|
||||
/* JJH This assumes that each hostname listed should be
|
||||
placed in a new cell. Is this accurate to the design?
|
||||
*/
|
||||
if (ORTE_SUCCESS !=
|
||||
(rc = orte_ns.create_cellid(&(node->node_cellid),
|
||||
"UNKNOWN-SITE",
|
||||
@ -119,6 +126,12 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
|
||||
|
||||
update = true;
|
||||
}
|
||||
else {
|
||||
/* If it was in the existing list, then we can use its cellid
|
||||
* to add the reset of the hosts in the file to. */
|
||||
local_cellid = node->node_cellid;
|
||||
need_cellid = false;
|
||||
}
|
||||
} else {
|
||||
orte_rds_hostfile_parse_error();
|
||||
return OMPI_ERROR;
|
||||
@ -239,7 +252,6 @@ unlock:
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse the default file as specified by the MCA parameter,
|
||||
* rds_hostfile_path, and add the nodes to the registry.
|
||||
@ -248,19 +260,21 @@ unlock:
|
||||
static int orte_rds_hostfile_query(void)
|
||||
{
|
||||
opal_list_t existing;
|
||||
opal_list_t updates;
|
||||
opal_list_t updates, rds_updates;
|
||||
opal_list_item_t *item;
|
||||
int rc;
|
||||
|
||||
OBJ_CONSTRUCT(&existing, opal_list_t);
|
||||
OBJ_CONSTRUCT(&updates, opal_list_t);
|
||||
rc = orte_ras_base_node_query(&existing);
|
||||
OBJ_CONSTRUCT(&rds_updates, opal_list_t);
|
||||
rc = orte_ras.node_query(&existing);
|
||||
if(ORTE_SUCCESS != rc) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
rc = mca_base_param_find("rds", "hostfile", "path");
|
||||
mca_base_param_lookup_string(rc, &mca_rds_hostfile_component.path);
|
||||
|
||||
rc = orte_rds_hostfile_parse(mca_rds_hostfile_component.path, &existing, &updates);
|
||||
if (ORTE_ERR_NOT_FOUND == rc) {
|
||||
if(mca_rds_hostfile_component.default_hostfile) {
|
||||
@ -272,8 +286,80 @@ static int orte_rds_hostfile_query(void)
|
||||
} else if (ORTE_SUCCESS != rc) {
|
||||
goto cleanup;
|
||||
}
|
||||
if(opal_list_get_size(&updates)) {
|
||||
rc = orte_ras_base_node_insert(&updates);
|
||||
|
||||
if ( !opal_list_is_empty(&updates) ) {
|
||||
orte_rds_cell_desc_t *rds_item;
|
||||
orte_rds_cell_attr_t *new_attr;
|
||||
orte_ras_node_t *ras_item;
|
||||
opal_list_item_t *item;
|
||||
|
||||
/* Convert RAS update list to RDS update list */
|
||||
for ( item = opal_list_get_first(&updates);
|
||||
item != opal_list_get_end( &updates);
|
||||
item = opal_list_get_next( item)) {
|
||||
ras_item = (orte_ras_node_t *) item;
|
||||
|
||||
rds_item = OBJ_NEW(orte_rds_cell_desc_t);
|
||||
if (NULL == rds_item) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
rds_item->site = strdup("Hostfile");
|
||||
rds_item->name = strdup(ras_item->node_name);
|
||||
if (need_cellid) {
|
||||
#if 0 /* JJH Repair when cellid's are fixed */
|
||||
/* Create a new cellid for this hostfile */
|
||||
rc = orte_ns.create_cellid(&local_cellid, rds_item->site, rds_item->name);
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
local_cellid = 0;
|
||||
need_cellid = false;
|
||||
}
|
||||
|
||||
rds_item->cellid = local_cellid;
|
||||
ras_item->node_cellid = local_cellid;
|
||||
|
||||
new_attr = OBJ_NEW(orte_rds_cell_attr_t);
|
||||
if (NULL == new_attr) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
new_attr->keyval.key = strdup(ORTE_RDS_NAME);
|
||||
new_attr->keyval.type = ORTE_STRING;
|
||||
new_attr->keyval.value.strptr = strdup(ras_item->node_name);
|
||||
opal_list_append(&(rds_item->attributes), &new_attr->super);
|
||||
|
||||
new_attr = OBJ_NEW(orte_rds_cell_attr_t);
|
||||
if (NULL == new_attr) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
new_attr->keyval.key = strdup(ORTE_CELLID_KEY);
|
||||
new_attr->keyval.type = ORTE_CELLID;
|
||||
new_attr->keyval.value.cellid = rds_item->cellid;
|
||||
opal_list_append(&(rds_item->attributes), &new_attr->super);
|
||||
|
||||
opal_list_append(&rds_updates, &rds_item->super);
|
||||
}
|
||||
|
||||
/* Insert the new node into the RDS */
|
||||
rc = orte_rds.store_resource(&rds_updates);
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Then the RAS, since we can assume that any
|
||||
* resources listed in the hostfile have been
|
||||
* already allocated for our use.
|
||||
*/
|
||||
rc = orte_ras.node_insert(&updates);
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
@ -289,8 +375,20 @@ cleanup:
|
||||
while(NULL != (item = opal_list_remove_first(&updates))) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
||||
while(NULL != (item = opal_list_remove_first(&rds_updates))) {
|
||||
orte_rds_cell_desc_t *rds_item;
|
||||
rds_item = (orte_rds_cell_desc_t *) item;
|
||||
while (NULL != (item = opal_list_remove_first(&(rds_item->attributes))) ) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&existing);
|
||||
OBJ_DESTRUCT(&updates);
|
||||
OBJ_DESTRUCT(&rds_updates);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -303,6 +401,7 @@ static int orte_rds_hostfile_finalize(void)
|
||||
|
||||
orte_rds_base_module_t orte_rds_hostfile_module = {
|
||||
orte_rds_hostfile_query,
|
||||
orte_rds_base_store_resource,
|
||||
orte_rds_hostfile_finalize
|
||||
};
|
||||
|
||||
|
@ -62,32 +62,6 @@ orte_rds_hostfile_component_t mca_rds_hostfile_component = {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Convience functions to lookup MCA parameter values.
|
||||
*/
|
||||
|
||||
static int orte_rds_hostfile_param_register_int(
|
||||
const char* param_name,
|
||||
int default_value)
|
||||
{
|
||||
int id = mca_base_param_register_int("rds","hostfile",param_name,NULL,default_value);
|
||||
int param_value = default_value;
|
||||
mca_base_param_lookup_int(id,¶m_value);
|
||||
return param_value;
|
||||
}
|
||||
|
||||
|
||||
static char* orte_rds_hostfile_param_register_string(
|
||||
const char* param_name,
|
||||
const char* default_value)
|
||||
{
|
||||
char *param_value;
|
||||
int id = mca_base_param_register_string("rds","hostfile",param_name,NULL,default_value);
|
||||
mca_base_param_lookup_string(id, ¶m_value);
|
||||
return param_value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* component open/close/init function
|
||||
*/
|
||||
@ -99,10 +73,19 @@ static int orte_rds_hostfile_open(void)
|
||||
#else
|
||||
char *path = opal_os_path(false, ORTE_SYSCONFDIR, "openmpi-default-hostfile", NULL);
|
||||
OBJ_CONSTRUCT(&mca_rds_hostfile_component.lock, opal_mutex_t);
|
||||
mca_rds_hostfile_component.debug = orte_rds_hostfile_param_register_int("debug",1);
|
||||
mca_rds_hostfile_component.path = orte_rds_hostfile_param_register_string("path", path);
|
||||
|
||||
mca_base_param_reg_int(&mca_rds_hostfile_component.super.rds_version, "debug",
|
||||
"Toggle debug output for hostfile RDS component",
|
||||
false, false, (int)false,
|
||||
&mca_rds_hostfile_component.debug);
|
||||
mca_base_param_reg_string(&mca_rds_hostfile_component.super.rds_version, "path",
|
||||
"ORTE Host filename",
|
||||
false, false, path,
|
||||
&mca_rds_hostfile_component.path);
|
||||
|
||||
mca_rds_hostfile_component.default_hostfile = (strcmp(mca_rds_hostfile_component.path,path) == 0);
|
||||
free(path);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
@ -153,11 +153,17 @@ typedef int (*orte_rds_base_module_query_fn_t)(void);
|
||||
|
||||
typedef int (*orte_rds_base_module_finalize_fn_t)(void);
|
||||
|
||||
/**
|
||||
* Add a list of resources to the Resource Segment
|
||||
*/
|
||||
typedef int (*orte_rds_base_module_store_resource_fn_t)(opal_list_t *);
|
||||
|
||||
/*
|
||||
* Ver 1.0.0
|
||||
*/
|
||||
struct orte_rds_base_module_1_0_0_t {
|
||||
orte_rds_base_module_query_fn_t query;
|
||||
orte_rds_base_module_store_resource_fn_t store_resource;
|
||||
orte_rds_base_module_finalize_fn_t finalize;
|
||||
};
|
||||
|
||||
|
@ -63,6 +63,7 @@ orte_rds_resfile_component_t mca_rds_resfile_component = {
|
||||
|
||||
orte_rds_base_module_t orte_rds_resfile_module = {
|
||||
orte_rds_resfile_query,
|
||||
orte_rds_base_store_resource,
|
||||
orte_rds_resfile_finalize
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ static opal_list_item_t *cur_node_item = NULL;
|
||||
|
||||
|
||||
static int claim_slot(orte_rmaps_base_map_t *map,
|
||||
orte_ras_base_node_t *current_node,
|
||||
orte_ras_node_t *current_node,
|
||||
orte_jobid_t jobid, orte_vpid_t vpid, int proc_index)
|
||||
{
|
||||
orte_rmaps_base_proc_t *proc;
|
||||
@ -105,7 +105,7 @@ static int map_app_by_node(
|
||||
size_t num_alloc = 0;
|
||||
size_t proc_index = 0;
|
||||
opal_list_item_t *start, *next;
|
||||
orte_ras_base_node_t *node;
|
||||
orte_ras_node_t *node;
|
||||
bool did_alloc;
|
||||
|
||||
/* Note that cur_node_item already points to the Right place in
|
||||
@ -138,7 +138,7 @@ static int map_app_by_node(
|
||||
been mapped yet, then it's an "out of resources" error. */
|
||||
did_alloc = false;
|
||||
while (num_alloc < app->num_procs) {
|
||||
node = (orte_ras_base_node_t*) cur_node_item;
|
||||
node = (orte_ras_node_t*) cur_node_item;
|
||||
next = opal_list_get_next(cur_node_item);
|
||||
|
||||
/* If we have an available slot on this node, claim it */
|
||||
@ -217,7 +217,7 @@ static int map_app_by_slot(
|
||||
size_t num_alloc = 0;
|
||||
size_t proc_index = 0;
|
||||
opal_list_item_t *next;
|
||||
orte_ras_base_node_t *node;
|
||||
orte_ras_node_t *node;
|
||||
|
||||
/* Note that cur_node_item already points to the Right place in
|
||||
the node list to start looking (i.e., if this is the first time
|
||||
@ -240,7 +240,7 @@ static int map_app_by_slot(
|
||||
|
||||
while (opal_list_get_end(nodes) != cur_node_item &&
|
||||
num_alloc < app->num_procs) {
|
||||
node = (orte_ras_base_node_t*) cur_node_item;
|
||||
node = (orte_ras_node_t*) cur_node_item;
|
||||
next = opal_list_get_next(cur_node_item);
|
||||
|
||||
/* If we have available slots on this node, claim it */
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include "mca/ns/base/base.h"
|
||||
#include "mca/sds/base/base.h"
|
||||
#include "mca/gpr/base/base.h"
|
||||
#include "mca/ras/base/base.h"
|
||||
#include "mca/rds/base/base.h"
|
||||
#include "mca/rmgr/base/base.h"
|
||||
#include "mca/rmaps/base/base.h"
|
||||
#include "mca/schema/base/base.h"
|
||||
@ -57,13 +59,12 @@
|
||||
|
||||
int orte_init_stage1(void)
|
||||
{
|
||||
int ret, rc;
|
||||
int ret;
|
||||
char *jobid_str = NULL;
|
||||
char *procid_str = NULL;
|
||||
char *contact_path = NULL;
|
||||
orte_jobid_t my_jobid;
|
||||
orte_cellid_t my_cellid;
|
||||
orte_gpr_value_t value, *values;
|
||||
|
||||
/* Ensure the system_info structure is instantiated and initialized */
|
||||
if (ORTE_SUCCESS != (ret = orte_sys_info())) {
|
||||
@ -321,14 +322,38 @@ int orte_init_stage1(void)
|
||||
/* if we are a singleton or the seed, setup the infrastructure for our job */
|
||||
|
||||
if(orte_process_info.singleton || orte_process_info.seed) {
|
||||
char *site, *resource;
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_ns.get_jobid(&my_jobid, orte_process_info.my_name))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* If there is no existing cellid, create one */
|
||||
my_cellid = 0; /* JJH Assertion/Repair until cellid's are fixed */
|
||||
ret = orte_ns.get_cell_info(my_cellid, &site, &resource);
|
||||
if (ORTE_ERR_NOT_FOUND == ret) {
|
||||
/* Create a new Cell ID */
|
||||
ret = orte_ns.create_cellid(&my_cellid, "unkonwn", orte_system_info.nodename);
|
||||
if (ORTE_SUCCESS != ret ) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if(my_cellid != 0) { /* JJH Assertion/Repair until cellid's are fixed */
|
||||
my_cellid = 0;
|
||||
}
|
||||
}
|
||||
else if (ORTE_SUCCESS != ret) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_ns.get_cellid(&my_cellid, orte_process_info.my_name))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (orte_process_info.singleton) {
|
||||
/* setup a fake node structure - this is required to support
|
||||
* the MPI attributes function that is sitting on a trigger
|
||||
@ -340,66 +365,71 @@ int orte_init_stage1(void)
|
||||
* THIS ONLY SHOULD BE DONE FOR SINGLETONS - DO NOT DO IT
|
||||
* FOR ANY OTHER CASE
|
||||
*/
|
||||
OBJ_CONSTRUCT(&value, orte_gpr_value_t);
|
||||
values = &value;
|
||||
/* define the addressing mode and segment */
|
||||
value.addr_mode = ORTE_GPR_TOKENS_OR | ORTE_GPR_KEYS_OR;
|
||||
value.segment = strdup(ORTE_NODE_SEGMENT);
|
||||
if (NULL == value.segment) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
OBJ_DESTRUCT(&value);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = orte_schema.get_node_tokens(&(value.tokens),
|
||||
&(value.num_tokens), my_cellid, orte_system_info.nodename))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
value.cnt = 2;
|
||||
opal_list_t single_host, rds_single_host;
|
||||
orte_rds_cell_desc_t *rds_item;
|
||||
orte_rds_cell_attr_t *new_attr;
|
||||
orte_ras_node_t *ras_item;
|
||||
|
||||
value.keyvals = (orte_gpr_keyval_t**)malloc(2*sizeof(orte_gpr_keyval_t*));
|
||||
if (NULL == value.keyvals) {
|
||||
OBJ_CONSTRUCT(&single_host, opal_list_t);
|
||||
OBJ_CONSTRUCT(&rds_single_host, opal_list_t);
|
||||
ras_item = OBJ_NEW(orte_ras_node_t);
|
||||
rds_item = OBJ_NEW(orte_rds_cell_desc_t);
|
||||
if (NULL == ras_item || NULL == rds_item) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
OBJ_DESTRUCT(&value);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
value.keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
|
||||
if (NULL == value.keyvals[0]) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
OBJ_DESTRUCT(&value);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
value.keyvals[0]->key = strdup(ORTE_NODE_SLOTS_KEY);
|
||||
if (NULL == value.keyvals[0]->key) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
OBJ_DESTRUCT(&value);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
value.keyvals[0]->type = ORTE_SIZE;
|
||||
value.keyvals[0]->value.size = 1;
|
||||
|
||||
rds_item->site = strdup("Singleton");
|
||||
rds_item->name = strdup(orte_system_info.nodename);
|
||||
rds_item->cellid = my_cellid;
|
||||
|
||||
/* Set up data structure for RAS item */
|
||||
ras_item->node_name = strdup(rds_item->name);
|
||||
ras_item->node_arch = strdup("unknown");
|
||||
ras_item->node_cellid = rds_item->cellid;
|
||||
ras_item->node_slots_inuse = 0;
|
||||
ras_item->node_slots = 1;
|
||||
|
||||
value.keyvals[1] = OBJ_NEW(orte_gpr_keyval_t);
|
||||
if (NULL == value.keyvals[1]) {
|
||||
opal_list_append(&single_host, &ras_item->super);
|
||||
|
||||
/* Set up data structure for RDS item */
|
||||
new_attr = OBJ_NEW(orte_rds_cell_attr_t);
|
||||
if (NULL == new_attr) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
OBJ_DESTRUCT(&value);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
value.keyvals[1]->key = strdup(ORTE_NODE_NAME_KEY);
|
||||
if (NULL == value.keyvals[1]->key) {
|
||||
new_attr->keyval.key = strdup(ORTE_RDS_NAME);
|
||||
new_attr->keyval.type = ORTE_STRING;
|
||||
new_attr->keyval.value.strptr = strdup(ras_item->node_name);
|
||||
opal_list_append(&(rds_item->attributes), &new_attr->super);
|
||||
|
||||
new_attr = OBJ_NEW(orte_rds_cell_attr_t);
|
||||
if (NULL == new_attr) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
OBJ_DESTRUCT(&value);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
value.keyvals[1]->type = ORTE_STRING;
|
||||
value.keyvals[1]->value.strptr = strdup(orte_system_info.nodename);
|
||||
/* put the value on the registry */
|
||||
if (ORTE_SUCCESS != (ret = orte_gpr.put(1, &values))) {
|
||||
new_attr->keyval.key = strdup(ORTE_CELLID_KEY);
|
||||
new_attr->keyval.type = ORTE_CELLID;
|
||||
new_attr->keyval.value.cellid = rds_item->cellid;
|
||||
opal_list_append(&(rds_item->attributes), &new_attr->super);
|
||||
|
||||
opal_list_append(&rds_single_host, &rds_item->super);
|
||||
|
||||
/* Store into registry */
|
||||
ret = orte_rds.store_resource(&rds_single_host);
|
||||
if (ORTE_SUCCESS != ret ) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
OBJ_DESTRUCT(&value);
|
||||
return ret;
|
||||
}
|
||||
/* cleanup the mess */
|
||||
OBJ_DESTRUCT(&value);
|
||||
|
||||
ret = orte_ras.node_insert(&single_host);
|
||||
if (ORTE_SUCCESS != ret ) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&single_host);
|
||||
OBJ_DESTRUCT(&rds_single_host);
|
||||
}
|
||||
|
||||
/* set the rest of the infrastructure */
|
||||
|
@ -16,11 +16,24 @@
|
||||
#
|
||||
# This is the US/English general help file for Open RTE's Console.
|
||||
#
|
||||
[orteconsole:splash-screen]
|
||||
|
||||
Welcome to Open RTE console
|
||||
|
||||
Type 'help' for assistance.
|
||||
|
||||
[orteconsole:failed-boot]
|
||||
Open RTE was unable to lauch daemons on the specified list of machines.
|
||||
Returned value %d instead of ORTE_SUCCESS.
|
||||
[orteconsole:usage]
|
||||
Usage: %s [OPTION]...
|
||||
Start the Open RTE Console interface
|
||||
|
||||
%s
|
||||
[orteconsole:invalid-num-arguments]
|
||||
Open RTE was unable to execute the %s command. This command requires
|
||||
at least %d arguments and only %d were provided. See 'help %s' for
|
||||
usage information.
|
||||
[orteconsole:init-failure]
|
||||
Open RTE was unable to initialize properly. The error occured while
|
||||
attempting to %s. Returned value %d instead of ORTE_SUCCESS.
|
||||
@ -34,3 +47,8 @@ Open RTE Console did not recognize the command:
|
||||
The command "%s" is not currently implemented in the Open RTE Console.
|
||||
[orteconsole:failed-command]
|
||||
The command "%s" failed with return value %d.
|
||||
[orteconsole:no-hosts]
|
||||
Open RTE Console did not find any hosts.
|
||||
[orteconsole:no-daemon-started]
|
||||
Open RTE was unable to find a started daemon. Use the boot command
|
||||
to start a daemon on you system.
|
||||
|
@ -26,15 +26,12 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_READLINE_H
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
#endif
|
||||
|
||||
#include "dps/dps.h"
|
||||
|
||||
#include "util/sys_info.h"
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/session_dir.h"
|
||||
#include "opal/util/output.h"
|
||||
@ -44,11 +41,15 @@
|
||||
#include "runtime/runtime.h"
|
||||
|
||||
#include "mca/base/base.h"
|
||||
#include "mca/rmgr/rmgr.h"
|
||||
#include "mca/errmgr/errmgr.h"
|
||||
#include "mca/rml/rml.h"
|
||||
#include "mca/ras/ras.h"
|
||||
#include "mca/rds/base/base.h"
|
||||
#include "mca/ns/ns.h"
|
||||
#include "mca/gpr/gpr.h"
|
||||
#include "mca/pls/base/base.h"
|
||||
#include "runtime/orte_setup_hnp.h"
|
||||
#include "tools/orted/orted.h"
|
||||
|
||||
#include "tools/console/orteconsole.h"
|
||||
@ -57,6 +58,7 @@
|
||||
* Global Variables
|
||||
*/
|
||||
static bool exit_cmd;
|
||||
static bool daemon_is_active;
|
||||
|
||||
/*
|
||||
* Globals for catching command line options
|
||||
@ -67,10 +69,20 @@ opal_cmd_line_init_t cmd_line_opts[] = {
|
||||
{ NULL, NULL, NULL, 'h', NULL, "help", 0,
|
||||
&orte_console_globals.help, OPAL_CMD_LINE_TYPE_BOOL,
|
||||
"This help message" },
|
||||
|
||||
/* A Hostfile */
|
||||
{ "rds", "hostfile", "path", '\0', "hostfile", "hostfile", 1,
|
||||
&orte_console_globals.hostfile, OPAL_CMD_LINE_TYPE_STRING,
|
||||
"Provide a hostfile" },
|
||||
|
||||
{ "rds", "hostfile", "path", '\0', "machinefile", "machinefile", 1,
|
||||
&orte_console_globals.hostfile, OPAL_CMD_LINE_TYPE_STRING,
|
||||
"Provide a hostfile" },
|
||||
|
||||
/* End of list */
|
||||
{ NULL, NULL, NULL, '\0', NULL, NULL, 0,
|
||||
NULL, OPAL_CMD_LINE_TYPE_NULL, NULL }
|
||||
NULL, OPAL_CMD_LINE_TYPE_NULL,
|
||||
NULL }
|
||||
};
|
||||
|
||||
/*
|
||||
@ -87,6 +99,41 @@ orte_console_command_t console_commands[] = {
|
||||
"help [command]",
|
||||
"Print this display" },
|
||||
|
||||
{ "boot-daemons", "boot", 0, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_boot_daemons,
|
||||
"boot-daemons [hostname] [username]",
|
||||
"Launch Persistant Daemons. This will use the specifiec host or the first host added." },
|
||||
|
||||
{ "clean", "cl", 0, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_clean,
|
||||
"clean",
|
||||
"Kill all jobs in the universe, preserving all daemons" },
|
||||
|
||||
{ "add", NULL, 1, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_add_host,
|
||||
"add hostname [hostname1 hostname2 ...]",
|
||||
"Add a host to the current universe" },
|
||||
|
||||
{ "remove", "del", 1, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_remove_host,
|
||||
"remove hostname [hostname1 hostname2 ...]",
|
||||
"Remove a host from the current universe" },
|
||||
|
||||
{ "display", "conf", 0, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_display_configuration,
|
||||
"display",
|
||||
"Diplay a list of the machines in the current universe" },
|
||||
|
||||
{ "spawn", "run", 3, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_launch_job,
|
||||
"spawn -np <number of processes> <process name>",
|
||||
"Spawn a process" },
|
||||
|
||||
{ "halt-daemons", "halt", 0, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_halt_daemons,
|
||||
"halt_daemons",
|
||||
"Halt the Persistant Daemons on all nodes" },
|
||||
|
||||
{ "contactinfo", "ci", 0, ORTE_CONSOLE_TYPE_STD,
|
||||
orte_console_contactinfo,
|
||||
"contactinfo",
|
||||
@ -97,7 +144,7 @@ orte_console_command_t console_commands[] = {
|
||||
"dumpvm",
|
||||
"Get VM List from daemons" },
|
||||
|
||||
{ "devel", NULL, 2, ORTE_CONSOLE_TYPE_HIDDEN,
|
||||
{ "devel", NULL, 0, ORTE_CONSOLE_TYPE_HIDDEN,
|
||||
orte_console_devel,
|
||||
"devel arg1 arg2",
|
||||
"Development Debugging function" },
|
||||
@ -108,6 +155,17 @@ orte_console_command_t console_commands[] = {
|
||||
NULL }
|
||||
};
|
||||
|
||||
/* This should be added to opal_list.c ??? JJH */
|
||||
static int opal_list_clear(opal_list_t *list) {
|
||||
opal_list_item_t *item;
|
||||
|
||||
while ( NULL != (item = opal_list_remove_first(list) ) ) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret=0;
|
||||
@ -132,7 +190,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Check for help request */
|
||||
if(orte_console_globals.help) {
|
||||
if ( orte_console_globals.help ) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(cmd_line);
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:usage", false,
|
||||
@ -141,6 +199,8 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:splash-screen", false);
|
||||
|
||||
/*
|
||||
* Intialize the ORTE environment
|
||||
*/
|
||||
@ -149,12 +209,13 @@ int main(int argc, char *argv[])
|
||||
* up incorrect infrastructure that only a singleton would
|
||||
* require
|
||||
*/
|
||||
|
||||
ret = mca_base_param_reg_int_name("orte_base", "infrastructure",
|
||||
"Whether we are ORTE infrastructure or an ORTE application",
|
||||
false, false, (int)false, NULL);
|
||||
mca_base_param_set_int(ret, (int)true);
|
||||
|
||||
daemon_is_active = false;
|
||||
|
||||
if (OMPI_SUCCESS != (ret = orte_init()) ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:init-failure", false,
|
||||
"orte_init()", ret);
|
||||
@ -164,20 +225,28 @@ int main(int argc, char *argv[])
|
||||
/*
|
||||
* Work Loop
|
||||
*/
|
||||
OBJ_CONSTRUCT(&orte_console_hosts, opal_list_t);
|
||||
orte_ras.node_query(&orte_console_hosts);
|
||||
|
||||
exit_cmd = false;
|
||||
memset(&input_command, 0, sizeof(orte_console_input_command_t));
|
||||
while (!exit_cmd) {
|
||||
while ( !exit_cmd ) {
|
||||
usercmd = orte_console_get_input_line();
|
||||
if (NULL == usercmd || 0 >= strlen(usercmd) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
orte_console_parse_command(usercmd, &input_command);
|
||||
|
||||
orte_console_execute_command(input_command);
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&orte_console_hosts);
|
||||
|
||||
/*
|
||||
* Finialize ORTE Environment
|
||||
*/
|
||||
if(ORTE_SUCCESS != (ret = orte_finalize()) ) {
|
||||
if ( ORTE_SUCCESS != (ret = orte_finalize()) ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:finalize-failure", false,
|
||||
"orte_finalize()", ret);
|
||||
return ret;
|
||||
@ -191,17 +260,17 @@ static int command_cmp(char* user_command, orte_console_command_t system_command
|
||||
/*
|
||||
* Check for Full Name Match
|
||||
*/
|
||||
if( 0 == strncmp(user_command, system_command.cmd_full_name,
|
||||
if ( 0 == strncmp(user_command, system_command.cmd_full_name,
|
||||
strlen(system_command.cmd_full_name)) ) {
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* Check for Short Name Match
|
||||
*/
|
||||
else if( ( system_command.cmd_short_name != NULL ) &&
|
||||
( strlen(user_command) == strlen(system_command.cmd_short_name) ) &&
|
||||
( 0 == strncmp(user_command, system_command.cmd_short_name,
|
||||
strlen(system_command.cmd_short_name)) ) ) {
|
||||
else if ( ( NULL != system_command.cmd_short_name ) &&
|
||||
( strlen(user_command) == strlen(system_command.cmd_short_name) ) &&
|
||||
( 0 == strncmp(user_command, system_command.cmd_short_name,
|
||||
strlen(system_command.cmd_short_name)) ) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -212,25 +281,33 @@ static int orte_console_execute_command(orte_console_input_command_t input_comma
|
||||
orte_console_command_t *cur_cmd;
|
||||
int i, ret;
|
||||
|
||||
for(i = 0; console_commands[i].cmd_type != ORTE_CONSOLE_TYPE_NULL; ++i) {
|
||||
for (i = 0; console_commands[i].cmd_type != ORTE_CONSOLE_TYPE_NULL; ++i) {
|
||||
cur_cmd = &console_commands[i];
|
||||
|
||||
/*
|
||||
* Check the requested command
|
||||
*/
|
||||
if ( command_cmp(input_command.cmd_name, *cur_cmd) == 0 ){
|
||||
/* Check for matching command */
|
||||
if ( 0 == command_cmp(input_command.cmd_name, *cur_cmd) ){
|
||||
/* Check number of arguments */
|
||||
if (input_command.argc < (cur_cmd->cmd_args+1)) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:invalid-num-arguments", false,
|
||||
input_command.cmd_name, cur_cmd->cmd_args,
|
||||
input_command.argc, cur_cmd->cmd_full_name);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
ret = cur_cmd->cmd_function(input_command);
|
||||
|
||||
if(ret == ORTE_ERR_NOT_IMPLEMENTED) {
|
||||
/* Check Return Codes */
|
||||
if ( ORTE_ERR_NOT_IMPLEMENTED == ret ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:unimplemented-command", false,
|
||||
cur_cmd->cmd_full_name);
|
||||
return ret;
|
||||
}
|
||||
else if(ret != ORTE_SUCCESS) {
|
||||
else if ( ORTE_SUCCESS != ret ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:failed-command", false,
|
||||
cur_cmd->cmd_full_name, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -238,7 +315,7 @@ static int orte_console_execute_command(orte_console_input_command_t input_comma
|
||||
/*
|
||||
* If command was not found :(
|
||||
*/
|
||||
if( console_commands[i].cmd_type == ORTE_CONSOLE_TYPE_NULL ) {
|
||||
if ( ORTE_CONSOLE_TYPE_NULL == console_commands[i].cmd_type ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:unknown-command", false,
|
||||
input_command.cmd_name);
|
||||
return ORTE_ERR_NOT_IMPLEMENTED;
|
||||
@ -248,27 +325,332 @@ static int orte_console_execute_command(orte_console_input_command_t input_comma
|
||||
}
|
||||
|
||||
static int orte_console_parse_command(char * usercmd, orte_console_input_command_t *input_command){
|
||||
char *tok;
|
||||
|
||||
input_command->argc = 0;
|
||||
tok = strtok(usercmd, " ");
|
||||
while(tok != NULL) {
|
||||
if(input_command->argc == 0) {
|
||||
input_command->cmd_name = strdup(tok);
|
||||
}
|
||||
input_command->argv[input_command->argc] = strdup(tok);
|
||||
++(input_command->argc);
|
||||
input_command->argv = opal_argv_split(usercmd, ' ');
|
||||
input_command->argc = opal_argv_count(input_command->argv);
|
||||
input_command->cmd_name = strdup(input_command->argv[0]);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
* Actual Functionality below
|
||||
* =========================== */
|
||||
|
||||
static int add_hosts_to_registry(opal_list_t *updates) {
|
||||
orte_rds_cell_desc_t *rds_item;
|
||||
orte_rds_cell_attr_t *new_attr;
|
||||
orte_ras_node_t *ras_item;
|
||||
opal_list_item_t *item;
|
||||
opal_list_t rds_updates;
|
||||
int ret;
|
||||
orte_cellid_t local_cellid;
|
||||
bool need_cellid = true;
|
||||
|
||||
OBJ_CONSTRUCT(&rds_updates, opal_list_t);
|
||||
|
||||
/* Convert RAS list to RDS list */
|
||||
for ( item = opal_list_get_first(updates);
|
||||
item != opal_list_get_end( updates);
|
||||
item = opal_list_get_next( item)) {
|
||||
ras_item = (orte_ras_node_t *) item;
|
||||
|
||||
tok = strtok(NULL, " ");
|
||||
rds_item = OBJ_NEW(orte_rds_cell_desc_t);
|
||||
if (NULL == rds_item) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
rds_item->site = strdup("Console");
|
||||
rds_item->name = strdup(ras_item->node_name);
|
||||
|
||||
if(need_cellid) {
|
||||
#if 0 /* JJH Repair when cellid's are fixed */
|
||||
/* Create a new cellid */
|
||||
ret = orte_ns.create_cellid(&local_cellid, rds_item->site, rds_item->name);
|
||||
if (ORTE_SUCCESS != ret) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
local_cellid = 0;
|
||||
#endif
|
||||
}
|
||||
rds_item->cellid = local_cellid;
|
||||
ras_item->node_cellid = local_cellid;
|
||||
|
||||
new_attr = OBJ_NEW(orte_rds_cell_attr_t);
|
||||
if (NULL == new_attr) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
new_attr->keyval.key = strdup(ORTE_RDS_NAME);
|
||||
new_attr->keyval.type = ORTE_STRING;
|
||||
new_attr->keyval.value.strptr = strdup(ras_item->node_name);
|
||||
opal_list_append(&(rds_item->attributes), &new_attr->super);
|
||||
|
||||
new_attr = OBJ_NEW(orte_rds_cell_attr_t);
|
||||
if (NULL == new_attr) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
new_attr->keyval.key = strdup(ORTE_CELLID_KEY);
|
||||
new_attr->keyval.type = ORTE_CELLID;
|
||||
new_attr->keyval.value.cellid = rds_item->cellid;
|
||||
opal_list_append(&(rds_item->attributes), &new_attr->super);
|
||||
|
||||
opal_list_append(&rds_updates, &rds_item->super);
|
||||
}
|
||||
|
||||
/* Add the hosts to the registry */
|
||||
ret = orte_rds.store_resource(&rds_updates);
|
||||
if (ORTE_SUCCESS != ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = orte_ras.node_insert(updates);
|
||||
if (ORTE_SUCCESS != ret ) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
opal_list_clear(&rds_updates);
|
||||
OBJ_DESTRUCT(&rds_updates);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int remove_hosts_from_registry(opal_list_t *updates) {
|
||||
opal_list_t rds_updates;
|
||||
int ret;
|
||||
|
||||
OBJ_CONSTRUCT(&rds_updates, opal_list_t);
|
||||
|
||||
/* Add the hosts to the registry *
|
||||
orte_rds_base_convert_ras_to_rds(updates, &rds_updates);
|
||||
|
||||
/* JJH This function needs to be written *
|
||||
ret = orte_rds_base_node_delete(&rds_updates);
|
||||
if (ORTE_SUCCESS != ret) {
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
/* JJH Need to push this through the API
|
||||
ret = orte_ras.node_delete(updates);
|
||||
if (ORTE_SUCCESS != ret ) {
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
opal_list_clear(&rds_updates);
|
||||
OBJ_DESTRUCT(&rds_updates);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static int orte_console_add_host(orte_console_input_command_t input_command) {
|
||||
int i, ret;
|
||||
orte_ras_node_t *tmp_host;
|
||||
opal_list_t hosts_to_add;
|
||||
|
||||
OBJ_CONSTRUCT(&hosts_to_add, opal_list_t);
|
||||
|
||||
for(i = 1; i < input_command.argc; ++i) {
|
||||
tmp_host = OBJ_NEW(orte_ras_node_t);
|
||||
if (NULL == tmp_host) {
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
tmp_host->node_name = strdup(input_command.argv[i]);
|
||||
tmp_host->node_arch = strdup("unknown");
|
||||
tmp_host->node_cellid = 0; /* JJH Repair when cellid's are fixed */
|
||||
tmp_host->node_slots_inuse = 0;
|
||||
tmp_host->node_slots_max = 1;
|
||||
tmp_host->node_slots = 1;
|
||||
|
||||
if (daemon_is_active) {
|
||||
opal_list_append(&hosts_to_add, &tmp_host->super);
|
||||
}
|
||||
else {
|
||||
opal_list_append(&orte_console_hosts, &tmp_host->super);
|
||||
}
|
||||
|
||||
printf("Added Host: <%s>\n", input_command.argv[i]);
|
||||
}
|
||||
|
||||
if ( !opal_list_is_empty(&hosts_to_add) && daemon_is_active) {
|
||||
/*
|
||||
* If there is an active daemon, then add to the registry
|
||||
*/
|
||||
ret = add_hosts_to_registry(&hosts_to_add);
|
||||
if (ORTE_SUCCESS != ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Get a new list of registered hosts */
|
||||
opal_list_clear(&orte_console_hosts);
|
||||
ret = orte_ras.node_query(&orte_console_hosts);
|
||||
if (ORTE_SUCCESS != ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
opal_list_clear(&hosts_to_add);
|
||||
OBJ_DESTRUCT(&hosts_to_add);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int orte_console_remove_host(orte_console_input_command_t input_command) {
|
||||
int i, ret;
|
||||
orte_ras_node_t *tmp_host;
|
||||
opal_list_item_t *item;
|
||||
opal_list_t hosts_to_remove;
|
||||
bool done;
|
||||
|
||||
OBJ_CONSTRUCT(&hosts_to_remove, opal_list_t);
|
||||
|
||||
for(i = 1; i < input_command.argc; ++i) {
|
||||
done = false;
|
||||
for (item = opal_list_get_first(&orte_console_hosts);
|
||||
item != opal_list_get_end( &orte_console_hosts);
|
||||
item = opal_list_get_next( item)) {
|
||||
tmp_host = (orte_ras_node_t *)item;
|
||||
|
||||
if (0 == strcmp(tmp_host->node_name, input_command.argv[i])) {
|
||||
opal_list_remove_item(&orte_console_hosts, item);
|
||||
opal_list_append(&hosts_to_remove, item);
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!done) {
|
||||
printf("Could not find host <%s>\n", input_command.argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !opal_list_is_empty(&hosts_to_remove) && daemon_is_active) {
|
||||
/* Delete hosts from registry */
|
||||
ret = remove_hosts_from_registry(&hosts_to_remove);
|
||||
if (ORTE_SUCCESS != ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Get a new list of registered hosts */
|
||||
opal_list_clear(&orte_console_hosts);
|
||||
ret = orte_ras.node_query(&orte_console_hosts);
|
||||
if (ORTE_SUCCESS != ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
opal_list_clear(&hosts_to_remove);
|
||||
OBJ_DESTRUCT(&hosts_to_remove);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int orte_console_display_configuration(orte_console_input_command_t input_command) {
|
||||
orte_ras_node_t *tmp_host;
|
||||
opal_list_item_t *item;
|
||||
int i;
|
||||
|
||||
if ( opal_list_is_empty(&orte_console_hosts) ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:no-hosts", false);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
printf("%6s %15s %10s %13s %15s\n", "Index",
|
||||
"Hostname", "CPU(s)",
|
||||
"CPU(s) Used", "Arch");
|
||||
for (item = opal_list_get_first(&orte_console_hosts), i = 0;
|
||||
item != opal_list_get_end( &orte_console_hosts);
|
||||
item = opal_list_get_next( item), ++i) {
|
||||
tmp_host = (orte_ras_node_t *)item;
|
||||
printf("%6d %15s %10ld %13ld %15s\n", i,
|
||||
tmp_host->node_name, tmp_host->node_slots,
|
||||
tmp_host->node_slots_inuse, tmp_host->node_arch);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int orte_console_launch_job(orte_console_input_command_t input_command) {
|
||||
if(!daemon_is_active) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:no-daemon-started", false);
|
||||
}
|
||||
|
||||
return ORTE_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static int orte_console_clean(orte_console_input_command_t input_command) {
|
||||
|
||||
return ORTE_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static int orte_console_boot_daemons(orte_console_input_command_t input_command) {
|
||||
int rc, id;
|
||||
orte_ras_node_t *item;
|
||||
char *remote_daemon;
|
||||
char *username = NULL;
|
||||
|
||||
if ( opal_list_is_empty(&orte_console_hosts) && 1 >= input_command.argc ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:no-hosts", false);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
/* If hostname supplied on command line use it */
|
||||
if ( 1 < input_command.argc) {
|
||||
remote_daemon = strdup(input_command.argv[1]);
|
||||
}
|
||||
/* Otherwise get first node in list to serve as the primary daemon */
|
||||
else {
|
||||
item = (orte_ras_node_t *)opal_list_get_first(&orte_console_hosts);
|
||||
remote_daemon = strdup(item->node_name);
|
||||
}
|
||||
|
||||
printf("Launching Remote Daemon on \"%s\"", remote_daemon);
|
||||
|
||||
|
||||
/* If they supplied a username then use that,
|
||||
otherwise assume same username as on the console system */
|
||||
if ( 2 < input_command.argc) {
|
||||
username = strdup(input_command.argv[2]);
|
||||
printf(" Username \"%s\"\n", username);
|
||||
}
|
||||
else {
|
||||
username = NULL;
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* Create the persistent daemon */
|
||||
id = mca_base_param_register_int("persistent",NULL,NULL,NULL,(int)false);
|
||||
mca_base_param_set_int(id, (int)true);
|
||||
|
||||
rc = orte_setup_hnp(NULL, remote_daemon, username);
|
||||
if ( ORTE_SUCCESS != rc) {
|
||||
printf("Open RTE Boot: Failed!\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
printf("Open RTE Boot: Successful!\n");
|
||||
daemon_is_active = true;
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int orte_console_halt_daemons(orte_console_input_command_t input_command) {
|
||||
if(!daemon_is_active) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:no-daemon-started", false);
|
||||
}
|
||||
|
||||
return ORTE_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static int orte_console_devel(orte_console_input_command_t input_command) {
|
||||
|
||||
system("orted --seed --persistent --scope public");
|
||||
|
||||
if(daemon_is_active) {
|
||||
orte_gpr.dump_segment(NULL, 0);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
@ -287,14 +669,14 @@ static int orte_console_help(orte_console_input_command_t input_command) {
|
||||
/*
|
||||
* Generic Help
|
||||
*/
|
||||
if(input_command.argc <= 1) {
|
||||
if ( input_command.argc <= 1 ) {
|
||||
printf("Open RTE Console Commands:\n\n");
|
||||
|
||||
for(i = 0; console_commands[i].cmd_type != ORTE_CONSOLE_TYPE_NULL; ++i) {
|
||||
for (i = 0; console_commands[i].cmd_type != ORTE_CONSOLE_TYPE_NULL; ++i) {
|
||||
cur_cmd = &console_commands[i];
|
||||
if(cur_cmd->cmd_type != ORTE_CONSOLE_TYPE_HIDDEN) {
|
||||
if ( ORTE_CONSOLE_TYPE_HIDDEN != cur_cmd->cmd_type ) {
|
||||
printf("%15s ", cur_cmd->cmd_full_name);
|
||||
if(cur_cmd->cmd_short_name == NULL) {
|
||||
if ( NULL == cur_cmd->cmd_short_name ) {
|
||||
printf(" ");
|
||||
}
|
||||
else {
|
||||
@ -313,10 +695,10 @@ static int orte_console_help(orte_console_input_command_t input_command) {
|
||||
for(i = 0; console_commands[i].cmd_type != ORTE_CONSOLE_TYPE_NULL; ++i) {
|
||||
cur_cmd = &console_commands[i];
|
||||
|
||||
if ( command_cmp(input_command.argv[1], *cur_cmd) == 0 ){
|
||||
if ( 0 == command_cmp(input_command.argv[1], *cur_cmd) ){
|
||||
printf("Command:\n");
|
||||
printf("\t%s ", cur_cmd->cmd_full_name);
|
||||
if(cur_cmd->cmd_short_name != NULL) {
|
||||
if ( NULL != cur_cmd->cmd_short_name ) {
|
||||
printf(" | %5s", cur_cmd->cmd_short_name);
|
||||
}
|
||||
printf("\n");
|
||||
@ -324,7 +706,7 @@ static int orte_console_help(orte_console_input_command_t input_command) {
|
||||
printf("Description:\n");
|
||||
printf("\t%s\n", cur_cmd->cmd_description);
|
||||
|
||||
if(cur_cmd->cmd_usage != NULL) {
|
||||
if ( NULL != cur_cmd->cmd_usage ) {
|
||||
printf("Usage:\n");
|
||||
printf("\t%s\n", cur_cmd->cmd_usage);
|
||||
}
|
||||
@ -335,7 +717,7 @@ static int orte_console_help(orte_console_input_command_t input_command) {
|
||||
/*
|
||||
* Command Not Found
|
||||
*/
|
||||
if( console_commands[i].cmd_type == ORTE_CONSOLE_TYPE_NULL ) {
|
||||
if( ORTE_CONSOLE_TYPE_NULL == console_commands[i].cmd_type ) {
|
||||
opal_show_help("help-orteconsole.txt", "orteconsole:unknown-command", false,
|
||||
input_command.argv[1]);
|
||||
return ORTE_SUCCESS;
|
||||
@ -352,54 +734,71 @@ static int orte_console_dumpvm(orte_console_input_command_t input_command) {
|
||||
return ORTE_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the contact information for the remote daemon
|
||||
*/
|
||||
static int orte_console_contactinfo(orte_console_input_command_t input_command) {
|
||||
char * str_response;
|
||||
orte_buffer_t *buffer = NULL;
|
||||
orte_process_name_t seed={0,0,0};
|
||||
int ret;
|
||||
size_t n;
|
||||
|
||||
orte_console_send_command(ORTE_DAEMON_CONTACT_QUERY_CMD);
|
||||
if (0 > orte_rml.recv_buffer(&seed, buffer, ORTE_RML_TAG_DAEMON)) {
|
||||
printf("****got a bad response\n");
|
||||
return ORTE_ERROR;
|
||||
} else {
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != orte_dps.unpack(buffer, &str_response, &n, ORTE_STRING)) {
|
||||
printf("****couldn't decode answer\n");
|
||||
return ORTE_ERROR;
|
||||
} else {
|
||||
printf(str_response);
|
||||
printf("\n");
|
||||
}
|
||||
/* Start the exchange */
|
||||
ret = orte_console_send_command(ORTE_DAEMON_CONTACT_QUERY_CMD);
|
||||
if (ORTE_SUCCESS != ret ){
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = orte_rml.recv_buffer(&seed, buffer, ORTE_RML_TAG_DAEMON);
|
||||
if ( 0 > ret) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
n = 1;
|
||||
ret = orte_dps.unpack(buffer, &str_response, &n, ORTE_STRING);
|
||||
if ( ORTE_SUCCESS != ret ) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
printf(str_response);
|
||||
printf("\n");
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send a command to the remote daemon
|
||||
*/
|
||||
static int orte_console_send_command(orte_daemon_cmd_flag_t usercmd)
|
||||
{
|
||||
orte_buffer_t *cmd;
|
||||
orte_daemon_cmd_flag_t command;
|
||||
orte_process_name_t seed = {0,0,0};
|
||||
int rc;
|
||||
orte_process_name_t seed={0,0,0};
|
||||
|
||||
|
||||
cmd = OBJ_NEW(orte_buffer_t);
|
||||
if (NULL == cmd) {
|
||||
fprintf(stderr, "console: comm failure\n");
|
||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
command = usercmd;
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_DAEMON_CMD))) {
|
||||
fprintf(stderr, "console: comm failure 1\n");
|
||||
rc = orte_dps.pack(cmd, &command, 1, ORTE_DAEMON_CMD);
|
||||
if ( ORTE_SUCCESS != rc ) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return ORTE_ERROR;
|
||||
OBJ_RELEASE(cmd);
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (0 > orte_rml.send_buffer(&seed, cmd, ORTE_RML_TAG_DAEMON, 0)) {
|
||||
fprintf(stderr, "console: comm failure 2\n");
|
||||
rc = orte_rml.send_buffer(&seed, cmd, ORTE_RML_TAG_DAEMON, 0);
|
||||
if ( 0 > rc ) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
||||
OBJ_RELEASE(cmd);
|
||||
return ORTE_ERR_COMM_FAILURE;
|
||||
}
|
||||
|
||||
@ -410,9 +809,6 @@ static int orte_console_send_command(orte_daemon_cmd_flag_t usercmd)
|
||||
|
||||
char *orte_console_get_input_line()
|
||||
{
|
||||
#ifdef HAVE_READLINE_H
|
||||
return readline("orteconsole>");
|
||||
#else
|
||||
char *ret, *buff;
|
||||
char input[ORTE_CONSOLE_MAX_LINE_LENGTH];
|
||||
|
||||
@ -426,5 +822,4 @@ char *orte_console_get_input_line()
|
||||
}
|
||||
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
@ -17,6 +17,10 @@
|
||||
#ifndef ORTECONSOLE_H
|
||||
#define ORTECONSOLE_H
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ORTE_CONSOLE_MAX_LINE_LENGTH 1024
|
||||
#define ORTE_CONSOLE_MAX_ARGC 10
|
||||
|
||||
@ -27,11 +31,13 @@
|
||||
/* Command line Structure */
|
||||
typedef struct {
|
||||
bool help;
|
||||
char *hostfile;
|
||||
|
||||
opal_mutex_t lock;
|
||||
opal_condition_t cond;
|
||||
} orte_console_globals_t;
|
||||
|
||||
/* Console Command Types */
|
||||
enum orte_console_type_t {
|
||||
ORTE_CONSOLE_TYPE_NULL,
|
||||
|
||||
@ -40,11 +46,12 @@ enum orte_console_type_t {
|
||||
};
|
||||
typedef enum orte_console_type_t orte_console_type_t;
|
||||
|
||||
/* Contained parsed user input */
|
||||
typedef struct {
|
||||
/* Command Name */
|
||||
char * cmd_name;
|
||||
|
||||
char * argv[ORTE_CONSOLE_MAX_ARGC];
|
||||
char ** argv;
|
||||
int argc;
|
||||
} orte_console_input_command_t;
|
||||
|
||||
@ -66,13 +73,26 @@ typedef struct {
|
||||
const char * cmd_description;
|
||||
} orte_console_command_t;
|
||||
|
||||
/* Local list of allocated hosts */
|
||||
static opal_list_t orte_console_hosts;
|
||||
|
||||
/*
|
||||
* Function for each command
|
||||
*/
|
||||
static int orte_console_exit(orte_console_input_command_t);
|
||||
static int orte_console_help(orte_console_input_command_t);
|
||||
|
||||
static int orte_console_boot_daemons(orte_console_input_command_t);
|
||||
static int orte_console_clean(orte_console_input_command_t);
|
||||
static int orte_console_add_host(orte_console_input_command_t);
|
||||
static int orte_console_remove_host(orte_console_input_command_t);
|
||||
static int orte_console_display_configuration(orte_console_input_command_t);
|
||||
static int orte_console_launch_job(orte_console_input_command_t);
|
||||
static int orte_console_halt_daemons(orte_console_input_command_t);
|
||||
|
||||
static int orte_console_contactinfo(orte_console_input_command_t);
|
||||
static int orte_console_dumpvm(orte_console_input_command_t);
|
||||
|
||||
static int orte_console_devel(orte_console_input_command_t);
|
||||
|
||||
/*
|
||||
@ -83,4 +103,8 @@ static int orte_console_send_command(orte_daemon_cmd_flag_t usercmd);
|
||||
static int orte_console_parse_command(char * usercmd, orte_console_input_command_t *input_command);
|
||||
static int orte_console_execute_command(orte_console_input_command_t command);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ORTECONSOLE_H */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user