Skip to content

Commit c97a4b2

Browse files
committed
Final commit for co_bcast derived-type
1 parent 0e95c66 commit c97a4b2

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/mpi/mpi_caf.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7127,9 +7127,10 @@ get_MPI_datatype(gfc_descriptor_t *desc, int char_len)
71277127
return string;
71287128
}
71297129

7130-
caf_runtime_error("Unsupported data type in collective: %zd\n",
7131-
GFC_DTYPE_TYPE_SIZE(desc));
7132-
return 0;
7130+
return MPI_BYTE;
7131+
/* caf_runtime_error("Unsupported data type in collective: %zd\n", */
7132+
/* GFC_DTYPE_TYPE_SIZE(desc)); */
7133+
/* return 0; */
71337134
}
71347135

71357136

@@ -7253,9 +7254,17 @@ PREFIX(co_broadcast) (gfc_descriptor_t *a, int source_image, int *stat,
72537254
size *= dimextent;
72547255
}
72557256

7257+
printf("DTYPE Size: %d\n",GFC_DESCRIPTOR_SIZE(a));
7258+
72567259
if (rank == 0)
72577260
{
7258-
if (datatype != MPI_CHARACTER)
7261+
if( datatype == MPI_BYTE)
7262+
{
7263+
ierr = MPI_Bcast(a->base_addr, size*GFC_DESCRIPTOR_SIZE(a),
7264+
datatype, source_image - 1,
7265+
CAF_COMM_WORLD); chk_err(ierr);
7266+
}
7267+
else if (datatype != MPI_CHARACTER)
72597268
{
72607269
ierr = MPI_Bcast(a->base_addr, size, datatype, source_image - 1,
72617270
CAF_COMM_WORLD); chk_err(ierr);

0 commit comments

Comments
 (0)