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 a4cfbb1491221f90b4e454105e8e04473ed89f99..c0090677b40f43c4cb09da43b36412741a06c63d 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 d52a685385b11c81e39e03eaa97819591f41823d..333520942268a44ab95fe3947b991d73c8e89ff1 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 cf450c248781d203d6b7fc58bd63ddea4135110d..c2e13e7b40fef83169495c5b2754fc91333c90d1 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);