IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36545


Ignore:
Timestamp:
Feb 24, 2014, 1:51:48 PM (12 years ago)
Author:
eugene
Message:

relphot parallel basically works; need to test in more detail

Location:
branches/eam_branches/ipp-20140206/Ohana/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h

    r36533 r36545  
    416416  uint32_t       flags;
    417417  int            catID;
     418  int            objID;
    418419  int            nOwn;
    419420} AverageTiny;
  • branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c

    r36533 r36545  
    549549}
    550550
     551// XXX note that there are 2 bad versions of PS1_V4 : the other one does have have PSF_QF_PERFECT, but has PAD instead
    551552int gfits_convert_Measure_PS1_V4alt (Measure_PS1_V4alt *data, off_t size, off_t nitems) {
    552553
     
    708709# ifdef BYTE_SWAP
    709710  byte = (unsigned char *) data;
    710   for (i = 0; i < nitems; i++, byte += 129) {
     711  for (i = 0; i < nitems; i++, byte += 120) {
    711712    /** BYTE SWAP **/
    712713    SWAP_DBLE (0); // RA
     
    754755  Ncols = ftable[0].header[0].Naxis[0];
    755756  if (Ncols != 120) {
    756     fprintf (stderr, "ERROR: mis-match in table size: width is %d but should be %d bytes\n", Ncols, 176);
     757    fprintf (stderr, "ERROR: mis-match in table size: width is %d but should be %d bytes\n", Ncols, 120);
    757758    return NULL;
    758759  }
  • branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/dvo_tiny_values.c

    r35102 r36545  
    88  averageT[0].measureOffset = average[0].measureOffset;
    99  averageT[0].catID         = average[0].catID;
     10  averageT[0].objID         = average[0].objID;
     11  averageT[0].nOwn          = -1;
    1012  return;
    1113}
     
    3335  measureT[0].dYccd      = measure[0].dYccd;
    3436  measureT[0].dRsys      = measure[0].dRsys;
     37  measureT[0].myDet      = 0;
    3538  return ;
    3639}
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/Makefile

    r36518 r36545  
    5454$(SRC)/ImageTable.$(ARCH).o      \
    5555$(SRC)/ImageMagIO.$(ARCH).o      \
     56$(SRC)/syncfile.$(ARCH).o        \
    5657$(SRC)/share_image_mags.$(ARCH).o        \
    5758$(SRC)/share_mean_mags.$(ARCH).o         \
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/include/relphot.h

    r36535 r36545  
    477477int catID_and_objID_to_seq (int catID, int objID, int *catSeq, off_t *objSeq);
    478478
     479int check_sync_file (char *filename, int nloop);
     480int clear_sync_file (char *filename);
     481int update_sync_file (char *filename, int nloop);
     482char *make_filename (char *dirname, char *hostname, int hostID, char *tailname);
     483
    479484int share_mean_mags (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop);
    480485int slurp_mean_mags (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop);
    481 int check_sync_file (char *hostname, int nloop);
    482 int clear_sync_file (char *hostname);
    483 int update_sync_file (char *hostname, int nloop);
    484 int set_mean_mags (MeanMag *meanmags, Average *average, SecFilt *secfilt, int Nsec);
     486int set_mean_mags (MeanMag *meanmags, AverageTiny *average, SecFilt *secfilt, int Nsec);
    485487MeanMag *merge_mean_mags (MeanMag *target, int *ntarget, MeanMag *source, int Nsource);
    486488
     
    490492int share_image_mags (RegionHostTable *regionHosts, int nloop);
    491493int slurp_image_mags (RegionHostTable *regionHosts, int nloop);
    492 int check_imsync_file (char *hostname, int nloop);
    493 int update_imsync_file (char *hostname, int nloop);
    494 int clear_imsync_file (char *hostname);
    495494int set_image_mags (ImageMag *image_mags, Image *image);
    496495ImageMag *merge_image_mags (ImageMag *target, int *ntarget, ImageMag *source, int Nsource);
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/ImageMagIO.c

    r36519 r36545  
    119119  gfits_define_bintable_column (&theader, "E", "MCAL_SYSERR",    "systematic error", "magnitudes", 1.0, 0.0);
    120120  gfits_define_bintable_column (&theader, "E", "CHISQ",          "cal chisq", "unitless", 1.0, 0.0);
    121   gfits_define_bintable_column (&theader, "E", "NFIT",           "number of fitted stars", "unitless", 1.0, 0.0);
    122   gfits_define_bintable_column (&theader, "E", "FLAGS",          "analysis flags", "unitless", 1.0, 0.0);
    123   gfits_define_bintable_column (&theader, "E", "UDIST",          "distance to ubercal images", "images", 1.0, 0.0);
    124   gfits_define_bintable_column (&theader, "E", "ID",             "image ID", "unitless", 1.0, 0.0);
     121  gfits_define_bintable_column (&theader, "J", "NFIT",           "number of fitted stars", "unitless", 1.0, 0.0);
     122  gfits_define_bintable_column (&theader, "J", "FLAGS",          "analysis flags", "unitless", 1.0, 0.0);
     123  gfits_define_bintable_column (&theader, "J", "UDIST",          "distance to ubercal images", "images", 1.0, 0.0);
     124  gfits_define_bintable_column (&theader, "J", "ID",             "image ID", "unitless", 1.0, 0.0);
    125125
    126126  // generate the output array that carries the data
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/MeanMagIO.c

    r36520 r36545  
    7474    meanmags[i].catID          = catID[i];
    7575  }
    76   fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow);
     76  fprintf (stderr, "loaded data for %lld objects (* filters)\n", (long long) Nrow);
    7777
    7878  free (M    );
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/StarOps.c

    r36535 r36545  
    917917    for (j = 0; j < catalog[i].Naverage; j++) {
    918918      int nOwn = 0;
    919       int m = catalog[i].average[j].measureOffset;
    920       for (n = 0; n < catalog[i].average[j].Nmeasure; n++) {
     919      int m = catalog[i].averageT[j].measureOffset;
     920      for (n = 0; n < catalog[i].averageT[j].Nmeasure; n++) {
    921921        if (!catalog[i].measureT[m+n].myDet) continue;
    922922        nOwn ++;
     
    925925    }
    926926  }
     927  return TRUE;
     928}
     929
     930int dumpObjects (char *filename, Catalog *catalog, int Ncatalog) {
     931
     932  int i, n;
     933  off_t j;
     934
     935  FILE *ftest = fopen (filename, "w");
     936
     937  for (i = 0; i < Ncatalog; i++) {
     938    for (j = 0; j < catalog[i].Naverage; j++) {
     939      int m = catalog[i].averageT[j].measureOffset;
     940      for (n = 0; n < catalog[i].averageT[j].Nmeasure; n++) {
     941        fprintf (ftest, "%08x %08x %10.6f %10.6f  %3d %1d\n", catalog[i].averageT[j].catID, catalog[i].averageT[j].objID, catalog[i].averageT[j].R, catalog[i].averageT[j].D, catalog[i].averageT[j].Nmeasure, catalog[i].measureT[m+n].myDet);
     942      }
     943    }
     944  }
     945  fclose (ftest);
    927946  return TRUE;
    928947}
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/indexCatalog.c

    r36520 r36545  
    11# include "relphot.h"
    22
     3static int   catIDmax = 0;
    34static int  *catIDseq = NULL;
     5static int  *objIDmax = NULL;
    46static int **objIDseq = NULL;
    57
    68int indexCatalogs (Catalog *catalog, int Ncatalog) {
    79
    8   // find the max value of catID
    9   int catIDmax = 0;
    10 
    1110  int i;
    1211  off_t j;
    1312
     13  // find the max value of catID
    1414  for (i = 0; i < Ncatalog; i++) {
    1515    catIDmax = MAX (catalog[i].catID, catIDmax);
     
    2626  }
    2727 
     28  ALLOCATE (objIDmax, int,   Ncatalog);
    2829  ALLOCATE (objIDseq, int *, Ncatalog);
    2930  for (i = 0; i < Ncatalog; i++) {
    30     int objIDmax = 0;
     31    objIDmax[i] = 0;
    3132    for (j = 0; j < catalog[i].Naverage; j++) {
    32       objIDmax = MAX (catalog[i].average[j].objID, objIDmax);
     33      objIDmax[i] = MAX (catalog[i].averageT[j].objID, objIDmax[i]);
    3334    }
    3435
    35     ALLOCATE (objIDseq[i], int, objIDmax + 1);
    36     for (j = 0; j < objIDmax + 1; j++) {
     36    ALLOCATE (objIDseq[i], int, objIDmax[i] + 1);
     37    for (j = 0; j < objIDmax[i] + 1; j++) {
    3738      objIDseq[i][j] = -1;
    3839    }
    3940
    4041    for (j = 0; j < catalog[i].Naverage; j++) {
    41       int objID = catalog[i].average[j].objID;
     42      int objID = catalog[i].averageT[j].objID;
    4243      objIDseq[i][objID] = j;
    4344    }
     
    4849int catID_and_objID_to_seq (int catID, int objID, int *catSeq, off_t *objSeq) {
    4950
     51  if (catID > catIDmax) return FALSE;
     52
    5053  int cat = catIDseq[catID];
    5154  if (cat < 1) return FALSE;
     55
     56  if (objID > objIDmax[cat]) return FALSE;
    5257
    5358  int obj = objIDseq[cat][objID];
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/launch_region_hosts.c

    r36530 r36545  
    1919
    2020  int i;
     21
     22  // clear the I/O files
     23  for (i = 0; i < regionHosts->Nhosts; i++) {
     24    char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanmags.sync");
     25    truncate (syncfile, 0);
     26    free (syncfile);
     27
     28    char *fitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanmags.fits");
     29    truncate (fitsfile, 0);
     30    free (fitsfile);
     31
     32    char *imsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagemags.sync");
     33    truncate (imsyncfile, 0);
     34    free (imsyncfile);
     35
     36    char *imfitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagemags.fits");
     37    truncate (imfitsfile, 0);
     38    free (imfitsfile);
     39
     40    char *loopsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "loop.sync");
     41    truncate (loopsyncfile, 0);
     42    free (loopsyncfile);
     43  }
    2144
    2245  for (i = 0; i < regionHosts->Nhosts; i++) {
     
    4871    fprintf (stderr, "command: %s\n", command);
    4972   
     73    if (PARALLEL_MANUAL) continue;
     74
    5075    // launch the job on the remote machine (no handshake)
    5176    int errorInfo = 0;
     
    5883  }
    5984
    60   // XXX probably need an alternate function here...
    61   RegionHostTableWaitJobs (regionHosts, __FILE__, __LINE__);
     85  if (PARALLEL_MANUAL) {
     86    fprintf (stderr, "run the relphot_client commands above.  when these are done, hit return\n");
     87    getchar();
     88  } else {
     89    RegionHostTableWaitJobs (regionHosts, __FILE__, __LINE__);
     90  }
    6291 
    6392  return TRUE;
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_images.c

    r36519 r36545  
    99 * update the unowned objects for owned detections
    1010 */
     11
     12int dumpObjects (char *filename, Catalog *catalog, int Ncatalog);
    1113
    1214int relphot_parallel_images () {
     
    2729    exit (2);
    2830  }
     31
     32  // XXX need to deal with mosaic vs image...
     33  // initMosaics (image, Nimage...)
     34
     35  initImages (image, NULL, Nimage);
    2936
    3037  // load the flat correction table (if defined)
     
    5663  findMosaics (catalog, Ncatalog, TRUE);  /* also sets Grid values */
    5764  MARKTIME("-- set up mosaic indexes: %f sec\n", dtime);
     65
     66  // dumpObjects ("test.obj.dat", catalog, Ncatalog);
    5867
    5968  markObjects (catalog, Ncatalog);
     
    104113  }
    105114
     115  // this is a checkpoint to make sure all hosts have finished the loop above
     116  int myHost = regionHosts->index[REGION_HOST_ID];
     117  char *loopsyncfile = make_filename (CATDIR, regionHosts->hosts[myHost].hostname, REGION_HOST_ID, "loop.sync");
     118  update_sync_file (loopsyncfile, 0);
     119  free (loopsyncfile);
     120
     121  for (i = 0; i < regionHosts->Nhosts; i++) {
     122    if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
     123    char *loopsync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "loop.sync");
     124    check_sync_file (loopsync, 0);
     125    free (loopsync);
     126  }   
     127
    106128  /* set Mcal & Mmos for bad images */
    107129  setMcal  (catalog, TRUE, flatcorr);
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_image_mags.c

    r36520 r36545  
    2929  char *hostname = regionHosts->hosts[myHost].hostname;
    3030
    31   char filename[1024];
    32   snprintf (filename, 1024, "%s/%s.imagemags.fits", CATDIR, hostname);
    33   ImageMagSave (filename, image_mags, Nimage_mags);
     31  char *imagfile = make_filename (CATDIR, hostname, REGION_HOST_ID, "imagemags.fits");
     32  ImageMagSave (imagfile, image_mags, Nimage_mags);
     33  free (imagfile);
    3434
    35   update_imsync_file (hostname, nloop);
     35  char *syncfile = make_filename (CATDIR, hostname, REGION_HOST_ID, "imagemags.sync");
     36  update_sync_file (syncfile, nloop);
     37  free (syncfile);
    3638
    3739  return TRUE;
     
    4749  ALLOCATE (image_mags, ImageMag, 1);
    4850
     51  fprintf (stderr, "grabbing image mags from other hosts...\n");
     52
    4953  for (i = 0; i < regionHosts->Nhosts; i++) {
    5054    if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
    5155    // XXX add neighbor check? : if (not_neighbor(host[i])) continue;
    5256
    53     check_imsync_file (regionHosts->hosts[i].hostname, nloop);
     57    char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagemags.sync");
     58    check_sync_file (syncfile, nloop);
     59    free (syncfile);
    5460   
    55     char filename[1024];
    56     snprintf (filename, 1024, "%s/%s.imagemags.fits", CATDIR, regionHosts->hosts[i].hostname);
    57 
    5861    off_t Nsubset;
    59     ImageMag *image_mags_subset = ImageMagLoad (regionHosts->hosts[i].hostname, &Nsubset);
     62    char *imagfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagemags.fits");
     63    ImageMag *image_mags_subset = ImageMagLoad (imagfile, &Nsubset);
     64    free (imagfile);
    6065
    6166    image_mags = merge_image_mags (image_mags, &Nimage_mags, image_mags_subset, Nsubset);
     
    7681    images[seq].ubercalDist = image_mags[i].ubercalDist;
    7782  }
    78   return TRUE;
    79 }
    8083
    81 # define MSG_LENGTH 11
    82 
    83 int check_imsync_file (char *hostname, int nloop) {
    84 
    85   char message[MSG_LENGTH];
    86   char filename[1024];
    87   sprintf (filename, "%s/%s.image.sync", CATDIR, hostname);
    88 
    89   FILE *f = NULL;
    90 
    91   while (TRUE) {
    92 
    93     f = fopen (filename, "r");
    94     if (!f) {
    95       usleep (2000000);
    96       continue;
    97     }
    98 
    99     int Nread = fread (message, MSG_LENGTH, 1, f);
    100     if (Nread < MSG_LENGTH) {
    101       fclose (f);
    102       usleep (2000000);
    103       continue;
    104     }
    105     fclose (f);
    106 
    107     // message is of the form: NLOOP: %03d
    108     int loop;
    109     sscanf (message, "%*s %d", &loop);
    110     if (loop != nloop) {
    111       usleep (2000000);
    112       continue;
    113     }
    114     return TRUE;
    115   }
    116   return FALSE;
    117 }
    118 
    119 int update_imsync_file (char *hostname, int nloop) {
    120 
    121   char message[MSG_LENGTH];
    122   char filename[1024];
    123   sprintf (filename, "%s/%s.image.sync", CATDIR, hostname);
    124 
    125   FILE *f = fopen (filename, "w");
    126   snprintf (message, 11, "NLOOP: %03d\n", nloop);
    127  
    128   int Nwrite = fwrite (message, MSG_LENGTH, 1, f);
    129   if (Nwrite != MSG_LENGTH) {
    130     fprintf (stderr, "failure to write sync message\n");
    131     exit (3);
    132   }
    133 
    134   fclose (f);
    135   return TRUE;
    136 }
    137 
    138 int clear_imsync_file (char *hostname) {
    139 
    140   char filename[1024];
    141   sprintf (filename, "%s/%s.image.sync", CATDIR, hostname);
    142 
    143   // delete file contents
    144   truncate (filename, 0);
     84  fprintf (stderr, "DONE grabbing image mags from other hosts");
    14585
    14686  return TRUE;
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_mean_mags.c

    r36520 r36545  
    11# include "relphot.h"
    2 
    32// we are sharing mean mags for all objects which (a) I own and (b) which have unowned detections
    43
     
    2322
    2423      // do I own this object? (in region range?)
    25       if (catalog[i].average[j].R <  UserPatch.Rmin) continue;
    26       if (catalog[i].average[j].R >= UserPatch.Rmax) continue;
    27       if (catalog[i].average[j].D <  UserPatch.Dmin) continue;
    28       if (catalog[i].average[j].D >= UserPatch.Dmax) continue;
     24      if (catalog[i].averageT[j].R <  UserPatch.Rmin) continue;
     25      if (catalog[i].averageT[j].R >= UserPatch.Rmax) continue;
     26      if (catalog[i].averageT[j].D <  UserPatch.Dmin) continue;
     27      if (catalog[i].averageT[j].D >= UserPatch.Dmax) continue;
    2928
    3029      // does this object have missing detections (does someone else need it?)
    3130      // XXX : sky objects without missing detections
    3231      // XXX watch out for detections which are not associated with an image (REF)
    33       if (catalog[i].averageT[j].nOwn != catalog[i].averageT[j].Nmeasure) continue;
     32      if (catalog[i].averageT[j].nOwn == catalog[i].averageT[j].Nmeasure) continue;
    3433
    3534      for (Ns = 0; Ns < Nphotcodes; Ns++) {
    3635        int thisCode = photcodes[Ns][0].code;
    3736        int Nsec = GetPhotcodeNsec(thisCode);
    38         set_mean_mags (&meanmags[Nmeanmags], &catalog[i].average[j], &catalog[i].secfilt[Nsecfilt*j + Nsec], Nsec);
     37        set_mean_mags (&meanmags[Nmeanmags], &catalog[i].averageT[j], &catalog[i].secfilt[Nsecfilt*j + Nsec], Nsec);
    3938        Nmeanmags ++;
    4039        CHECK_REALLOCATE (meanmags, MeanMag, NMEANMAGS, Nmeanmags, D_NMEANMAGS);
     
    4746  char *hostname = regionHosts->hosts[myHost].hostname;
    4847
    49   char filename[1024];
    50   snprintf (filename, 1024, "%s/%s.meanmags.fits", CATDIR, hostname);
    51   MeanMagSave (filename, meanmags, Nmeanmags);
     48  char *magsfile = make_filename (CATDIR, hostname, REGION_HOST_ID, "meanmags.fits");
     49  MeanMagSave (magsfile, meanmags, Nmeanmags);
     50  free (magsfile);
    5251
    53   update_sync_file (hostname, nloop);
     52  char *syncfile = make_filename (CATDIR, hostname, REGION_HOST_ID, "meanmags.sync");
     53  update_sync_file (syncfile, nloop);
     54  free (syncfile);
    5455
    5556  return TRUE;
     
    6465  ALLOCATE (meanmags, MeanMag, 1);
    6566
     67  fprintf (stderr, "grabbing mean object mags from other hosts...\n");
     68
    6669  int Nsecfilt = GetPhotcodeNsecfilt();
    6770
     
    7073    if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
    7174
    72     check_sync_file (regionHosts->hosts[i].hostname, nloop);
     75    char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanmags.sync");
     76    check_sync_file (syncfile, nloop);
     77    free (syncfile);
    7378   
    74     char filename[1024];
    75     snprintf (filename, 1024, "%s/%s.meanmags.fits", CATDIR, regionHosts->hosts[i].hostname);
    76 
    7779    off_t Nsubset = 0;
    78     MeanMag *meanmagsSubset = MeanMagLoad (regionHosts->hosts[i].hostname, &Nsubset);
     80    char *magsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanmags.fits");
     81    MeanMag *meanmagsSubset = MeanMagLoad (magsfile, &Nsubset);
     82    free (magsfile);
    7983
    8084    // merge_mean_mags reallocs meanmags and frees the input meanmagsSubset
     
    101105    catalog[catSeq].secfilt[objSeq*Nsecfilt + Nsec].M = meanmags[i].M;
    102106  }
    103   return TRUE;
    104 }
    105107
    106 # define MSG_LENGTH 11
    107 
    108 int check_sync_file (char *hostname, int nloop) {
    109 
    110   char message[MSG_LENGTH];
    111   char filename[1024];
    112   sprintf (filename, "%s/%s.meanmags.sync", CATDIR, hostname);
    113 
    114   // XXX I need a rule to generate the filename for each host
    115   FILE *f = NULL;
    116 
    117   while (TRUE) {
    118 
    119     f = fopen (filename, "r");
    120     if (!f) {
    121       usleep (2000000);
    122       continue;
    123     }
    124 
    125     // XXX MSG_LENGTH : 0 EOL byte?
    126     int Nread = fread (message, MSG_LENGTH, 1, f);
    127     if (Nread < MSG_LENGTH) {
    128       fclose (f);
    129       usleep (2000000);
    130       continue;
    131     }
    132     fclose (f);
    133 
    134     // message is of the form: NLOOP: %03d
    135     int loop;
    136     sscanf (message, "%*s %d", &loop);
    137     if (loop != nloop) {
    138       usleep (2000000);
    139       continue;
    140     }
    141     return TRUE;
    142   }
    143   return FALSE;
    144 }
    145 
    146 int clear_sync_file (char *hostname) {
    147 
    148   char filename[1024];
    149   sprintf (filename, "%s/%s.meanmags.sync", CATDIR, hostname);
    150 
    151   // delete file contents
    152   truncate (filename, 0);
     108  fprintf (stderr, "DONE grabbing mean object mags from other hosts...\n");
    153109
    154110  return TRUE;
    155111}
    156112
    157 int update_sync_file (char *hostname, int nloop) {
    158 
    159   char message[MSG_LENGTH];
    160   char filename[1024];
    161   sprintf (filename, "%s/%s.meanmags.sync", CATDIR, hostname);
    162 
    163   FILE *f = fopen (filename, "w");
    164   snprintf (message, 11, "NLOOP: %03d\n", nloop);
    165  
    166   int Nwrite = fwrite (message, MSG_LENGTH, 1, f);
    167   if (Nwrite != MSG_LENGTH) {
    168     fprintf (stderr, "failure to write sync message\n");
    169     exit (3);
    170   }
    171 
    172   fclose (f);
    173   return TRUE;
    174 }
    175 
    176 int set_mean_mags (MeanMag *meanmags, Average *average, SecFilt *secfilt, int Nsec) {
     113int set_mean_mags (MeanMag *meanmags, AverageTiny *average, SecFilt *secfilt, int Nsec) {
    177114
    178115  meanmags->M  = secfilt->M;
Note: See TracChangeset for help on using the changeset viewer.