Loading drivers/testParallelizer2.cpp +1 −0 Original line number Diff line number Diff line #include "Parallelizer2.h" #include "Vector.h" #include "LoadBalancerWeights.h" int main(int argc, char** argv) { Loading src/LoadBalancerWeights.h +4 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,10 @@ public: typedef PsimagLite::Vector<SizeType>::Type VectorSizeType; LoadBalancerWeights(SizeType ntasks, SizeType nthreads) : LoadBalancerWeights(VectorSizeType(ntasks, 1), nthreads) // ctor delegation {} LoadBalancerWeights(const VectorSizeType& weights, SizeType nthreads) : taskNumber_(nthreads) { Loading src/Parallelizer2Pthread.h +6 −6 Original line number Diff line number Diff line Loading @@ -40,11 +40,11 @@ struct PthreadFunctionStruct { SizeType cpu; }; template<typename SomeLambdaType> template<typename SomeLambdaType, typename SomeLoadBalancer> void *thread_function_wrapper(void *dummyPtr) { PthreadFunctionStruct<SomeLambdaType> *pfs = static_cast<PthreadFunctionStruct<SomeLambdaType> *>(dummyPtr); PthreadFunctionStruct<SomeLambdaType, SomeLoadBalancer> *pfs = static_cast<PthreadFunctionStruct<SomeLambdaType, SomeLoadBalancer> *>(dummyPtr); const SomeLambdaType* pfh = pfs->pfh; Loading Loading @@ -111,8 +111,8 @@ public: const SomeLambdaType& lambda, const LoadBalancerType& loadBalancer) { PthreadFunctionStruct<SomeLambdaType>* pfs = new PthreadFunctionStruct<SomeLambdaType>[nthreads_]; PthreadFunctionStruct<SomeLambdaType, LoadBalancerType>* pfs = new PthreadFunctionStruct<SomeLambdaType, LoadBalancerType>[nthreads_]; pthread_t* thread_id = new pthread_t[nthreads_]; pthread_attr_t** attr = new pthread_attr_t*[nthreads_]; Loading @@ -131,7 +131,7 @@ public: ret = pthread_create(&thread_id[j], attr[j], thread_function_wrapper<SomeLambdaType>, thread_function_wrapper<SomeLambdaType, LoadBalancerType>, &pfs[j]); checkForError(ret); } Loading Loading
drivers/testParallelizer2.cpp +1 −0 Original line number Diff line number Diff line #include "Parallelizer2.h" #include "Vector.h" #include "LoadBalancerWeights.h" int main(int argc, char** argv) { Loading
src/LoadBalancerWeights.h +4 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,10 @@ public: typedef PsimagLite::Vector<SizeType>::Type VectorSizeType; LoadBalancerWeights(SizeType ntasks, SizeType nthreads) : LoadBalancerWeights(VectorSizeType(ntasks, 1), nthreads) // ctor delegation {} LoadBalancerWeights(const VectorSizeType& weights, SizeType nthreads) : taskNumber_(nthreads) { Loading
src/Parallelizer2Pthread.h +6 −6 Original line number Diff line number Diff line Loading @@ -40,11 +40,11 @@ struct PthreadFunctionStruct { SizeType cpu; }; template<typename SomeLambdaType> template<typename SomeLambdaType, typename SomeLoadBalancer> void *thread_function_wrapper(void *dummyPtr) { PthreadFunctionStruct<SomeLambdaType> *pfs = static_cast<PthreadFunctionStruct<SomeLambdaType> *>(dummyPtr); PthreadFunctionStruct<SomeLambdaType, SomeLoadBalancer> *pfs = static_cast<PthreadFunctionStruct<SomeLambdaType, SomeLoadBalancer> *>(dummyPtr); const SomeLambdaType* pfh = pfs->pfh; Loading Loading @@ -111,8 +111,8 @@ public: const SomeLambdaType& lambda, const LoadBalancerType& loadBalancer) { PthreadFunctionStruct<SomeLambdaType>* pfs = new PthreadFunctionStruct<SomeLambdaType>[nthreads_]; PthreadFunctionStruct<SomeLambdaType, LoadBalancerType>* pfs = new PthreadFunctionStruct<SomeLambdaType, LoadBalancerType>[nthreads_]; pthread_t* thread_id = new pthread_t[nthreads_]; pthread_attr_t** attr = new pthread_attr_t*[nthreads_]; Loading @@ -131,7 +131,7 @@ public: ret = pthread_create(&thread_id[j], attr[j], thread_function_wrapper<SomeLambdaType>, thread_function_wrapper<SomeLambdaType, LoadBalancerType>, &pfs[j]); checkForError(ret); } Loading