1
1
This commit was SVN r7289.
Этот коммит содержится в:
Rainer Keller 2005-09-10 08:01:47 +00:00
родитель 5fed46e072
Коммит 3c639efa38
4 изменённых файлов: 53 добавлений и 53 удалений

Просмотреть файл

@ -32,8 +32,8 @@
int
orte_pls_base_proxy_set_node_name(orte_ras_node_t* node,
orte_jobid_t jobid,
orte_pls_base_proxy_set_node_name(orte_ras_node_t* node,
orte_jobid_t jobid,
orte_process_name_t* name)
{
orte_gpr_value_t* values[1];
@ -43,19 +43,19 @@ orte_pls_base_proxy_set_node_name(orte_ras_node_t* node,
char* jobid_string;
size_t i;
int rc;
if (ORTE_SUCCESS != (rc = orte_ns.convert_jobid_to_string(&jobid_string, jobid))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_schema.get_node_tokens(&value.tokens, &value.num_tokens,
if (ORTE_SUCCESS != (rc = orte_schema.get_node_tokens(&value.tokens, &value.num_tokens,
node->node_cellid, node->node_name))) {
ORTE_ERROR_LOG(rc);
free(jobid_string);
return rc;
}
asprintf(&kv_name.key, "%s-%s", ORTE_NODE_BOOTPROXY_KEY, jobid_string);
kv_name.value.proc = *name;
keyvals[0] = &kv_name;
@ -155,7 +155,7 @@ orte_pls_base_proxy_terminate_job(orte_jobid_t jobid)
orte_gpr_value_t** values = NULL;
size_t i, j, num_values = 0;
int rc;
if (ORTE_SUCCESS != (rc = orte_ns.convert_jobid_to_string(&jobid_string, jobid))) {
ORTE_ERROR_LOG(rc);
return rc;
@ -193,7 +193,7 @@ orte_pls_base_proxy_terminate_job(orte_jobid_t jobid)
ORTE_ERROR_LOG(rc);
goto cleanup;
}
if (strcmp(keyval->key, keys[0]) != 0)
if (strcmp(keyval->key, keys[0]) != 0)
continue;
/* construct command */
@ -207,11 +207,11 @@ orte_pls_base_proxy_terminate_job(orte_jobid_t jobid)
/* send a terminate message to the bootproxy on each node */
if (0 > (ret = orte_rml.send_buffer_nb(
&keyval->value.proc,
cmd,
ORTE_RML_TAG_RMGR_SVC,
0,
orte_pls_rsh_terminate_job_cb,
&keyval->value.proc,
cmd,
ORTE_RML_TAG_RMGR_SVC,
0,
orte_pls_rsh_terminate_job_cb,
NULL))) {
ORTE_ERROR_LOG(ret);
@ -226,7 +226,7 @@ cleanup:
free(jobid_string);
free(keys[0]);
if (NULL != values) {
for(i=0; i<num_values; i++) {
if (NULL != values[i]) {

Просмотреть файл

@ -62,7 +62,7 @@ OBJ_CLASS_INSTANCE(
/*
* Query the registry for all available nodes
* Query the registry for all available nodes
*/
int orte_ras_base_node_query(opal_list_t* nodes)
@ -70,7 +70,7 @@ int orte_ras_base_node_query(opal_list_t* nodes)
size_t i, cnt;
orte_gpr_value_t** values;
int rc;
/* query all node entries */
rc = orte_gpr.get(
ORTE_GPR_KEYS_OR|ORTE_GPR_TOKENS_OR,
@ -129,7 +129,7 @@ int orte_ras_base_node_query(opal_list_t* nodes)
OBJ_RELEASE(value);
}
if (NULL != values) free(values);
return ORTE_SUCCESS;
}
@ -257,19 +257,19 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
int rc;
size_t num_values, i, j;
orte_ras_node_t* node;
num_values = opal_list_get_size(nodes);
if (0 >= num_values) {
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
return ORTE_ERR_BAD_PARAM;
}
values = (orte_gpr_value_t**)malloc(num_values * sizeof(orte_gpr_value_t*));
if (NULL == values) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
for (i=0; i < num_values; i++) {
orte_gpr_value_t* value = values[i] = OBJ_NEW(orte_gpr_value_t);
if (NULL == value) {
@ -280,7 +280,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value->addr_mode = ORTE_GPR_OVERWRITE | ORTE_GPR_TOKENS_AND;
value->segment = strdup(ORTE_NODE_SEGMENT);
value->cnt = 7; /* Seven, at max (including node_username) */
@ -293,7 +293,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
for (j=0; j < value->cnt; j++) {
value->keyvals[j] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == value->keyvals[j]) {
@ -306,7 +306,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
}
}
}
for(i=0, item = opal_list_get_first(nodes);
i < num_values && item != opal_list_get_end(nodes);
i++, item = opal_list_get_next(item)) {
@ -317,7 +317,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
(value->keyvals[j])->key = strdup(ORTE_NODE_NAME_KEY);
(value->keyvals[j])->type = ORTE_STRING;
(value->keyvals[j])->value.strptr = strdup(node->node_name);
++j;
(value->keyvals[j])->key = strdup(ORTE_NODE_ARCH_KEY);
(value->keyvals[j])->type = ORTE_STRING;
@ -326,22 +326,22 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
} else {
(value->keyvals[j])->value.strptr = strdup("");
}
++j;
(value->keyvals[j])->key = strdup(ORTE_NODE_STATE_KEY);
(value->keyvals[j])->type = ORTE_NODE_STATE;
(value->keyvals[j])->value.node_state = node->node_state;
++j;
(value->keyvals[j])->key = strdup(ORTE_CELLID_KEY);
(value->keyvals[j])->type = ORTE_CELLID;
(value->keyvals[j])->value.cellid = node->node_cellid;
++j;
(value->keyvals[j])->key = strdup(ORTE_NODE_SLOTS_KEY);
(value->keyvals[j])->type = ORTE_SIZE;
(value->keyvals[j])->value.size = node->node_slots;
++j;
(value->keyvals[j])->key = strdup(ORTE_NODE_SLOTS_MAX_KEY);
(value->keyvals[j])->type = ORTE_SIZE;
@ -367,7 +367,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes)
return rc;
}
}
/* try the insert */
if (ORTE_SUCCESS != (rc = orte_gpr.put(num_values, values))) {
ORTE_ERROR_LOG(rc);
@ -428,7 +428,7 @@ int orte_ras_base_node_delete(opal_list_t* nodes)
}
/*
* Assign the allocated slots on the specified nodes to the
* Assign the allocated slots on the specified nodes to the
* indicated jobid.
*/
int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
@ -439,19 +439,19 @@ int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
size_t num_values, i, j;
orte_ras_node_t* node;
char* jobid_str;
num_values = opal_list_get_size(nodes);
if (0 >= num_values) {
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
return ORTE_ERR_BAD_PARAM;
}
values = (orte_gpr_value_t**)malloc(num_values * sizeof(orte_gpr_value_t*));
if (NULL == values) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
for (i=0; i < num_values; i++) {
values[i] = OBJ_NEW(orte_gpr_value_t);
if (NULL == values[i]) {
@ -462,7 +462,7 @@ int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
values[i]->addr_mode = ORTE_GPR_OVERWRITE | ORTE_GPR_TOKENS_AND;
values[i]->segment = strdup(ORTE_NODE_SEGMENT);
values[i]->cnt = 1;
@ -475,7 +475,7 @@ int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
values[i]->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == values[i]->keyvals[0]) {
for (j=0; j < i; j++) {
@ -486,7 +486,7 @@ int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
return ORTE_ERR_OUT_OF_RESOURCE;
}
}
for(i=0, item = opal_list_get_first(nodes);
i < num_values && item != opal_list_get_end(nodes);
i++, item = opal_list_get_next(item)) {
@ -514,16 +514,16 @@ int orte_ras_base_node_assign(opal_list_t* nodes, orte_jobid_t jobid)
/* setup node key/value pairs */
asprintf(&((values[i]->keyvals[0])->key), "%s-%s", ORTE_NODE_SLOTS_ALLOC_KEY, jobid_str);
free(jobid_str);
(values[i]->keyvals[0])->type = ORTE_SIZE;
(values[i]->keyvals[0])->type = ORTE_SIZE;
(values[i]->keyvals[0])->value.size = node->node_slots_alloc;
}
/* try the insert */
if (ORTE_SUCCESS != (rc = orte_gpr.put(num_values, values))) {
ORTE_ERROR_LOG(rc);
}
for (j=0; j < num_values; j++) {
OBJ_RELEASE(values[j]);
}

Просмотреть файл

@ -29,7 +29,7 @@
int orte_rds_base_query(void)
{
opal_list_item_t* item;
/* Query all selected modules */
for(item = opal_list_get_first(&orte_rds_base.rds_selected);
item != opal_list_get_end(&orte_rds_base.rds_selected);

Просмотреть файл

@ -64,9 +64,9 @@ static void orte_rds_hostfile_parse_error(int token)
*/
static int orte_rds_hostfile_parse_int(void)
{
if (ORTE_RDS_HOSTFILE_EQUAL != orte_rds_hostfile_lex())
if (ORTE_RDS_HOSTFILE_EQUAL != orte_rds_hostfile_lex())
return -1;
if (ORTE_RDS_HOSTFILE_INT != orte_rds_hostfile_lex())
if (ORTE_RDS_HOSTFILE_INT != orte_rds_hostfile_lex())
return -1;
return orte_rds_hostfile_value.ival;
}
@ -137,12 +137,12 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
/* Do we need to make a new node object? First check to see
if it's in the existing list. */
if (NULL == (node = orte_rds_hostfile_lookup(existing, node_name))) {
/* If it wasn't, see if it's already in the updates list */
if (NULL == (node = orte_rds_hostfile_lookup(updates,
if (NULL == (node = orte_rds_hostfile_lookup(updates,
node_name))) {
node = OBJ_NEW(orte_ras_node_t);
node->node_name = node_name;
@ -156,7 +156,7 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
/* JJH This assumes that each hostname listed should be
placed in a new cell. Is this accurate to the design?
*/
if (ORTE_SUCCESS !=
if (ORTE_SUCCESS !=
(rc = orte_ns.create_cellid(&(node->node_cellid),
"UNKNOWN-SITE",
node->node_name))) {
@ -330,7 +330,7 @@ static int orte_rds_hostfile_query(void)
orte_rds_cell_attr_t *new_attr;
orte_ras_node_t *ras_item;
int rc;
OBJ_CONSTRUCT(&existing, opal_list_t);
OBJ_CONSTRUCT(&updates, opal_list_t);
OBJ_CONSTRUCT(&rds_updates, opal_list_t);
@ -360,7 +360,7 @@ static int orte_rds_hostfile_query(void)
for ( ras_item = (orte_ras_node_t*)opal_list_get_first(&updates);
ras_item != (orte_ras_node_t*)opal_list_get_end(&updates);
ras_item = (orte_ras_node_t*)opal_list_get_next(ras_item)) {
rds_item = OBJ_NEW(orte_rds_cell_desc_t);
if (NULL == rds_item) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
@ -381,7 +381,7 @@ static int orte_rds_hostfile_query(void)
local_cellid = 0;
need_cellid = false;
}
rds_item->cellid = local_cellid;
ras_item->node_cellid = local_cellid;
@ -394,7 +394,7 @@ static int orte_rds_hostfile_query(void)
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);
@ -404,7 +404,7 @@ static int orte_rds_hostfile_query(void)
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);
}
@ -423,13 +423,13 @@ static int orte_rds_hostfile_query(void)
goto cleanup;
}
}
cleanup:
if (NULL != mca_rds_hostfile_component.path) {
free(mca_rds_hostfile_component.path);
mca_rds_hostfile_component.path = NULL;
}
while(NULL != (item = opal_list_remove_first(&existing))) {
OBJ_RELEASE(item);
}