Skip to content

Commit

Permalink
Cleanup grpcomm cruft
Browse files Browse the repository at this point in the history
Remove unused functions and entry points

Signed-off-by: Ralph Castain <rhc@pmix.org>
  • Loading branch information
rhc54 committed Oct 13, 2022
1 parent f756956 commit 9e833e1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 87 deletions.
7 changes: 0 additions & 7 deletions src/mca/grpcomm/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,9 @@ PRTE_EXPORT int prte_grpcomm_API_xcast(prte_grpcomm_signature_t *sig, prte_rml_t
PRTE_EXPORT int prte_grpcomm_API_allgather(prte_grpcomm_signature_t *sig, pmix_data_buffer_t *buf,
int mode, pmix_status_t local_status,
prte_grpcomm_cbfunc_t cbfunc, void *cbdata);
/* reliable broadcast API */
PRTE_EXPORT int prte_grpcomm_API_rbcast(prte_grpcomm_signature_t *sig, prte_rml_tag_t tag,
pmix_data_buffer_t *buf);
PRTE_EXPORT int prte_grpcomm_API_register_cb(prte_grpcomm_rbcast_cb_t callback);

PRTE_EXPORT prte_grpcomm_coll_t *prte_grpcomm_base_get_tracker(prte_grpcomm_signature_t *sig,
bool create);
PRTE_EXPORT void prte_grpcomm_base_mark_distance_recv(prte_grpcomm_coll_t *coll, uint32_t distance);
PRTE_EXPORT unsigned int prte_grpcomm_base_check_distance_recv(prte_grpcomm_coll_t *coll,
uint32_t distance);

END_C_DECLS
#endif
7 changes: 1 addition & 6 deletions src/mca/grpcomm/base/grpcomm_base_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ prte_grpcomm_base_t prte_grpcomm_base = {

prte_grpcomm_API_module_t prte_grpcomm = {
.xcast = prte_grpcomm_API_xcast,
.allgather = prte_grpcomm_API_allgather,
.rbcast = prte_grpcomm_API_rbcast,
.register_cb = prte_grpcomm_API_register_cb,
.unregister_cb = NULL
.allgather = prte_grpcomm_API_allgather
};

static int base_register(pmix_mca_base_register_flag_t flags)
Expand Down Expand Up @@ -143,7 +140,6 @@ static void ccon(prte_grpcomm_coll_t *p)
p->sig = NULL;
p->status = PMIX_SUCCESS;
PMIX_DATA_BUFFER_CONSTRUCT(&p->bucket);
PMIX_CONSTRUCT(&p->distance_mask_recv, pmix_bitmap_t);
p->dmns = NULL;
p->ndmns = 0;
p->nexpected = 0;
Expand All @@ -158,7 +154,6 @@ static void cdes(prte_grpcomm_coll_t *p)
PMIX_RELEASE(p->sig);
}
PMIX_DATA_BUFFER_DESTRUCT(&p->bucket);
PMIX_DESTRUCT(&p->distance_mask_recv);
free(p->dmns);
free(p->buffers);
}
Expand Down
75 changes: 5 additions & 70 deletions src/mca/grpcomm/base/grpcomm_base_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,59 +128,6 @@ int prte_grpcomm_API_xcast(prte_grpcomm_signature_t *sig, prte_rml_tag_t tag,
return rc;
}

int prte_grpcomm_API_rbcast(prte_grpcomm_signature_t *sig, prte_rml_tag_t tag,
pmix_data_buffer_t *msg)
{
int rc = PRTE_ERROR;
pmix_data_buffer_t *buf;
prte_grpcomm_base_active_t *active;

PMIX_OUTPUT_VERBOSE((1, prte_grpcomm_base_framework.framework_output,
"%s grpcomm:base:rbcast sending %u bytes to tag %ld",
PRTE_NAME_PRINT(PRTE_PROC_MY_NAME),
(NULL == msg) ? 0 : (unsigned int) msg->bytes_used, (long) tag));

/* this function does not access any framework-global data, and
* so it does not require us to push it into the event library */

/* prep the output buffer */
PMIX_DATA_BUFFER_CREATE(buf);

/* setup the payload */
if (PRTE_SUCCESS != (rc = pack_xcast(sig, buf, msg, tag))) {
PRTE_ERROR_LOG(rc);
PMIX_RELEASE(buf);
return rc;
}
/* cycle thru the actives and see who can send it */
PMIX_LIST_FOREACH(active, &prte_grpcomm_base.actives, prte_grpcomm_base_active_t)
{
if (NULL != active->module->rbcast) {
if (PRTE_SUCCESS == (rc = active->module->rbcast(buf))) {
break;
}
}
}

return rc;
}

