Skip to content
Snippets Groups Projects
Commit bee3cb13 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

skip remaining operations if exception is raised during a #pragma omp for

parent be0a5da9
No related branches found
No related tags found
No related merge requests found
...@@ -2851,6 +2851,7 @@ int GModel::_writePartitionedMSH4(const std::string &baseName, double version, ...@@ -2851,6 +2851,7 @@ int GModel::_writePartitionedMSH4(const std::string &baseName, double version,
bool exceptions = false; bool exceptions = false;
#pragma omp parallel for num_threads(nthreads) #pragma omp parallel for num_threads(nthreads)
for(std::size_t part = 1; part <= getNumPartitions(); part++) { for(std::size_t part = 1; part <= getNumPartitions(); part++) {
if(exceptions) continue;
std::ostringstream sstream; std::ostringstream sstream;
sstream << baseName << "_" << part << ".msh"; sstream << baseName << "_" << part << ".msh";
if(getNumPartitions() > 100) { if(getNumPartitions() > 100) {
......
...@@ -383,6 +383,7 @@ static void Mesh1D(GModel *m) ...@@ -383,6 +383,7 @@ static void Mesh1D(GModel *m)
bool exceptions = false; bool exceptions = false;
#pragma omp parallel for schedule(dynamic) num_threads(nthreads) #pragma omp parallel for schedule(dynamic) num_threads(nthreads)
for(size_t K = 0; K < temp.size(); K++) { for(size_t K = 0; K < temp.size(); K++) {
if(exceptions) continue;
int localPending = 0; int localPending = 0;
GEdge *ed = temp[K]; GEdge *ed = temp[K];
if(ed->meshStatistics.status == GEdge::PENDING) { if(ed->meshStatistics.status == GEdge::PENDING) {
...@@ -538,6 +539,7 @@ static void Mesh2D(GModel *m) ...@@ -538,6 +539,7 @@ static void Mesh2D(GModel *m)
temp.insert(temp.begin(), f.begin(), f.end()); temp.insert(temp.begin(), f.begin(), f.end());
#pragma omp parallel for schedule(dynamic) num_threads(nthreads) #pragma omp parallel for schedule(dynamic) num_threads(nthreads)
for(size_t K = 0; K < temp.size(); K++) { for(size_t K = 0; K < temp.size(); K++) {
if(exceptions) continue;
int localPending = 0; int localPending = 0;
if(temp[K]->meshStatistics.status == GFace::PENDING) { if(temp[K]->meshStatistics.status == GFace::PENDING) {
backgroundMesh::current()->unset(); backgroundMesh::current()->unset();
......
...@@ -59,6 +59,7 @@ static HXTStatus nodalSizesCallBack(double *pts, uint32_t *volume, ...@@ -59,6 +59,7 @@ static HXTStatus nodalSizesCallBack(double *pts, uint32_t *volume,
bool exceptions = false; bool exceptions = false;
#pragma omp parallel for schedule(dynamic) num_threads(nthreads) #pragma omp parallel for schedule(dynamic) num_threads(nthreads)
for(size_t i = 0; i < numPts; i++) { for(size_t i = 0; i < numPts; i++) {
if(exceptions) continue;
if(volume[i] < 0 || volume[i] >= allGR->size()) { if(volume[i] < 0 || volume[i] >= allGR->size()) {
Msg::Error("Invalid volume tag %d in mesh size calculation", volume[i]); Msg::Error("Invalid volume tag %d in mesh size calculation", volume[i]);
continue; continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment