Loading drivers/loadImbalance.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ Please see full open source license included in file LICENSE. #include <cstdlib> #define USE_PTHREADS_OR_NOT_NG #include "Parallelizer.h" #include "LoadBalancerWeights.h" class MyHelper { Loading Loading @@ -74,7 +75,6 @@ int main(int argc,char *argv[]) { typedef PsimagLite::Concurrency ConcurrencyType; if (argc!=3) { std::cout<<"USAGE: "<<argv[0]<<" nthreads ntasks\n"; return 1; Loading @@ -86,7 +86,7 @@ int main(int argc,char *argv[]) ConcurrencyType concurrency(&argc,&argv,nthreads); typedef MyHelper HelperType; typedef PsimagLite::Parallelizer<HelperType> ParallelizerType; typedef PsimagLite::Parallelizer<HelperType, PsimagLite::LoadBalancerWeights> ParallelizerType; ParallelizerType threadObject(ConcurrencyType::codeSectionParams); HelperType helper(ntasks, nthreads); Loading src/LoadBalancerDefault.h +5 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,11 @@ public: LoadBalancerDefault(SizeType ntasks, SizeType nthreads) : blockSize_(ntasks/nthreads) { if (ntasks < nthreads) { nthreads = ntasks; blockSize_ = 1; } if ((ntasks % nthreads) != 0) ++blockSize_; } Loading src/LoadBalancerWeights.h +2 −1 Original line number Diff line number Diff line Loading @@ -18,8 +18,9 @@ public: LoadBalancerWeights(const VectorSizeType& weights, SizeType nthreads) : taskNumber_(nthreads) { VectorSizeType workLoad(nthreads, 0); SizeType ntasks = weights.size(); if (ntasks < nthreads) nthreads = ntasks; VectorSizeType workLoad(nthreads, 0); VectorSizeType weights2 = weights; VectorSizeType iperm(ntasks, 0); Sort<VectorSizeType> sort; Loading src/PthreadsNg.h +1 −1 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ public: String name() const { return "PthreadsNg"; } SizeType threads() const { return nthreads_; } //SizeType threads() const { return nthreads_; } SizeType mpiProcs() const { return 1; } Loading Loading
drivers/loadImbalance.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ Please see full open source license included in file LICENSE. #include <cstdlib> #define USE_PTHREADS_OR_NOT_NG #include "Parallelizer.h" #include "LoadBalancerWeights.h" class MyHelper { Loading Loading @@ -74,7 +75,6 @@ int main(int argc,char *argv[]) { typedef PsimagLite::Concurrency ConcurrencyType; if (argc!=3) { std::cout<<"USAGE: "<<argv[0]<<" nthreads ntasks\n"; return 1; Loading @@ -86,7 +86,7 @@ int main(int argc,char *argv[]) ConcurrencyType concurrency(&argc,&argv,nthreads); typedef MyHelper HelperType; typedef PsimagLite::Parallelizer<HelperType> ParallelizerType; typedef PsimagLite::Parallelizer<HelperType, PsimagLite::LoadBalancerWeights> ParallelizerType; ParallelizerType threadObject(ConcurrencyType::codeSectionParams); HelperType helper(ntasks, nthreads); Loading
src/LoadBalancerDefault.h +5 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,11 @@ public: LoadBalancerDefault(SizeType ntasks, SizeType nthreads) : blockSize_(ntasks/nthreads) { if (ntasks < nthreads) { nthreads = ntasks; blockSize_ = 1; } if ((ntasks % nthreads) != 0) ++blockSize_; } Loading
src/LoadBalancerWeights.h +2 −1 Original line number Diff line number Diff line Loading @@ -18,8 +18,9 @@ public: LoadBalancerWeights(const VectorSizeType& weights, SizeType nthreads) : taskNumber_(nthreads) { VectorSizeType workLoad(nthreads, 0); SizeType ntasks = weights.size(); if (ntasks < nthreads) nthreads = ntasks; VectorSizeType workLoad(nthreads, 0); VectorSizeType weights2 = weights; VectorSizeType iperm(ntasks, 0); Sort<VectorSizeType> sort; Loading
src/PthreadsNg.h +1 −1 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ public: String name() const { return "PthreadsNg"; } SizeType threads() const { return nthreads_; } //SizeType threads() const { return nthreads_; } SizeType mpiProcs() const { return 1; } Loading