From: wolf Date: Fri, 24 Aug 2001 13:34:09 +0000 (+0000) Subject: Fix a rather rare race condition in MT mode: we checked that we did X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50a07b1e89f75e62c91100cdd3e2570eb7dc2e18;p=dealii-svn.git Fix a rather rare race condition in MT mode: we checked that we did not yet visit a face by looking at a value that is written when visiting this face. We double checked later when writing into it. In some rare conditions, it could happen that another process was working on it, but only wrote between the two checks, making the latter fail. git-svn-id: https://svn.dealii.org/trunk@4908 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/error_estimator.cc b/deal.II/deal.II/source/numerics/error_estimator.cc index 65f5602e62..c9efeaa25d 100644 --- a/deal.II/deal.II/source/numerics/error_estimator.cc +++ b/deal.II/deal.II/source/numerics/error_estimator.cc @@ -475,6 +475,26 @@ void KellyErrorEstimator::estimate_some (Data &data, // loop over all faces of this cell for (unsigned int face_no=0; face_no::faces_per_cell; ++face_no) { + // make sure we do work + // only once: this face + // may either be regular + // or irregular. if it is + // regular and has a + // neighbor, then we + // visit the face twice, + // once from every + // side. let the one with + // the lower index do the + // work. if it is at the + // boundary, or if the + // face is irregular, + // then do the work below + if ((cell->face(face_no)->has_children() == false) && + !cell->at_boundary(face_no) && + (cell->neighbor(face_no)->level() == cell->level()) && + (cell->neighbor(face_no)->index() < cell->index())) + continue; + // if we already visited // this face: do // nothing. only check