Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/pdc_obj/include/pdc_mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* returned by PDCprop_create(PDC_OBJ_CREATE)
* \param rank_id [IN] MPI process rank
*
* \return Object ID on success/Negative on failure
* \return Object ID on success/Zero on failure
*/
pdcid_t PDCobj_create_mpi(pdcid_t cont_id, const char *obj_name, pdcid_t obj_create_prop, int rank_id,
MPI_Comm comm);
Expand Down
15 changes: 11 additions & 4 deletions src/api/pdc_obj/pdc_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
pdcid_t
PDCobj_create_mpi(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, int rank_id, MPI_Comm comm)
{
pdcid_t ret_value = SUCCEED;
struct _pdc_obj_info *p = NULL;
struct _pdc_id_info * id_info = NULL;
struct _pdc_obj_info *p = NULL;
struct _pdc_id_info * id_info = NULL;
int rank;
pdcid_t ret_value;

FUNC_ENTER(NULL);

Expand All @@ -46,14 +46,21 @@ PDCobj_create_mpi(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, in
else
ret_value = PDC_obj_create(cont_id, obj_name, obj_prop_id, PDC_OBJ_LOCAL);

if (ret_value == 0)
PGOTO_ERROR(ret_value, "PDC_obj_create failed");

id_info = PDC_find_id(ret_value);
p = (struct _pdc_obj_info *)(id_info->obj_ptr);
if (id_info == NULL)
PGOTO_ERROR(0, "PDC_find_id failed for object id: %d", ret_value);

p = (struct _pdc_obj_info *)(id_info->obj_ptr);

MPI_Bcast(&(p->obj_info_pub->meta_id), 1, MPI_LONG_LONG, rank_id, comm);
MPI_Bcast(&(p->obj_info_pub->metadata_server_id), 1, MPI_UINT32_T, rank_id, comm);
MPI_Bcast(&(((pdc_metadata_t *)p->metadata)->data_server_id), 1, MPI_UINT32_T, rank_id, comm);
MPI_Bcast(&(((pdc_metadata_t *)p->metadata)->region_partition), 1, MPI_UINT8_T, rank_id, comm);

done:
FUNC_LEAVE(ret_value);
}

Expand Down
3 changes: 3 additions & 0 deletions src/tests/obj/read_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ main(int argc, char **argv)
if (global_obj <= 0) {
LOG_ERROR("Error creating an object [%s], exit...\n", obj_name);
ret_value = 1;
goto done;
}

offset = (uint64_t *)malloc(sizeof(uint64_t) * ndim);
Expand Down Expand Up @@ -293,6 +294,8 @@ main(int argc, char **argv)
LOG_ERROR("Failed to close PDC");
ret_value = 1;
}

done:
#ifdef ENABLE_MPI
MPI_Finalize();
#endif
Expand Down
Loading