From d6b64f47d9981b3a88d85347e7ee7c3afcbe834c Mon Sep 17 00:00:00 2001 From: paboyle Date: Wed, 16 Mar 2016 02:27:22 -0700 Subject: [PATCH] Uint64 sum for IO rates --- lib/communicator/Communicator_base.h | 1 + lib/communicator/Communicator_none.cc | 1 + lib/communicator/Communicator_shmem.cc | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/lib/communicator/Communicator_base.h b/lib/communicator/Communicator_base.h index 76a6a2f8..94d277e9 100644 --- a/lib/communicator/Communicator_base.h +++ b/lib/communicator/Communicator_base.h @@ -86,6 +86,7 @@ class CartesianCommunicator { void GlobalSumVector(RealD *,int N); void GlobalSum(uint32_t &); + void GlobalSum(uint64_t &); void GlobalSum(ComplexF &c) { diff --git a/lib/communicator/Communicator_none.cc b/lib/communicator/Communicator_none.cc index ad0eb613..8601255a 100644 --- a/lib/communicator/Communicator_none.cc +++ b/lib/communicator/Communicator_none.cc @@ -53,6 +53,7 @@ void CartesianCommunicator::GlobalSum(float &){} void CartesianCommunicator::GlobalSumVector(float *,int N){} void CartesianCommunicator::GlobalSum(double &){} void CartesianCommunicator::GlobalSum(uint32_t &){} +void CartesianCommunicator::GlobalSum(uint64_t &){} void CartesianCommunicator::GlobalSumVector(double *,int N){} void CartesianCommunicator::SendRecvPacket(void *xmit, diff --git a/lib/communicator/Communicator_shmem.cc b/lib/communicator/Communicator_shmem.cc index 8db5fcf1..091e266e 100644 --- a/lib/communicator/Communicator_shmem.cc +++ b/lib/communicator/Communicator_shmem.cc @@ -101,6 +101,22 @@ void CartesianCommunicator::GlobalSum(uint32_t &u){ shmem_barrier_all(); // necessary? u = dest; } +void CartesianCommunicator::GlobalSum(uint64_t &u){ + static long long source ; + static long long dest ; + static long long llwrk[_SHMEM_REDUCE_MIN_WRKDATA_SIZE]; + static long psync[_SHMEM_REDUCE_SYNC_SIZE]; + + // int nreduce=1; + // int pestart=0; + // int logStride=0; + + source = u; + dest = 0; + shmem_longlong_sum_to_all(&dest,&source,1,0,0,_Nprocessors,llwrk,psync); + shmem_barrier_all(); // necessary? + u = dest; +} void CartesianCommunicator::GlobalSum(float &f){ static float source ; static float dest ;