Skip to content
Snippets Groups Projects
Commit a96ae277 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

dg : remove bug when compiled with HAVE_MPI=0

parent 34c7ead2
No related branches found
No related tags found
No related merge requests found
...@@ -302,7 +302,6 @@ class dofManager{ ...@@ -302,7 +302,6 @@ class dofManager{
inline void insertInSparsityPattern(const Dof &R, const Dof &C) inline void insertInSparsityPattern(const Dof &R, const Dof &C)
{ {
if (_isParallel && !_parallelFinalized) _parallelFinalize(); if (_isParallel && !_parallelFinalized) _parallelFinalize();
if (!_current->isAllocated()) _current->allocate(sizeOfR());
std::map<Dof, int>::iterator itR = unknown.find(R); std::map<Dof, int>::iterator itR = unknown.find(R);
if (itR != unknown.end()){ if (itR != unknown.end()){
std::map<Dof, int>::iterator itC = unknown.find(C); std::map<Dof, int>::iterator itC = unknown.find(C);
...@@ -568,11 +567,11 @@ class dofManager{ ...@@ -568,11 +567,11 @@ class dofManager{
template<class T> template<class T>
void dofManager<T>::_parallelFinalize() void dofManager<T>::_parallelFinalize()
{ {
_localSize = unknown.size();
#ifdef HAVE_MPI #ifdef HAVE_MPI
int _numStart; int _numStart;
int _numTotal; int _numTotal;
MPI_Status status; MPI_Status status;
_localSize = unknown.size();
if (Msg::GetCommRank() == 0){ if (Msg::GetCommRank() == 0){
_numStart = 0; _numStart = 0;
} }
...@@ -584,7 +583,6 @@ void dofManager<T>::_parallelFinalize() ...@@ -584,7 +583,6 @@ void dofManager<T>::_parallelFinalize()
MPI_Bcast(&_numTotal, 1, MPI_INT, Msg::GetCommSize()-1, MPI_COMM_WORLD); MPI_Bcast(&_numTotal, 1, MPI_INT, Msg::GetCommSize()-1, MPI_COMM_WORLD);
for (std::map <Dof, int> ::iterator it = unknown.begin(); it!= unknown.end(); it++) for (std::map <Dof, int> ::iterator it = unknown.begin(); it!= unknown.end(); it++)
it->second += _numStart; it->second += _numStart;
_parallelFinalized = true;
std::vector<std::list<Dof> > ghostedByProc; std::vector<std::list<Dof> > ghostedByProc;
int *nRequest = new int[Msg::GetCommSize()]; int *nRequest = new int[Msg::GetCommSize()];
int *nRequested = new int[Msg::GetCommSize()]; int *nRequested = new int[Msg::GetCommSize()];
...@@ -662,6 +660,7 @@ void dofManager<T>::_parallelFinalize() ...@@ -662,6 +660,7 @@ void dofManager<T>::_parallelFinalize()
delete [] reqSend1; delete [] reqSend1;
delete [] reqRecv0; delete [] reqRecv0;
#endif #endif
_parallelFinalized = true;
} }
#endif #endif
...@@ -135,7 +135,6 @@ void linearSystemPETScRegisterBindings(binding *b) ...@@ -135,7 +135,6 @@ void linearSystemPETScRegisterBindings(binding *b)
cm->setDescription ("A new PETScBlock<PetscScalar> solver"); cm->setDescription ("A new PETScBlock<PetscScalar> solver");
cb->setParentClass<linearSystem<fullMatrix<PetscScalar> > >(); cb->setParentClass<linearSystem<fullMatrix<PetscScalar> > >();
#endif // FIXME #endif // FIXME
} }
#endif // HAVE_PETSC #endif // HAVE_PETSC
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment