IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38617


Ignore:
Timestamp:
Jul 22, 2015, 5:52:34 PM (11 years ago)
Author:
eugene
Message:

protect the catalog I/O layer from signals which can be blocked (ie, allow kill to kill gracefully)

Location:
branches/eam_branches/ipp-20150625/Ohana/src/uniphot
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/Makefile

    r38464 r38617  
    7878$(SRC)/update_catalog_setphot.$(ARCH).o \
    7979$(SRC)/initialize_setphot_client.$(ARCH).o \
     80$(SRC)/SetSignals.$(ARCH).o         \
     81$(SRC)/Shutdown.$(ARCH).o           \
    8082$(SRC)/ImageSubset.$(ARCH).o
    8183
     
    136138$(SRC)/repair_tycho_setastrom.$(ARCH).o \
    137139$(SRC)/astrom_correction.$(ARCH).o \
     140$(SRC)/SetSignals.$(ARCH).o         \
     141$(SRC)/Shutdown.$(ARCH).o           \
    138142$(SRC)/initialize_setastrom.$(ARCH).o
    139143
     
    158162$(SRC)/update_catalog_setgalmodel.$(ARCH).o \
    159163$(SRC)/galmodel_correction.$(ARCH).o \
     164$(SRC)/SetSignals.$(ARCH).o         \
     165$(SRC)/Shutdown.$(ARCH).o           \
    160166$(SRC)/initialize_setgalmodel.$(ARCH).o
    161167
     
    234240$(SRC)/initialize_ckids.$(ARCH).o     \
    235241$(SRC)/update_dvo_ckids.$(ARCH).o     \
     242$(SRC)/SetSignals.$(ARCH).o         \
     243$(SRC)/Shutdown.$(ARCH).o           \
    236244$(SRC)/update_catalog_ckids.$(ARCH).o
    237245
     
    243251$(SRC)/initialize_ckids.$(ARCH).o     \
    244252$(SRC)/update_dvo_ckids.$(ARCH).o     \
     253$(SRC)/SetSignals.$(ARCH).o         \
     254$(SRC)/Shutdown.$(ARCH).o           \
    245255$(SRC)/update_catalog_ckids.$(ARCH).o
    246256
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/include/ckids.h

    r38592 r38617  
    3434                                                   
    3535void          update_catalog_ckids              PROTO((Catalog *catalog, FILE *foutput));
     36
     37int           Shutdown                        PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2) );
     38void          TrapSignal                      PROTO((int sig));
     39void          SetProtect                      PROTO((int mode));
     40int           SetSignals                      PROTO((void));
     41
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/include/setastrom.h

    r38592 r38617  
    7272int           args_setastrom_client           PROTO((int argc, char **argv));
    7373
    74 // int           Shutdown                        PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2) );
    75 // void          TrapSignal                      PROTO((int sig));
    76 // void          SetProtect                      PROTO((int mode));
    77 // int           SetSignals                      PROTO((void));
     74int           Shutdown                        PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2) );
     75void          TrapSignal                      PROTO((int sig));
     76void          SetProtect                      PROTO((int mode));
     77int           SetSignals                      PROTO((void));
    7878
    7979int           update_dvo_setastrom            PROTO((void));
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/include/setgalmodel.h

    r38592 r38617  
    3434int           args_setgalmodel_client           PROTO((int argc, char **argv));
    3535
    36 // int           Shutdown                        PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2) );
    37 // void          TrapSignal                      PROTO((int sig));
    38 // void          SetProtect                      PROTO((int mode));
    39 // int           SetSignals                      PROTO((void));
     36int           Shutdown                        PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2) );
     37void          TrapSignal                      PROTO((int sig));
     38void          SetProtect                      PROTO((int mode));
     39int           SetSignals                      PROTO((void));
    4040
    4141int           update_dvo_setgalmodel            PROTO((void));
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/Shutdown.c

    r27790 r38617  
    2121  va_end (argp);
    2222
    23   SetProtect (TRUE);
    24   gfits_db_close (db);
    2523  fprintf (stderr, "ERROR: halted\n");
    2624  exit (1);
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/ckids.c

    r35764 r38617  
    66
    77  /* get configuration info, args, lockfile */
     8  SetSignals ();
    89  initialize_ckids (argc, argv);
    910
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/ckids_client.c

    r35764 r38617  
    1212
    1313  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, IMAGES)
     14  SetSignals ();
    1415  initialize_ckids_client (argc, argv);
    1516
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/fiximids.c

    r38441 r38617  
    88
    99  /* get configuration info, args, lockfile */
     10  SetSignals ();
    1011  initialize_fiximids (argc, argv);
    1112
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/fiximids_client.c

    r35764 r38617  
    1313
    1414  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, IMAGES)
     15  SetSignals ();
    1516  initialize_fiximids_client (argc, argv);
    1617
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/fixstkids.c

    r38441 r38617  
    88
    99  /* get configuration info, args, lockfile */
     10  SetSignals ();
    1011  initialize_fixstkids (argc, argv);
    1112
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/fixstkids_client.c

    r35764 r38617  
    1313
    1414  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, IMAGES)
     15  SetSignals ();
    1516  initialize_fixstkids_client (argc, argv);
    1617
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setastrom.c

    r38464 r38617  
    66
    77  /* get configuration info, args, lockfile */
     8  SetSignals ();
    89  initialize_setastrom (argc, argv);
    910
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setastrom_client.c

    r38596 r38617  
    1313
    1414  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, IMAGES)
     15  SetSignals ();
    1516  initialize_setastrom_client (argc, argv);
    1617
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setfwhm.c

    r38441 r38617  
    1010
    1111  /* get configuration info, args, lockfile */
     12  SetSignals ();
    1213  initialize_setfwhm (argc, argv);
    1314
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setgalmodel.c

    r37807 r38617  
    66
    77  /* get configuration info, args, lockfile */
     8  SetSignals ();
    89  initialize_setgalmodel (argc, argv);
    910
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setgalmodel_client.c

    r37807 r38617  
    1313
    1414  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, IMAGES)
     15  SetSignals ();
    1516  initialize_setgalmodel_client (argc, argv);
    1617
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setphot.c

    r38464 r38617  
    1111
    1212  /* get configuration info, args, lockfile */
     13  SetSignals ();
    1314  initialize_setphot (argc, argv);
    1415
     
    5051  // write image table (even if some remote clients failed)
    5152  if (UPDATE) {
     53    SetProtect (TRUE);
    5254    dvo_image_save (&db, VERBOSE);
     55    SetProtect (FALSE);
    5356  }
    5457
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setphot_client.c

    r33654 r38617  
    1313
    1414  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, IMAGES)
     15  SetSignals ();
    1516  initialize_setphot_client (argc, argv);
    1617
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setposangle.c

    r38441 r38617  
    88
    99  /* get configuration info, args, lockfile */
     10  SetSignals ();
    1011  initialize_setposangle (argc, argv);
    1112
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/setposangle_client.c

    r34749 r38617  
    1313
    1414  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, IMAGES)
     15  SetSignals ();
    1516  initialize_setposangle_client (argc, argv);
    1617
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/uniphot.c

    r38441 r38617  
    1616
    1717  /* get configuration info, args, lockfile */
     18  SetSignals ();
    1819  initialize_uniphot (argc, argv);
    1920
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_ckids.c

    r38471 r38617  
    6969    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
    7070   
    71     dvo_catalog_save (&catalog, VERBOSE);
    72     dvo_catalog_unlock (&catalog);
     71    SetProtect (TRUE);
     72    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     73    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     74    SetProtect (FALSE);
    7375    dvo_catalog_free (&catalog);
    7476  }
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_fiximids.c

    r38471 r38617  
    6464    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
    6565   
    66     dvo_catalog_save (&catalog, VERBOSE);
    67     dvo_catalog_unlock (&catalog);
     66    SetProtect (TRUE);
     67    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     68    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     69    SetProtect (FALSE);
    6870    dvo_catalog_free (&catalog);
    6971  }
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_fixstkids.c

    r38471 r38617  
    6464    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
    6565   
    66     dvo_catalog_save (&catalog, VERBOSE);
    67     dvo_catalog_unlock (&catalog);
     66    SetProtect (TRUE);
     67    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     68    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     69    SetProtect (FALSE);
    6870    dvo_catalog_free (&catalog);
    6971  }
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_setastrom.c

    r38596 r38617  
    7474    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
    7575   
    76     dvo_catalog_save (&catalog, VERBOSE);
    77     dvo_catalog_unlock (&catalog);
     76    SetProtect (TRUE);
     77    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     78    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     79    SetProtect (FALSE);
    7880    dvo_catalog_free (&catalog);
    7981  }
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_setgalmodel.c

    r38471 r38617  
    6666    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
    6767   
    68     dvo_catalog_save (&catalog, VERBOSE);
    69     dvo_catalog_unlock (&catalog);
     68    SetProtect (TRUE);
     69    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     70    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     71    SetProtect (FALSE);
    7072    dvo_catalog_free (&catalog);
    7173  }
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_setphot.c

    r38615 r38617  
    7777    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
    7878   
    79     dvo_catalog_save (&catalog, VERBOSE);
    80     dvo_catalog_unlock (&catalog);
     79    SetProtect (TRUE);
     80    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     81    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     82    SetProtect (FALSE);
    8183    dvo_catalog_free (&catalog);
    8284  }
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_setposangle.c

    r38471 r38617  
    7878    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
    7979   
    80     dvo_catalog_save (&catalog, VERBOSE);
    81     dvo_catalog_unlock (&catalog);
     80    SetProtect (TRUE);
     81    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     82    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     83    SetProtect (FALSE);
    8284    dvo_catalog_free (&catalog);
    8385  }
  • branches/eam_branches/ipp-20150625/Ohana/src/uniphot/src/update_dvo_uniphot.c

    r38471 r38617  
    101101    fprintf (stderr, "catalog: %s sgroup: %d %s %f\n", catalog.filename, Nmin, sgroup[Nmin].label, Rmin);
    102102    update_catalog_uniphot (&catalog, &sgroup[Nmin], (Rmin > 2*RADIUS));
    103     dvo_catalog_save (&catalog, VERBOSE);
    104     dvo_catalog_unlock (&catalog);
     103    SetProtect (TRUE);
     104    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     105    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     106    SetProtect (FALSE);
    105107    dvo_catalog_free (&catalog);
    106108  }
Note: See TracChangeset for help on using the changeset viewer.