From ad8f9959ed7e147b88a57a7634c78faa69cefc6a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 7 Oct 2008 21:55:16 +0100 Subject: [PATCH] get rid of debugging for checking OUTER iteration; leave SIGINT handler and fix to OUTER --- energy.c | 19 ------------------- minimise.c | 9 ++------- minimise.h | 4 ---- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/energy.c b/energy.c index a4cfbb1..c009067 100644 --- a/energy.c +++ b/energy.c @@ -174,8 +174,6 @@ void compute_edge_lengths(const Vertices vertices, int section) { edge_lengths[v1][e]= hypotD(vertices[v1],vertices[v2]); } -#include - void compute_vertex_areas(const Vertices vertices, int section) { int v0,v1,v2, e1,e2; // int k; @@ -250,24 +248,7 @@ double line_bending_cost(const Vertices vertices, int section) { double a[D3], b[D3], axb[D3]; double total_cost= 0; - if (quitting_last_iteration) { - char buf[100]; - int n= sprintf(buf, - "section=%d thr=%#08lx qi=0x%03x START\n", - section,(unsigned long)pthread_self(), N); - write(2,buf,n); - quitting_reported_threads= 1; - } - FOR_EDGE(qi,e,ri, OUTER) { - if (quitting_last_iteration) { - char buf[100]; - int n= sprintf(buf, - "section=%d thr=%#08lx qi=0x%03x,e=%d,ri=0x%03x\n", - section,(unsigned long)pthread_self(),qi,e,ri); - write(2,buf,n); - } - pi= EDGE_END2(qi,(e+3)%V6); if (pi<0) continue; //if (!(qi&XMASK)) fprintf(stderr,"%02x-%02x-%02x (%d)\n",pi,qi,ri,e); diff --git a/minimise.c b/minimise.c index d52a685..3335209 100644 --- a/minimise.c +++ b/minimise.c @@ -63,8 +63,6 @@ static void badusage(void) { } static sig_atomic_t quit_requested; -sig_atomic_t quitting_reported_threads; -int quitting_last_iteration; static void sigint_handler(int ignored) { quit_requested= 1; @@ -140,8 +138,8 @@ int main(int argc, const char *const *argv) { for (;;) { if (quit_requested) { - fprintf(stderr,"SIGINT caught, quitting soon.\n"); - quitting_last_iteration= 1; + fprintf(stderr,"SIGINT caught.\n"); + break; } GA( gsl_multimin_fminimizer_iterate(minimiser) ); @@ -157,9 +155,6 @@ int main(int argc, const char *const *argv) { if (r==GSL_SUCCESS) break; assert(r==GSL_CONTINUE); } - - if (quitting_reported_threads) - exit(1); } if (final_file) { diff --git a/minimise.h b/minimise.h index cf450c2..c2e13e7 100644 --- a/minimise.h +++ b/minimise.h @@ -31,10 +31,6 @@ extern const char *input_file, *best_file; extern char *best_file_tmp; extern long long evaluations; extern double stop_epsilon; -extern int quitting_last_iteration; - -#include -extern sig_atomic_t quitting_reported_threads; enum printing_instance { pr_cost, pr_size, pr__max }; int printing_check(enum printing_instance, int indent); -- 2.30.2