
The primary change that underlies all this is in the OOB. Specifically, the problem in the code until now has been that the OOB attempts to resolve an address when we call the "send" to an unknown recipient. The OOB would then wait forever if that recipient never actually started (and hence, never reported back its OOB contact info). In the case of an orted that failed to start, we would correctly detect that the orted hadn't started, but then we would attempt to order all orteds (including the one that failed to start) to die. This would cause the OOB to "hang" the system. Unfortunately, revising how the OOB resolves addresses introduced a number of additional problems. Specifically, and most troublesome, was the fact that comm_spawn involved the immediate transmission of the rendezvous point from parent-to-child after the child was spawned. The current code used the OOB address resolution as a "barrier" - basically, the parent would attempt to send the info to the child, and then "hold" there until the child's contact info had arrived (meaning the child had started) and the send could be completed. Note that this also caused comm_spawn to "hang" the entire system if the child never started... The app-failed-to-start helped improve that behavior - this code provides additional relief. With this change, the OOB will return an ADDRESSEE_UNKNOWN error if you attempt to send to a recipient whose contact info isn't already in the OOB's hash tables. To resolve comm_spawn issues, we also now force the cross-sharing of connection info between parent and child jobs during spawn. Finally, to aid in setting triggers to the right values, we introduce the "arith" API for the GPR. This function allows you to atomically change the value in a registry location (either divide, multiply, add, or subtract) by the provided operand. It is equivalent to first fetching the value using a "get", then modifying it, and then putting the result back into the registry via a "put". This commit was SVN r14711.
106 строки
3.5 KiB
C
106 строки
3.5 KiB
C
/*
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
* University Research and Technology
|
|
* Corporation. All rights reserved.
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* 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 "orte/orte_types.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
#include "orte/mca/ns/ns.h"
|
|
|
|
#include "orte/dss/dss.h"
|
|
#include "orte/dss/dss_internal.h"
|
|
|
|
|
|
int orte_dss_register(orte_dss_pack_fn_t pack_fn,
|
|
orte_dss_unpack_fn_t unpack_fn,
|
|
orte_dss_copy_fn_t copy_fn,
|
|
orte_dss_compare_fn_t compare_fn,
|
|
orte_dss_size_fn_t size_fn,
|
|
orte_dss_print_fn_t print_fn,
|
|
orte_dss_release_fn_t release_fn,
|
|
bool structured,
|
|
const char *name, orte_data_type_t *type)
|
|
{
|
|
int ret;
|
|
orte_dss_type_info_t *info, **ptr;
|
|
orte_std_cntr_t i;
|
|
orte_data_type_t j;
|
|
|
|
/* Check for bozo cases */
|
|
|
|
if (NULL == pack_fn || NULL == unpack_fn || NULL == copy_fn || NULL == compare_fn ||
|
|
NULL == size_fn || NULL == print_fn || NULL == name || NULL == type) {
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
return ORTE_ERR_BAD_PARAM;
|
|
}
|
|
|
|
/* check if this entry already exists - if so, error - we do NOT allow multiple type registrations */
|
|
ptr = (orte_dss_type_info_t**)(orte_dss_types->addr);
|
|
for (i=0, j=0; j < orte_dss_num_reg_types &&
|
|
i < orte_dss_types->size; i++) {
|
|
if (NULL != ptr[i]) {
|
|
j++;
|
|
/* check if the name exists */
|
|
if (0 == strcmp(ptr[i]->odti_name, name)) {
|
|
ORTE_ERROR_LOG(ORTE_ERR_DATA_TYPE_REDEF);
|
|
return ORTE_ERR_DATA_TYPE_REDEF;
|
|
}
|
|
/* check if the specified type exists */
|
|
if (*type > 0 && ptr[i]->odti_type == *type) {
|
|
ORTE_ERROR_LOG(ORTE_ERR_DATA_TYPE_REDEF);
|
|
return ORTE_ERR_DATA_TYPE_REDEF;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* if type is given (i.e., *type > 0), then just use it.
|
|
* otherwise, go and get a new type id from the name
|
|
* service
|
|
*/
|
|
if (0 >= *type) {
|
|
if (ORTE_SUCCESS != (ret = orte_ns.define_data_type(name, type))) {
|
|
ORTE_ERROR_LOG(ret);
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
/* Add a new entry to the table */
|
|
info = (orte_dss_type_info_t*) OBJ_NEW(orte_dss_type_info_t);
|
|
if (NULL == info) {
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
}
|
|
info->odti_type = *type;
|
|
info->odti_name = strdup(name);
|
|
info->odti_pack_fn = pack_fn;
|
|
info->odti_unpack_fn = unpack_fn;
|
|
info->odti_copy_fn = copy_fn;
|
|
info->odti_compare_fn = compare_fn;
|
|
info->odti_size_fn = size_fn;
|
|
info->odti_print_fn = print_fn;
|
|
info->odti_release_fn = release_fn;
|
|
info->odti_structured = structured;
|
|
if (ORTE_SUCCESS != (ret = orte_pointer_array_set_item(orte_dss_types, *type, info))) {
|
|
ORTE_ERROR_LOG(ret);
|
|
}
|
|
|
|
/* All done */
|
|
|
|
return ret;
|
|
}
|