aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetReduce
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2012-11-06 13:32:06 -0500
committerErik Schnetter <schnetter@gmail.com>2012-11-06 13:32:06 -0500
commit894cf0ab04227f28ce7fda66d493548e7ddd0728 (patch)
tree839284ac6ccc775e1c7e46ce01f49ccde8ec9094 /Carpet/CarpetReduce
parenta7dddc39ff55149de8aac0e508a456f21739927e (diff)
CarpetReduce: Use self-defined MPI operators for complex numbers
Do not treat complex numbers as two real numbers.
Diffstat (limited to 'Carpet/CarpetReduce')
-rw-r--r--Carpet/CarpetReduce/src/reduce.cc6
1 files changed, 2 insertions, 4 deletions
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<char*>(const_cast<void*>(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<const char*>(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<const char*>(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());