Changeset 37963
- Timestamp:
- Mar 11, 2015, 6:34:45 AM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150112/Ohana/src/relastro
- Files:
-
- 6 edited
-
include/relastro.h (modified) (1 diff)
-
src/MeasPosIO.c (modified) (6 diffs)
-
src/relastro_parallel_images.c (modified) (8 diffs)
-
src/share_images_pos.c (modified) (7 diffs)
-
src/share_mean_pos.c (modified) (6 diffs)
-
src/share_meas_pos.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150112/Ohana/src/relastro/include/relastro.h
r37807 r37963 9 9 // # define IDX_T off_t 10 10 # define IDX_T int 11 12 # define LOGRTIME(MSG,...) { \ 13 gettimeofday (&stopTimer, (void *) NULL); \ 14 float dtime = DTIME (stopTimer, startTimer); \ 15 client_logger_message (MSG, __VA_ARGS__); } 11 16 12 17 typedef enum { -
branches/eam_branches/ipp-20150112/Ohana/src/relastro/src/MeasPosIO.c
r37807 r37963 19 19 MeasPos *measpos = NULL; 20 20 21 INITTIME; 22 21 23 FILE *f = fopen (filename, "r"); 22 24 if (!f) { … … 46 48 } 47 49 50 LOGRTIME("MeasPosLoad_init %s: %f sec\n", filename, dtime); 51 48 52 // read the fits table bytes 49 53 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { … … 52 56 } 53 57 fclose (f); 58 LOGRTIME("MeasPosLoad_read %s: %f sec\n", filename, dtime); 54 59 55 60 // a bit annoying : we read the entire block of data, then extract the columns, then set the image structure values. … … 63 68 GET_COLUMN (catID, "CAT_ID", int); 64 69 GET_COLUMN (imageID, "IMAGE_ID", int); 70 LOGRTIME("MeasPosLoad_getcol %s: %f sec\n", filename, dtime); 65 71 66 72 ALLOCATE (measpos, MeasPos, Nrow); 73 LOGRTIME("MeasPosLoad_alloc %s: %f sec\n", filename, dtime); 74 67 75 for (i = 0; i < Nrow; i++) { 68 76 measpos[i].R = R [i]; … … 72 80 measpos[i].imageID = imageID[i]; 73 81 } 82 LOGRTIME("MeasPosLoad_convert %s: %f sec\n", filename, dtime); 83 74 84 fprintf (stderr, "loaded data for %lld objects (* filters)\n", (long long) Nrow); 75 85 … … 85 95 gfits_free_header (&theader); 86 96 gfits_free_table (&ftable); 97 LOGRTIME("MeasPosLoad_cleanup %s: %f sec\n", filename, dtime); 87 98 88 99 *nmeaspos = Nrow; -
branches/eam_branches/ipp-20150112/Ohana/src/relastro/src/relastro_parallel_images.c
r37807 r37963 22 22 RegionHostTable *regionHosts = RegionHostTableLoad (CATDIR, REGION_FILE); 23 23 int myHost = regionHosts->index[REGION_HOST_ID]; 24 char *myHostName = regionHosts->hosts[myHost].hostname; 25 24 26 RegionHostFindNeighbors (regionHosts, myHost); 25 client_logger_message ("started parallel images on %s\n", regionHosts->hosts[myHost].hostname);27 client_logger_message ("started parallel images on %s\n", myHostName); 26 28 27 29 // load the subset images belonging to this host … … 47 49 } 48 50 put_astrom_table (table); 49 client_logger_message ("loaded images on %s\n", regionHosts->hosts[myHost].hostname);51 client_logger_message ("loaded images on %s\n", myHostName); 50 52 51 53 // once we have read this table, we should remove it for repeat runs … … 62 64 63 65 /* load catalog data from region files (hostID is 0 since we are not a client */ 64 char *syncfile = make_filename (CATDIR, regionHosts->hosts[myHost].hostname, REGION_HOST_ID, "loadcat.sync");66 char *syncfile = make_filename (CATDIR, myHostName, REGION_HOST_ID, "loadcat.sync"); 65 67 catalog = load_catalogs (skylist, &Ncatalog, TRUE, 0, NULL, syncfile); 66 68 MARKTIME("-- load catalog data, host %d: %f sec\n", REGION_HOST_ID, dtime); 67 69 free (syncfile); 68 70 69 client_logger_message ("loaded catalog data %s\n", regionHosts->hosts[myHost].hostname);71 client_logger_message ("loaded catalog data %s\n", myHostName); 70 72 71 73 // find ICRF QSOs for reference downstream (only if USE_ICRF_CORRECT) … … 90 92 createStarMap (catalog, Ncatalog); 91 93 92 client_logger_message ("set up image indexes on %s\n", regionHosts->hosts[myHost].hostname);94 client_logger_message ("set up image indexes on %s\n", myHostName); 93 95 94 96 markObjects (catalog, Ncatalog); … … 96 98 SAVEPLOT = FALSE; 97 99 98 client_logger_message ("starting the loops: %s\n", regionHosts->hosts[myHost].hostname);100 client_logger_message ("starting the loops: %s\n", myHostName); 99 101 100 102 /* major modes */ … … 114 116 if (RESET_IMAGES) { 115 117 UpdateMeasures (catalog, Ncatalog); 116 MARKTIME(" reset measures, host %d: %f sec\n", REGION_HOST_ID, dtime);117 client_logger_message ("reset measures: %s\n", regionHosts->hosts[myHost].hostname);118 MARKTIME("UpdateMeasures on %s, host %d: %f sec\n", myHostName, REGION_HOST_ID, dtime); 119 LOGRTIME("UpdateMeasures on %s, host %d: %f sec\n", myHostName, REGION_HOST_ID, dtime); 118 120 } 119 121 for (i = 0; i < NLOOP; i++) { 120 122 UpdateObjects (catalog, Ncatalog, (i > 0)); 121 MARKTIME("update objects loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime); 122 client_logger_message ("update objects loop %d: %s\n", i, regionHosts->hosts[myHost].hostname); 123 LOGRTIME("UpdateObjects loop %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 123 124 if ((i > 1) || !USE_GALAXY_MODEL) { 124 125 // if GALAXY_MODEL is selected, we want to delay the frame correction until we have 125 126 // applied the galaxy model a couple of times. 126 127 FrameCorrectionParallelSlave (catalog, Ncatalog, regionHosts, i); 127 MARKTIME("frame correction loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime); 128 client_logger_message ("frame correction loop %d: %s\n", i, regionHosts->hosts[myHost].hostname); 128 LOGRTIME("FrameCorrection loop %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 129 129 } 130 130 share_mean_pos (catalog, Ncatalog, regionHosts, i); 131 LOGRTIME("share_mean_pos loop %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 131 132 slurp_mean_pos (catalog, Ncatalog, regionHosts, i); 132 client_logger_message ("slurp mags loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);133 LOGRTIME("slurp_mean_pos loop %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 133 134 134 135 UpdateChips (catalog, Ncatalog); 135 MARKTIME("update chips loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime); 136 client_logger_message ("update chips loop %d: %s\n", i, regionHosts->hosts[myHost].hostname); 136 LOGRTIME("UpdateChips loop %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 137 137 138 138 share_image_pos (regionHosts, i); 139 LOGRTIME("share_image_pos loop on %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 139 140 slurp_image_pos (catalog, Ncatalog, regionHosts, i); 140 client_logger_message ("slurp image pos loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);141 LOGRTIME("slurp_image_pos loop on %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 141 142 142 143 share_meas_pos (catalog, Ncatalog, regionHosts, i); 144 LOGRTIME("share_meas_pos loop %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 143 145 slurp_meas_pos (catalog, Ncatalog, regionHosts, i); 144 MARKTIME("done exchange loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime); 145 client_logger_message ("slurp meas loop %d: %s\n", i, regionHosts->hosts[myHost].hostname); 146 LOGRTIME("slurp_meas_pos loop %d on %s, host %d: %f sec\n", i, myHostName, REGION_HOST_ID, dtime); 146 147 } 147 148 // create summary plots of the process … … 166 167 167 168 // this is a checkpoint to make sure all hosts have finished the loop above 168 char *loopsyncfile = make_filename (CATDIR, regionHosts->hosts[myHost].hostname, REGION_HOST_ID, "loop.sync");169 char *loopsyncfile = make_filename (CATDIR, myHostName, REGION_HOST_ID, "loop.sync"); 169 170 update_sync_file (loopsyncfile, 0); 170 171 free (loopsyncfile); … … 178 179 179 180 share_image_pos (regionHosts, -1); 180 client_logger_message ("share image pos loop %d: %s\n", -1, regionHosts->hosts[myHost].hostname);181 LOGRTIME("share image pos loop %d on %s, host %d: %f sec\n", -1, myHostName, REGION_HOST_ID, dtime); 181 182 182 183 exit (0); -
branches/eam_branches/ipp-20150112/Ohana/src/relastro/src/share_images_pos.c
r37807 r37963 60 60 ALLOCATE (image_pos, ImagePos, 1); 61 61 62 INITTIME; 63 int myHost = regionHosts->index[REGION_HOST_ID]; 64 char *myHostName = regionHosts->hosts[myHost].hostname; 65 62 66 fprintf (stderr, "grabbing image mags from other hosts...\n"); 63 67 68 LOGRTIME("image_load_start loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 64 69 for (i = 0; i < regionHosts->Nhosts; i++) { 65 70 if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue; … … 69 74 check_sync_file (syncfile, nloop); 70 75 free (syncfile); 76 LOGRTIME("image_load_sync host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 71 77 72 78 off_t Nsubset; … … 74 80 ImagePos *image_pos_subset = ImagePosLoad (iposfile, &Nsubset); 75 81 free (iposfile); 82 LOGRTIME("image_load_read host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 76 83 77 84 image_pos = merge_image_pos (image_pos, &Nimage_pos, image_pos_subset, Nsubset); 85 LOGRTIME("image_load_merge host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 78 86 } 79 87 … … 96 104 images[seq].flags = image_pos[i].flags ; 97 105 } 106 LOGRTIME("image_load_convert loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 98 107 99 108 // load the astrometry offset maps, if they exist, and apply … … 106 115 107 116 AstromOffsetTable *table = AstromOffsetMapLoad (mapname, VERBOSE); 117 LOGRTIME("image_maps_load host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 108 118 109 119 // apply table entries here to existing images … … 127 137 } 128 138 } 139 LOGRTIME("image_maps_copy host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 140 129 141 AstromOffsetTableFree(table); 142 LOGRTIME("image_maps_free host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 130 143 } 131 144 … … 137 150 } 138 151 free (image_pos); 152 LOGRTIME("image_load_apply loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 139 153 140 154 fprintf (stderr, "DONE grabbing image mags from other hosts\n"); -
branches/eam_branches/ipp-20150112/Ohana/src/relastro/src/share_mean_pos.c
r37038 r37963 15 15 16 16 int myHost = regionHosts->index[REGION_HOST_ID]; 17 char *myHostName = regionHosts->hosts[myHost].hostname; 18 17 19 double Rmin = regionHosts->hosts[myHost].Rmin; 18 20 double Rmax = regionHosts->hosts[myHost].Rmax; 19 21 double Dmin = regionHosts->hosts[myHost].Dmin; 20 22 double Dmax = regionHosts->hosts[myHost].Dmax; 23 24 INITTIME; 21 25 22 26 // XXX skip some catalogs based on UserPatch? … … 40 44 } 41 45 } 46 LOGRTIME("set_mean_pos loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 42 47 43 48 // write out the meanmag fits table AND write state in some file … … 48 53 free (meanpos); 49 54 free (posfile); 55 LOGRTIME("MeanPosSave loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 50 56 51 57 char *syncfile = make_filename (CATDIR, hostname, REGION_HOST_ID, "meanpos.sync"); 52 58 update_sync_file (syncfile, nloop); 53 59 free (syncfile); 60 LOGRTIME("update_sync_file loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 54 61 55 62 return TRUE; … … 64 71 ALLOCATE (meanpos, MeanPos, 1); 65 72 73 int myHost = regionHosts->index[REGION_HOST_ID]; 74 char *myHostName = regionHosts->hosts[myHost].hostname; 75 66 76 fprintf (stderr, "grabbing mean object pos from other hosts...\n"); 77 78 INITTIME; 67 79 68 80 for (i = 0; i < regionHosts->Nhosts; i++) { … … 82 94 meanpos = merge_mean_pos (meanpos, &Nmeanpos, meanposSubset, Nsubset); 83 95 } 96 LOGRTIME("MeanPosLoad/merge_mean_pos loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 84 97 85 98 for (i = 0; i < Nmeanpos; i++) { … … 99 112 } 100 113 free (meanpos); 114 LOGRTIME("match_catID_and_objID loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 101 115 102 116 fprintf (stderr, "DONE grabbing mean object pos from other hosts...\n"); -
branches/eam_branches/ipp-20150112/Ohana/src/relastro/src/share_meas_pos.c
r37807 r37963 14 14 ALLOCATE (measpos, MeasPos, NMEASPOS); 15 15 16 INITTIME; 16 17 int myHost = regionHosts->index[REGION_HOST_ID]; 18 char *myHostName = regionHosts->hosts[myHost].hostname; 17 19 18 20 // XXX skip some catalogs based on UserPatch? … … 33 35 } 34 36 } 37 LOGRTIME("set_meas_pos loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 35 38 36 39 // write out the measmag fits table AND write state in some file … … 41 44 free (measpos); 42 45 free (posfile); 46 LOGRTIME("MeasPosSave loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 43 47 44 48 char *syncfile = make_filename (CATDIR, hostname, REGION_HOST_ID, "measpos.sync"); 45 49 update_sync_file (syncfile, nloop); 46 50 free (syncfile); 51 LOGRTIME("update_sync_file loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 47 52 48 53 return TRUE; … … 59 64 fprintf (stderr, "grabbing meas object pos from other hosts...\n"); 60 65 66 INITTIME; 67 int myHost = regionHosts->index[REGION_HOST_ID]; 68 char *myHostName = regionHosts->hosts[myHost].hostname; 69 70 LOGRTIME("meas_load_start loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 61 71 for (i = 0; i < regionHosts->Nhosts; i++) { 62 72 if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue; … … 66 76 check_sync_file (syncfile, nloop); 67 77 free (syncfile); 78 LOGRTIME("meas_load_sync host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 68 79 69 80 off_t Nsubset = 0; … … 71 82 MeasPos *measposSubset = MeasPosLoad (posfile, &Nsubset); 72 83 free (posfile); 84 LOGRTIME("MeasPosLoad host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 73 85 74 86 // merge_meas_pos reallocs measpos and frees the input measposSubset 75 87 measpos = merge_meas_pos (measpos, &Nmeaspos, measposSubset, Nsubset); 88 LOGRTIME("merge_meas_pos host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 76 89 } 90 LOGRTIME("meas_load_done loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 77 91 78 92 for (i = 0; i < Nmeaspos; i++) { … … 99 113 } 100 114 free (measpos); 115 LOGRTIME("match_catID_and_objID/meas loop %d on %s, host %d: %f sec\n", nloop, myHostName, REGION_HOST_ID, dtime); 101 116 102 117 fprintf (stderr, "DONE grabbing meas object pos from other hosts...\n");
Note:
See TracChangeset
for help on using the changeset viewer.
