From 894cf0ab04227f28ce7fda66d493548e7ddd0728 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 6 Nov 2012 13:32:06 -0500 Subject: CarpetReduce: Use self-defined MPI operators for complex numbers Do not treat complex numbers as two real numbers. --- Carpet/CarpetReduce/src/reduce.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Carpet/CarpetReduce') diff --git a/Carpet/CarpetReduce/src/reduce.cc b/Carpet/CarpetReduce/src/reduce.cc index 0536d62a1..dc24111da 100644 --- a/Carpet/CarpetReduce/src/reduce.cc +++ b/Carpet/CarpetReduce/src/reduce.cc @@ -925,11 +925,10 @@ namespace CarpetReduce { const int vartypesize = CCTK_VarTypeSize(outtype); assert (vartypesize>=0); - const int mpilength = CarpetSimpleMPIDatatypeLength(outtype); char* const sendbuf = static_cast(const_cast(myoutvals)); const int bufsize = num_outvals * vartypesize; - const int mpicount = num_outvals * mpilength * (red->uses_cnt() ? 2 : 1); + const int mpicount = num_outvals * (1 + red->uses_cnt()); if (red->uses_cnt()) { if (not (sendbuf + bufsize == static_cast(mycounts))) { cerr << "sendbuf=" << (void*)sendbuf << endl @@ -938,7 +937,6 @@ namespace CarpetReduce { << "num_outvals=" << num_outvals << endl << "outtype=" << outtype << endl << "vartypesize=" << vartypesize << endl - << "mpilength=" << mpilength << endl << "mpicount=" << mpicount << endl; } assert (sendbuf + bufsize == static_cast(mycounts)); @@ -954,7 +952,7 @@ namespace CarpetReduce { } } - const MPI_Datatype mpitype = CarpetSimpleMPIDatatype(outtype); + const MPI_Datatype mpitype = CarpetMPIDatatype(outtype); if (proc == -1) { MPI_Allreduce (sendbuf, recvbuf, mpicount, mpitype, red->mpi_op(), CarpetMPIComm()); -- cgit v1.2.3