From 917b529b807f7f0db69f6163d497d23ae4889cda Mon Sep 17 00:00:00 2001 From: Alexis Breust Date: Fri, 12 Jul 2019 10:52:02 +0200 Subject: [PATCH] Fixed test-det with --enable-mpi --- linbox/algorithms/cra-distributed.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/linbox/algorithms/cra-distributed.h b/linbox/algorithms/cra-distributed.h index faa713101e..746914cd69 100644 --- a/linbox/algorithms/cra-distributed.h +++ b/linbox/algorithms/cra-distributed.h @@ -63,7 +63,7 @@ namespace LinBox { , _pCommunicator(c) , _hadamardLogBound(b) { - if (c->size() > 0) { + if (c && c->size() > 1) { _workerHadamardLogBound = _hadamardLogBound / (c->size() - 1); } } @@ -147,8 +147,8 @@ namespace LinBox { } } - template - void worker_compute(PrimeIterator& gen, Function& Iteration, Vect& r) + template + void worker_compute(PrimeIterator& gen, Function& Iteration, Any& r) { // Process mutual independent prime number generation ++gen; @@ -160,8 +160,8 @@ namespace LinBox { Iteration(r, D); } - template - void worker_process_task(Function& Iteration, Vect& r) + template + void worker_process_task(Function& Iteration, Any& r) { MaskedPrimeGenerator gen(_pCommunicator->rank() - 1, _pCommunicator->size() - 1); @@ -173,15 +173,15 @@ namespace LinBox { uint64_t p = *gen; primesLogSum += Givaro::logtwo(p); _pCommunicator->send(p, 0); - _pCommunicator->send(r.begin(), r.end(), 0, 0); + _pCommunicator->send(r, 0); } uint64_t poisonPill = 0; _pCommunicator->send(poisonPill, 0); } - template - void master_process_task(Function& Iteration, Domain& D, Vect& r) + template + void master_process_task(Function& Iteration, Domain& D, Any& r) { Iteration(r, D); Builder_.initialize(D, r); @@ -197,7 +197,7 @@ namespace LinBox { } // Receive result vector and update builder - _pCommunicator->recv(r.begin(), r.end(), _pCommunicator->status().MPI_SOURCE, 0); + _pCommunicator->recv(r, _pCommunicator->status().MPI_SOURCE); Domain D(p); Builder_.progress(D, r);