grpcomm/base: get rid of the seq_num field of the orte_grpcomm_signature_t struct
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
родитель
fe25f50871
Коммит
17fac4bfd1
@ -112,7 +112,6 @@ static void scon(orte_grpcomm_signature_t *p)
|
|||||||
{
|
{
|
||||||
p->signature = NULL;
|
p->signature = NULL;
|
||||||
p->sz = 0;
|
p->sz = 0;
|
||||||
p->seq_num = 0;
|
|
||||||
}
|
}
|
||||||
static void sdes(orte_grpcomm_signature_t *p)
|
static void sdes(orte_grpcomm_signature_t *p)
|
||||||
{
|
{
|
||||||
|
@ -152,12 +152,10 @@ static void allgather_stub(int fd, short args, void *cbdata)
|
|||||||
* for releasing it upon completion of the collective */
|
* for releasing it upon completion of the collective */
|
||||||
ret = opal_hash_table_get_value_ptr(&orte_grpcomm_base.sig_table, (void *)cd->sig->signature, cd->sig->sz * sizeof(orte_process_name_t), (void **)&seq_number);
|
ret = opal_hash_table_get_value_ptr(&orte_grpcomm_base.sig_table, (void *)cd->sig->signature, cd->sig->sz * sizeof(orte_process_name_t), (void **)&seq_number);
|
||||||
if (OPAL_ERR_NOT_FOUND == ret) {
|
if (OPAL_ERR_NOT_FOUND == ret) {
|
||||||
cd->sig->seq_num = 0;
|
|
||||||
seq_number = (uint32_t *)malloc(sizeof(uint32_t));
|
seq_number = (uint32_t *)malloc(sizeof(uint32_t));
|
||||||
*seq_number = 0;
|
*seq_number = 0;
|
||||||
} else if (OPAL_SUCCESS == ret) {
|
} else if (OPAL_SUCCESS == ret) {
|
||||||
*seq_number = *seq_number + 1;
|
*seq_number = *seq_number + 1;
|
||||||
cd->sig->seq_num = *seq_number;
|
|
||||||
} else {
|
} else {
|
||||||
OPAL_OUTPUT((orte_grpcomm_base_framework.framework_output,
|
OPAL_OUTPUT((orte_grpcomm_base_framework.framework_output,
|
||||||
"%s rpcomm:base:allgather cannot get signature from hash table",
|
"%s rpcomm:base:allgather cannot get signature from hash table",
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
|
* Copyright (c) 2016 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -59,7 +61,6 @@ typedef struct {
|
|||||||
opal_object_t super;
|
opal_object_t super;
|
||||||
orte_process_name_t *signature;
|
orte_process_name_t *signature;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
uint32_t seq_num;
|
|
||||||
} orte_grpcomm_signature_t;
|
} orte_grpcomm_signature_t;
|
||||||
OBJ_CLASS_DECLARATION(orte_grpcomm_signature_t);
|
OBJ_CLASS_DECLARATION(orte_grpcomm_signature_t);
|
||||||
|
|
||||||
|
@ -206,12 +206,6 @@ int orte_dt_compare_sig(orte_grpcomm_signature_t *value1, orte_grpcomm_signature
|
|||||||
}
|
}
|
||||||
if (value2->sz > value1->sz) {
|
if (value2->sz > value1->sz) {
|
||||||
return OPAL_VALUE2_GREATER;
|
return OPAL_VALUE2_GREATER;
|
||||||
}
|
|
||||||
if (value1->seq_num > value2->seq_num) {
|
|
||||||
return OPAL_VALUE1_GREATER;
|
|
||||||
}
|
|
||||||
if (value2->seq_num > value1->seq_num) {
|
|
||||||
return OPAL_VALUE2_GREATER;
|
|
||||||
}
|
}
|
||||||
/* same size - check contents */
|
/* same size - check contents */
|
||||||
if (0 == memcmp(value1->signature, value2->signature, value1->sz*sizeof(orte_process_name_t))) {
|
if (0 == memcmp(value1->signature, value2->signature, value1->sz*sizeof(orte_process_name_t))) {
|
||||||
|
@ -319,7 +319,6 @@ int orte_dt_copy_sig(orte_grpcomm_signature_t **dest, orte_grpcomm_signature_t *
|
|||||||
}
|
}
|
||||||
(*dest)->sz = src->sz;
|
(*dest)->sz = src->sz;
|
||||||
(*dest)->signature = (orte_process_name_t*)malloc(src->sz * sizeof(orte_process_name_t));
|
(*dest)->signature = (orte_process_name_t*)malloc(src->sz * sizeof(orte_process_name_t));
|
||||||
(*dest)->seq_num = src->seq_num;
|
|
||||||
if (NULL == (*dest)->signature) {
|
if (NULL == (*dest)->signature) {
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
OBJ_RELEASE(*dest);
|
OBJ_RELEASE(*dest);
|
||||||
|
@ -846,11 +846,6 @@ int orte_dt_pack_sig(opal_buffer_t *buffer, const void *src, int32_t num_vals,
|
|||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
/* pack the sequence number */
|
|
||||||
if (OPAL_SUCCESS != (rc = opal_dss.pack(buffer, &ptr[i]->seq_num, 1, OPAL_UINT32))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
if (0 < ptr[i]->sz) {
|
if (0 < ptr[i]->sz) {
|
||||||
/* pack the array */
|
/* pack the array */
|
||||||
if (OPAL_SUCCESS != (rc = opal_dss.pack(buffer, ptr[i]->signature, ptr[i]->sz, ORTE_NAME))) {
|
if (OPAL_SUCCESS != (rc = opal_dss.pack(buffer, ptr[i]->signature, ptr[i]->sz, ORTE_NAME))) {
|
||||||
|
@ -853,13 +853,13 @@ int orte_dt_print_sig(char **output, char *prefix, orte_grpcomm_signature_t *src
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == src->signature) {
|
if (NULL == src->signature) {
|
||||||
asprintf(output, "%sORTE_SIG SeqNumber:%d Procs: NULL", prefx, src->seq_num);
|
asprintf(output, "%sORTE_SIG Procs: NULL", prefx);
|
||||||
free(prefx);
|
free(prefx);
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* there must be at least one proc in the signature */
|
/* there must be at least one proc in the signature */
|
||||||
asprintf(&tmp, "%sORTE_SIG SeqNumber:%d Procs: ", prefx, src->seq_num);
|
asprintf(&tmp, "%sORTE_SIG Procs: ", prefx);
|
||||||
|
|
||||||
for (i=0; i < src->sz; i++) {
|
for (i=0; i < src->sz; i++) {
|
||||||
asprintf(&tmp2, "%s%s", tmp, ORTE_NAME_PRINT(&src->signature[i]));
|
asprintf(&tmp2, "%s%s", tmp, ORTE_NAME_PRINT(&src->signature[i]));
|
||||||
|
@ -933,10 +933,6 @@ int orte_dt_unpack_sig(opal_buffer_t *buffer, void *dest, int32_t *num_vals,
|
|||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &ptr[i]->seq_num, &cnt, OPAL_UINT32))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
if (0 < ptr[i]->sz) {
|
if (0 < ptr[i]->sz) {
|
||||||
/* allocate space for the array */
|
/* allocate space for the array */
|
||||||
ptr[i]->signature = (orte_process_name_t*)malloc(ptr[i]->sz * sizeof(orte_process_name_t));
|
ptr[i]->signature = (orte_process_name_t*)malloc(ptr[i]->sz * sizeof(orte_process_name_t));
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user