49 if (nbytes ==
sizeof(
float)) {
51 MPI_Allreduce(buf_d,
buf, count, MPI_FLOAT, MPI_SUM,
NEKO_COMM);
53 MPI_Allreduce(buf_d,
buf, count, MPI_FLOAT, MPI_MAX,
NEKO_COMM);
55 fprintf(stderr, __FILE__
": Invalid reduction op)\n");
59 else if (nbytes ==
sizeof(
double)) {
61 MPI_Allreduce(buf_d,
buf, count, MPI_DOUBLE, MPI_SUM,
NEKO_COMM);
63 MPI_Allreduce(buf_d,
buf, count, MPI_DOUBLE, MPI_MAX,
NEKO_COMM);
65 fprintf(stderr, __FILE__
": Invalid reduction op)\n");
70 fprintf(stderr, __FILE__
": Invalid data type)\n");
77 if (nbytes ==
sizeof(
float)) {
79 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
82 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
85 fprintf(stderr, __FILE__
": Invalid reduction op)\n");
89 else if (nbytes ==
sizeof(
double)) {
91 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
94 MPI_Allreduce(MPI_IN_PLACE, buf_d, count,
98 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)