Commit 3d207532 authored by Leo Pound Singer's avatar Leo Pound Singer

bayestar_plot_volume: play nice with ctrl-C

Original: 30d976610f86eb4edeb13784325d897f8d69d2d0
parent 2dd1f5ca
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#include <lal/bayestar_distance.h> #include <lal/bayestar_distance.h>
#include "six.h" #include "six.h"
#include "omp_interruptible.h"
static void conditional_pdf_loop( static void conditional_pdf_loop(
...@@ -165,9 +166,12 @@ static void volume_render_loop( ...@@ -165,9 +166,12 @@ static void volume_render_loop(
/* FIXME: Check that array arguments are stored contiguously */ /* FIXME: Check that array arguments are stored contiguously */
OMP_BEGIN_INTERRUPTIBLE
#pragma omp parallel for #pragma omp parallel for
for (npy_intp i = 0; i < n; i ++) for (npy_intp i = 0; i < n; i ++)
{ {
if (OMP_WAS_INTERRUPTED)
OMP_EXIT_LOOP_EARLY
/* FIXME: args must be void ** to avoid alignment warnings */ /* FIXME: args must be void ** to avoid alignment warnings */
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align" #pragma GCC diagnostic ignored "-Wcast-align"
...@@ -186,6 +190,7 @@ static void volume_render_loop( ...@@ -186,6 +190,7 @@ static void volume_render_loop(
(double *) &args[10][i * steps[10]]); (double *) &args[10][i * steps[10]]);
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
} }
OMP_END_INTERRUPTIBLE
gsl_set_error_handler(old_handler); gsl_set_error_handler(old_handler);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment