48 if (nbytes ==
sizeof(
float)) {
50 MPI_Allreduce(buf_d,
buf, count, MPI_FLOAT, MPI_SUM,
NEKO_COMM);
52 MPI_Allreduce(buf_d,
buf, count, MPI_FLOAT, MPI_MAX,
NEKO_COMM);
54 fprintf(stderr, __FILE__
": Invalid reduction op)\n");
58 else if (nbytes ==
sizeof(
double)) {
60 MPI_Allreduce(buf_d,
buf, count, MPI_DOUBLE, MPI_SUM,
NEKO_COMM);
62 MPI_Allreduce(buf_d,
buf, count, MPI_DOUBLE, MPI_MAX,
NEKO_COMM);
64 fprintf(stderr, __FILE__
": Invalid reduction op)\n");
69 fprintf(stderr, __FILE__
": Invalid data type)\n");
76 if (nbytes ==
sizeof(
float)) {
78 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
81 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
84 fprintf(stderr, __FILE__
": Invalid reduction op)\n");
88 else if (nbytes ==
sizeof(
double)) {
90 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
93 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
97 fprintf(stderr, __FILE__
": Invalid data type)\n");
void device_mpi_allreduce(void *buf_d, void *buf, int count, int nbytes, int op)
void device_mpi_allreduce_inplace(void *buf_d, int count, int nbytes, int op)