chiark / gitweb /
get rid of debugging for checking OUTER iteration; leave SIGINT handler and fix to...
authorIan Jackson <ian@turbine>
Tue, 7 Oct 2008 20:55:16 +0000 (21:55 +0100)
committerIan Jackson <ian@turbine>
Tue, 7 Oct 2008 20:55:16 +0000 (21:55 +0100)
energy.c
minimise.c
minimise.h

index a4cfbb1..c009067 100644 (file)
--- 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 <pthread.h>
-
 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);
index d52a685..3335209 100644 (file)
@@ -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) {
index cf450c2..c2e13e7 100644 (file)
@@ -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 <signal.h>
-extern sig_atomic_t quitting_reported_threads;
 
 enum printing_instance { pr_cost, pr_size, pr__max };
 int printing_check(enum printing_instance, int indent);