00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_VECTOR_SPACE_BASE_IMPL_HPP 00006 #define PLAYA_VECTOR_SPACE_BASE_IMPL_HPP 00007 00008 #include "PlayaVectorSpaceBaseDecl.hpp" 00009 #include "PlayaExceptions.hpp" 00010 #include "PlayaMPIContainerComm.hpp" 00011 #include "Teuchos_Array.hpp" 00012 00013 namespace Playa 00014 { 00015 00016 template <class Scalar> inline 00017 int VectorSpaceBase<Scalar>::accumulateBaseGNI() const 00018 { 00019 int nLocal = this->numLocalElements(); 00020 Teuchos::Array<int> sums; 00021 int total = 0; 00022 Playa::MPIContainerComm<int>::accumulate(nLocal, sums, 00023 total, this->comm()); 00024 int rank = this->comm().getRank(); 00025 return sums[rank]; 00026 } 00027 00028 00029 00030 00031 } 00032 00033 #endif