Skip to content

Commit 471a838

Browse files
committed
Fixed test-det with --enable-mpi
1 parent f9ef2c7 commit 471a838

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

linbox/algorithms/cra-distributed.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace LinBox {
6363
, _pCommunicator(c)
6464
, _hadamardLogBound(b)
6565
{
66-
if (c->size() > 0) {
66+
if (c && c->size() > 0) {
6767
_workerHadamardLogBound = _hadamardLogBound / (c->size() - 1);
6868
}
6969
}
@@ -147,8 +147,8 @@ namespace LinBox {
147147
}
148148
}
149149

150-
template <class Vect, class PrimeIterator, class Function>
151-
void worker_compute(PrimeIterator& gen, Function& Iteration, Vect& r)
150+
template <class Any, class PrimeIterator, class Function>
151+
void worker_compute(PrimeIterator& gen, Function& Iteration, Any& r)
152152
{
153153
// Process mutual independent prime number generation
154154
++gen;
@@ -160,8 +160,8 @@ namespace LinBox {
160160
Iteration(r, D);
161161
}
162162

163-
template <class Vect, class Function>
164-
void worker_process_task(Function& Iteration, Vect& r)
163+
template <class Any, class Function>
164+
void worker_process_task(Function& Iteration, Any& r)
165165
{
166166
MaskedPrimeGenerator gen(_pCommunicator->rank() - 1, _pCommunicator->size() - 1);
167167

@@ -173,15 +173,15 @@ namespace LinBox {
173173
uint64_t p = *gen;
174174
primesLogSum += Givaro::logtwo(p);
175175
_pCommunicator->send(p, 0);
176-
_pCommunicator->send(r.begin(), r.end(), 0, 0);
176+
_pCommunicator->send(r, 0);
177177
}
178178

179179
uint64_t poisonPill = 0;
180180
_pCommunicator->send(poisonPill, 0);
181181
}
182182

183-
template <class Vect, class Function>
184-
void master_process_task(Function& Iteration, Domain& D, Vect& r)
183+
template <class Any, class Function>
184+
void master_process_task(Function& Iteration, Domain& D, Any& r)
185185
{
186186
Iteration(r, D);
187187
Builder_.initialize(D, r);
@@ -197,7 +197,7 @@ namespace LinBox {
197197
}
198198

199199
// Receive result vector and update builder
200-
_pCommunicator->recv(r.begin(), r.end(), _pCommunicator->status().MPI_SOURCE, 0);
200+
_pCommunicator->recv(r, _pCommunicator->status().MPI_SOURCE);
201201

202202
Domain D(p);
203203
Builder_.progress(D, r);

0 commit comments

Comments
 (0)