Skip to content

Commit

Permalink
Refactor the query aggregation process
Browse files Browse the repository at this point in the history
  • Loading branch information
houjun committed Jul 18, 2023
1 parent aee5d1e commit 40ea33f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/api/pdc_client_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -2361,25 +2361,22 @@ PDC_Client_query_metadata_name_timestep_agg(const char *obj_name, int time_step,
FUNC_ENTER(NULL);

#ifdef ENABLE_MPI
if (pdc_client_mpi_rank_g == 0) {
if (pdc_client_mpi_rank_g == 0)
ret_value = PDC_Client_query_metadata_name_timestep(obj_name, time_step, out, metadata_server_id);
if (ret_value != SUCCEED || NULL == *out) {
*out = (pdc_metadata_t *)calloc(1, sizeof(pdc_metadata_t));
PGOTO_ERROR(FAIL, "==PDC_CLIENT[%d]: - ERROR with query [%s]", pdc_client_mpi_rank_g, obj_name);
}
}
else

MPI_Bcast(&ret_value, 1, MPI_INT, 0, PDC_CLIENT_COMM_WORLD_g);
if (ret_value != SUCCEED)
PGOTO_ERROR(FAIL, "==PDC_CLIENT[%d]: - ERROR with query [%s]", pdc_client_mpi_rank_g, obj_name);

if (pdc_client_mpi_rank_g != 0)
*out = (pdc_metadata_t *)calloc(1, sizeof(pdc_metadata_t));

MPI_Bcast(*out, sizeof(pdc_metadata_t), MPI_CHAR, 0, PDC_CLIENT_COMM_WORLD_g);

MPI_Bcast(metadata_server_id, 1, MPI_UINT32_T, 0, PDC_CLIENT_COMM_WORLD_g);
#else
ret_value = PDC_Client_query_metadata_name_timestep(obj_name, time_step, out, metadata_server_id);
if (ret_value != SUCCEED || NULL == *out) {
*out = (pdc_metadata_t *)calloc(1, sizeof(pdc_metadata_t));
if (ret_value != SUCCEED)
PGOTO_ERROR(FAIL, "==PDC_CLIENT[%d]: - ERROR with query [%s]", pdc_client_mpi_rank_g, obj_name);
}
#endif

done:
Expand Down

0 comments on commit 40ea33f

Please sign in to comment.