int prte_grpcomm_API_register_cb(prte_grpcomm_rbcast_cb_t callback)
{
int rc = PRTE_ERROR;
prte_grpcomm_base_active_t *active;

PMIX_LIST_FOREACH(active, &prte_grpcomm_base.actives, prte_grpcomm_base_active_t)
{
if (NULL != active->module->register_cb) {
if (PRTE_ERROR != (rc = active->module->register_cb(callback))) {
break;
}
}
}
return rc;
}

static void allgather_stub(int fd, short args, void *cbdata)
{
prte_grpcomm_caddy_t *cd = (prte_grpcomm_caddy_t *) cbdata;
Expand Down Expand Up @@ -366,8 +313,8 @@ static int create_dmns(prte_grpcomm_signature_t *sig, pmix_rank_t **dmns, size_t

/* if NULL == procs, or the target jobid is our own,
* then all daemons are participating */
if (NULL == sig->signature
|| PMIX_CHECK_NSPACE(PRTE_PROC_MY_NAME->nspace, sig->signature[0].nspace)) {
if (NULL == sig->signature ||
PMIX_CHECK_NSPACE(PRTE_PROC_MY_NAME->nspace, sig->signature[0].nspace)) {
*ndmns = prte_process_info.num_daemons;
*dmns = NULL;
return PRTE_SUCCESS;
Expand Down Expand Up @@ -431,9 +378,9 @@ static int create_dmns(prte_grpcomm_signature_t *sig, pmix_rank_t **dmns, size_t
"%s sign: GETTING PROC OBJECT FOR %s",
PRTE_NAME_PRINT(PRTE_PROC_MY_NAME),
PRTE_NAME_PRINT(&sig->signature[n])));
if (NULL
== (proc = (prte_proc_t *) pmix_pointer_array_get_item(jdata->procs,
sig->signature[n].rank))) {
proc = (prte_proc_t *) pmix_pointer_array_get_item(jdata->procs,
sig->signature[n].rank);
if (NULL == proc) {
PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND);
rc = PRTE_ERR_NOT_FOUND;
goto done;
Expand Down Expand Up @@ -551,17 +498,5 @@ static int pack_xcast(prte_grpcomm_signature_t *sig, pmix_data_buffer_t *buffer,
}
PMIX_BYTE_OBJECT_DESTRUCT(&bo);

PMIX_OUTPUT_VERBOSE(
(1, prte_grpcomm_base_framework.framework_output, "MSG SIZE: %lu", buffer->bytes_used));
return PRTE_SUCCESS;
}

void prte_grpcomm_base_mark_distance_recv(prte_grpcomm_coll_t *coll, uint32_t distance)
{
pmix_bitmap_set_bit(&coll->distance_mask_recv, distance);
}

unsigned int prte_grpcomm_base_check_distance_recv(prte_grpcomm_coll_t *coll, uint32_t distance)
{
return pmix_bitmap_is_set_bit(&coll->distance_mask_recv, distance);
}
5 changes: 1 addition & 4 deletions src/mca/grpcomm/direct/grpcomm_direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ prte_grpcomm_base_module_t prte_grpcomm_direct_module = {
.init = init,
.finalize = finalize,
.xcast = xcast,
.allgather = allgather,
.rbcast = NULL,
.register_cb = NULL,
.unregister_cb = NULL
.allgather = allgather
};

/* internal functions */
Expand Down

0 comments on commit 9e833e1

Please sign in to comment.