Changeset 29540
- Timestamp:
- Oct 25, 2010, 12:50:29 PM (16 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 24 edited
- 2 copied
-
cmd.astro/coords.c (modified) (1 diff)
-
cmd.basic/fprintf.c (modified) (2 diffs)
-
cmd.data/Makefile (modified) (1 diff)
-
cmd.data/center.c (modified) (1 diff)
-
cmd.data/init.c (modified) (2 diffs)
-
cmd.data/limits.c (modified) (1 diff)
-
cmd.data/read_vectors.c (modified) (1 diff)
-
cmd.data/reindex.c (copied) (copied from branches/eam_branches/ipp-20100823/Ohana/src/opihi/cmd.data/reindex.c )
-
cmd.data/svd.c (modified) (1 diff)
-
dvo/LoadImages.c (modified) (1 diff)
-
dvo/badimages.c (modified) (1 diff)
-
dvo/imdata.c (modified) (1 diff)
-
dvo/imlist.c (modified) (1 diff)
-
dvo/imphot.c (modified) (1 diff)
-
dvo/imstats.c (modified) (1 diff)
-
dvo/skycoverage.c (modified) (2 diffs)
-
dvo/subpix.c (modified) (1 diff)
-
include/data.h (modified) (1 diff)
-
include/pcontrol.h (modified) (2 diffs)
-
lib.data/Makefile (modified) (1 diff)
-
lib.data/svdcmp_bond_new.c (copied) (copied from branches/eam_branches/ipp-20100823/Ohana/src/opihi/lib.data/svdcmp_bond_new.c )
-
pcontrol/CheckIdleHost.c (modified) (2 diffs)
-
pcontrol/JobOps.c (modified) (3 diffs)
-
pcontrol/MachineOps.c (modified) (6 diffs)
-
pcontrol/job.c (modified) (4 diffs)
-
pcontrol/test/machines.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/coords.c
r27491 r29540 109 109 gprint (GP_ERR, " -p : from pixels to ra/dec\n"); 110 110 gprint (GP_ERR, " -c : from ra/dec to pixels\n"); 111 gprint (GP_ERR, " coordinates are in degrees\n"); 111 112 escape: 112 113 if (MOSAIC != NULL) free (MOSAIC); -
trunk/Ohana/src/opihi/cmd.basic/fprintf.c
r9196 r29540 40 40 switch (*p1) { 41 41 case 'e': 42 case 'g': 42 43 case 'f': 44 case 'E': 45 case 'F': 46 case 'G': 43 47 sprintf (tmp, fmt, atof(argv[i])); 44 48 break; … … 47 51 break; 48 52 case 'd': 53 case 'o': 54 case 'i': 55 case 'u': 49 56 case 'c': 50 57 case 'x': 58 case 'X': 51 59 sprintf (tmp, fmt, atoi(argv[i])); 52 60 break; 53 61 default: 54 gprint (GP_ERR, "syntax error in format ( only e,f,s,d,c,xallowed)\n");62 gprint (GP_ERR, "syntax error in format (e,f,g,E,F,G,c,s,d,i,o,x,X conversions allowed)\n"); 55 63 return (FALSE); 56 64 } -
trunk/Ohana/src/opihi/cmd.data/Makefile
r29001 r29540 102 102 $(SRC)/read_vectors.$(ARCH).o \ 103 103 $(SRC)/rebin.$(ARCH).o \ 104 $(SRC)/resize.$(ARCH).o \ 104 $(SRC)/reindex.$(ARCH).o \ 105 $(SRC)/resize.$(ARCH).o \ 105 106 $(SRC)/relocate.$(ARCH).o \ 106 107 $(SRC)/roll.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/center.c
r21060 r29540 16 16 if (!GetImage (NULL, &kapa, name)) return (FALSE); 17 17 FREE (name); 18 19 // XXX need an option to center the image based on the current plot limits 18 20 19 21 if ((argc != 3) && (argc != 4)) { -
trunk/Ohana/src/opihi/cmd.data/init.c
r29001 r29540 91 91 int rebin PROTO((int, char **)); 92 92 int resize PROTO((int, char **)); 93 int reindex PROTO((int, char **)); 93 94 int relocate PROTO((int, char **)); 94 95 int roll PROTO((int, char **)); … … 232 233 {1, "read", read_vectors, "read vectors from datafile"}, 233 234 {1, "rebin", rebin, "rebin image data by factor of N"}, 235 {1, "reindex", reindex, "create new vector from old vector based on index vector"}, 234 236 {1, "resize", resize, "set graphics/image window size"}, 235 237 {1, "relocate", relocate, "set graphics/image window position"}, -
trunk/Ohana/src/opihi/cmd.data/limits.c
r13479 r29540 24 24 if (!GetGraph (&graphmode, &kapa, name)) return (FALSE); 25 25 FREE (name); 26 27 // XXX need an option to set the limits based on the current image bounds 26 28 27 29 if (argc == 1) { -
trunk/Ohana/src/opihi/cmd.data/read_vectors.c
r27435 r29540 216 216 217 217 while (1) { 218 if (!gfits_load_header (f, &header)) ESCAPE ("extension not found in file"); 218 if (!gfits_load_header (f, &header)) { 219 gprint (GP_ERR, "extension %s not found in file\n", extname); 220 if (CCDKeyword != NULL) free (CCDKeyword); 221 gfits_free_table (&table); 222 gfits_free_header (&header); 223 return (TRUE); 224 } 225 219 226 Nbytes = gfits_data_size (&header); 220 227 -
trunk/Ohana/src/opihi/cmd.data/svd.c
r27185 r29540 82 82 } 83 83 84 # if 085 status = svdcmp_bond_ raw (Ny, Nx, 1, 1, FLT_EPSILON, 1e-6, a, q, u, v);84 # if 1 85 status = svdcmp_bond_new (Ny, Nx, 1, 1, FLT_EPSILON, 1e-6, a, q, u, v); 86 86 fprintf (stderr, "status: %d\n", status); 87 87 # else -
trunk/Ohana/src/opihi/dvo/LoadImages.c
r29001 r29540 75 75 lastModified = getLastModified(filename); 76 76 } 77 77 78 return (image); 78 79 } -
trunk/Ohana/src/opihi/dvo/badimages.c
r27435 r29540 70 70 } 71 71 72 FreeImages(image); 72 73 return (TRUE); 73 74 74 } -
trunk/Ohana/src/opihi/dvo/imdata.c
r27435 r29540 222 222 vec[0].Nelements = N; 223 223 REALLOCATE (vec[0].elements.Flt, opihi_flt, MAX(1,N)); 224 FreeImages(image); 224 225 return (TRUE); 225 226 } -
trunk/Ohana/src/opihi/dvo/imlist.c
r27435 r29540 108 108 } 109 109 110 FreeImages(image); 110 111 free (subset); 111 free (image);112 112 return (TRUE); 113 113 } -
trunk/Ohana/src/opihi/dvo/imphot.c
r27435 r29540 92 92 } 93 93 94 free(image);94 FreeImages(image); 95 95 free (subset); 96 96 return (TRUE); -
trunk/Ohana/src/opihi/dvo/imstats.c
r27435 r29540 58 58 free (Xvec.elements.Flt); 59 59 free (Yvec.elements.Flt); 60 FreeImages (image); 60 61 return (TRUE); 61 62 } -
trunk/Ohana/src/opihi/dvo/skycoverage.c
r27435 r29540 179 179 PutCoords (&coords, &buf[0].header); 180 180 181 if ((image = LoadImages (&Nimage)) == NULL) return (FALSE); 181 image = LoadImages(&Nimage); 182 if (image == NULL) { 183 return (FALSE); 184 } 182 185 BuildChipMatch (image, Nimage); 183 186 … … 251 254 } 252 255 } 253 254 free (image); 256 FreeImages(image); 255 257 return (TRUE); 256 258 } -
trunk/Ohana/src/opihi/dvo/subpix.c
r27435 r29540 147 147 148 148 dvo_catalog_free (&catalog); 149 free (image);150 149 free (index); 151 150 SkyListFree (skylist); 152 151 152 FreeImages(image); 153 153 return (TRUE); 154 154 } -
trunk/Ohana/src/opihi/include/data.h
r27435 r29540 92 92 int svdcmp_bond_raw(int m, int n, int withu, int withv, double eps, double tol, double **a, double *q, double **u, double **v); 93 93 94 /* in svdcmp_bond_new.c */ 95 int svdcmp_bond_new(int m, int n, int withu, int withv, double eps, double tol, double **a, double *q, double **u, double **v); 96 94 97 /* mrqmin.c */ 95 98 opihi_flt mrqcof (opihi_flt *x, opihi_flt *y, opihi_flt *dy, int Npts, -
trunk/Ohana/src/opihi/include/pcontrol.h
r28242 r29540 115 115 char *hostname; 116 116 char *realhost; 117 char **xhosts; 118 int Nxhosts; 117 119 int exit_status; 118 120 int Reset; … … 289 291 Job *PullJobByID (IDtype JobID, int *StackID); 290 292 Job *PullJobFromStackByID (int StackID, int ID); 291 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv );293 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv, int Nxhosts, char **xhosts); 292 294 void DelJob (Job *job); 293 295 Host *UnlinkJobAndHost (Job *job); -
trunk/Ohana/src/opihi/lib.data/Makefile
r27185 r29540 20 20 $(SDIR)/fft.$(ARCH).o \ 21 21 $(SDIR)/svdcmp.$(ARCH).o \ 22 $(SDIR)/svdcmp_bond_new.$(ARCH).o \ 22 23 $(SDIR)/convert.$(ARCH).o \ 23 24 $(SDIR)/bracket.$(ARCH).o \ -
trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c
r28158 r29540 60 60 if (strcasecmp (job[0].hostname, host[0].hostname)) continue; 61 61 62 if (!CheckMachineJobs (host, job)) continue; 63 62 64 /* we have found an appropriate job; link it to the host and send to StartJob */ 63 65 job[0].host = (struct Host *) host; … … 80 82 ASSERT (job[0].hostname != NULL, "WANTHOST hostname missing"); 81 83 if (strcasecmp (job[0].hostname, host[0].hostname)) continue; 84 85 if (!CheckMachineJobs (host, job)) continue; 82 86 83 87 /* we have found an appropriate job; link it to the host and send to StartJob */ -
trunk/Ohana/src/opihi/pcontrol/JobOps.c
r28242 r29540 195 195 } 196 196 197 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv ) {197 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv, int Nxhosts, char **xhosts) { 198 198 199 199 int JobID; … … 228 228 job[0].host = NULL; 229 229 230 job[0].xhosts = xhosts; 231 job[0].Nxhosts = Nxhosts; 232 230 233 JobID = job[0].JobID; 231 234 … … 257 260 FREE (job[0].argv); 258 261 262 for (i = 0; i < job[0].Nxhosts; i++) { 263 FREE (job[0].xhosts[i]); 264 } 265 FREE (job[0].xhosts); 266 259 267 FreeIOBuffer (&job[0].stdout_buf.buffer); 260 268 FreeIOBuffer (&job[0].stderr_buf.buffer); -
trunk/Ohana/src/opihi/pcontrol/MachineOps.c
r26521 r29540 1 1 # include "pcontrol.h" 2 # define DEBUG 0 2 3 3 4 static int MAX_UNWANTED_HOST_JOBS = 5; … … 107 108 int AddMachineJob (Host *host, Job *job) { 108 109 110 int i; 109 111 Machine *machine; 110 112 … … 114 116 machine[0].NjobsRealhost ++; 115 117 116 // skip jobs that do not have a targeted host 117 if (job[0].hostname == NULL) { 118 return (TRUE); 118 // skip jobs that do not have a targeted host or any xhosts 119 if (!job[0].hostname && !job[0].Nxhosts) { 120 return (TRUE); 121 } 122 123 for (i = 0; i < job[0].Nxhosts; i++) { 124 // find machine matching the xhost name (these count against the unwanted host total) 125 machine = FindMachineByName (job[0].xhosts[i]); // Can this fail? 126 if (!machine) continue; 127 machine[0].NjobsWanthost ++; 119 128 } 120 129 … … 134 143 int DelMachineJob (Host *host, Job *job) { 135 144 145 int i; 136 146 Machine *machine; 137 147 … … 141 151 machine[0].NjobsRealhost --; 142 152 143 // skip jobs that do not have a targeted host 144 if (job[0].hostname == NULL) { 145 return (TRUE); 153 // skip jobs that do not have a targeted host or any xhosts 154 if (!job[0].hostname && !job[0].Nxhosts) { 155 return (TRUE); 156 } 157 158 for (i = 0; i < job[0].Nxhosts; i++) { 159 // find machine matching the xhost name (these count against the unwanted host total) 160 machine = FindMachineByName (job[0].xhosts[i]); // Can this fail? 161 if (!machine) continue; 162 machine[0].NjobsWanthost --; 146 163 } 147 164 … … 175 192 int CheckMachineJobs (Host *host, Job *job) { 176 193 194 int i; 177 195 Machine *machine; 178 196 179 197 machine = FindMachineByName (job[0].hostname); 180 if (machine == NULL) return (TRUE); 181 // fprintf (stderr, "wanthost: %s, Ntotal: %d, Nmax: %d\n", job[0].hostname, machine[0].NjobsWanthost + machine[0].NjobsRealhost, machine[0].Nhosts + MAX_UNWANTED_HOST_JOBS); 182 // if (machine[0].NjobsWanthost + machine[0].NjobsRealhost >= machine[0].Nhosts + MAX_UNWANTED_HOST_JOBS) { 183 if (machine[0].NjobsWanthost >= MAX_UNWANTED_HOST_JOBS) { 184 // fprintf (stderr, "too many outstanding jobs wanting host %s, delay job %s for now\n", job[0].hostname, job[0].argv[0]); 185 return (FALSE); 186 } 198 if (machine) { 199 if (DEBUG) fprintf (stderr, "wanthost: %s, Ntotal: %d, Nmax: %d\n", machine[0].name, machine[0].NjobsWanthost + machine[0].NjobsRealhost, machine[0].Nhosts + MAX_UNWANTED_HOST_JOBS); 200 if (machine[0].NjobsWanthost >= MAX_UNWANTED_HOST_JOBS) { 201 if (DEBUG) fprintf (stderr, "too many outstanding jobs wanting host %s, delay job %s for now\n", machine[0].name, job[0].argv[0]); 202 return (FALSE); 203 } 204 } 205 206 for (i = 0; i < job[0].Nxhosts; i++) { 207 machine = FindMachineByName (job[0].xhosts[i]); 208 if (machine) { 209 if (DEBUG) fprintf (stderr, "xhost: %s, Ntotal: %d, Nmax: %d\n", machine[0].name, machine[0].NjobsWanthost + machine[0].NjobsRealhost, machine[0].Nhosts + MAX_UNWANTED_HOST_JOBS); 210 if (machine[0].NjobsWanthost >= MAX_UNWANTED_HOST_JOBS) { 211 if (DEBUG) fprintf (stderr, "too many outstanding jobs wanting host %s, delay job %s for now\n", machine[0].name, job[0].argv[0]); 212 return (FALSE); 213 } 214 } 215 } 187 216 188 217 machine = FindMachineByName (host[0].hostname); 189 // fprintf (stderr, "realhost: %s, Ntotal: %d, Nmax: %d\n", host[0].hostname, machine[0].NjobsWanthost + machine[0].NjobsRealhost, machine[0].Nhosts + MAX_UNWANTED_HOST_JOBS); 190 if (machine[0].NjobsWanthost >= MAX_UNWANTED_HOST_JOBS) { 191 // fprintf (stderr, "too many outstanding jobs wanting host %s, delay job %s for now\n", job[0].hostname, job[0].argv[0]); 192 return (FALSE); 193 } 218 if (machine) { 219 if (DEBUG) fprintf (stderr, "realhost: %s, Ntotal: %d, Nmax: %d\n", machine[0].name, machine[0].NjobsWanthost + machine[0].NjobsRealhost, machine[0].Nhosts + MAX_UNWANTED_HOST_JOBS); 220 if (machine[0].NjobsWanthost >= MAX_UNWANTED_HOST_JOBS) { 221 if (DEBUG) fprintf (stderr, "too many outstanding jobs wanting host %s, delay job %s for now\n", machine[0].name, job[0].argv[0]); 222 return (FALSE); 223 } 224 } 225 194 226 return (TRUE); 195 227 } -
trunk/Ohana/src/opihi/pcontrol/job.c
r23586 r29540 6 6 int i, N, Mode, targc, Timeout; 7 7 IDtype JobID; 8 char **xhosts; 9 int Nxhosts, NXHOSTS; 8 10 9 11 if (get_argument (argc, argv, "-host") && get_argument (argc, argv, "+host")) { … … 39 41 } 40 42 43 xhosts = NULL; 44 Nxhosts = 0; 45 NXHOSTS = 10; 46 while ((N = get_argument (argc, argv, "-xhost"))) { 47 if (xhosts == NULL) { 48 ALLOCATE (xhosts, char *, NXHOSTS); 49 } 50 remove_argument (N, &argc, argv); 51 xhosts[Nxhosts] = strcreate (argv[N]); 52 remove_argument (N, &argc, argv); 53 Nxhosts ++; 54 if (Nxhosts == NXHOSTS) { 55 NXHOSTS += 10; 56 REALLOCATE (xhosts, char *, NXHOSTS); 57 } 58 } 59 41 60 if (argc < 2) { 42 61 FREE (Host); … … 51 70 52 71 // a JobID < 0 mean the job was not accepted 53 JobID = AddJob (Host, Mode, Timeout, targc, targv );72 JobID = AddJob (Host, Mode, Timeout, targc, targv, Nxhosts, xhosts); 54 73 gprint (GP_LOG, "JobID: %d\n", (int) JobID); 55 74 return (TRUE); … … 57 76 usage: 58 77 gprint (GP_ERR, "USAGE: job [options] (arg0) (arg1) ... (argN)\n"); 59 gprint (GP_ERR, " options: -host, +host, -timeout \n");78 gprint (GP_ERR, " options: -host, +host, -timeout, -xhost (host)\n"); 60 79 gprint (GP_ERR, " arguments of the form @MAX_THREADS@ will be replaced when the job is launched\n"); 80 81 FREE (Host); 82 for (i = 0; i < Nxhosts; i++) { 83 FREE (xhosts[i]); 84 } 85 FREE (xhosts); 61 86 return (FALSE); 62 87 } -
trunk/Ohana/src/opihi/pcontrol/test/machines.sh
r28158 r29540 10 10 host add ipp022 11 11 host add ipp022 12 host add ipp002 13 host off ipp002 12 14 13 15 machines … … 23 25 job -host pikake sleep 10 24 26 job -host pikake sleep 10 27 end 28 29 macro load.xhost 30 job -host pikake -xhost ipp002 sleep 10 31 job -host pikake -xhost ipp002 sleep 10 32 job -host ipp022 -xhost ipp002 sleep 10 33 job -host ipp022 -xhost ipp002 sleep 10 34 job -host pikake -xhost ipp002 sleep 10 35 job -host pikake -xhost ipp002 sleep 10 36 job -host ipp022 -xhost ipp002 sleep 10 37 job -host ipp022 -xhost ipp002 sleep 10 38 end 39 40 macro load.2xhost 41 job -host pikake -xhost ipp002 -xhost ipp022 sleep 10 42 job -host pikake -xhost ipp002 -xhost ipp022 sleep 10 43 job -host ipp022 -xhost ipp002 -xhost ipp022 sleep 10 44 job -host ipp022 -xhost ipp002 -xhost ipp022 sleep 10 45 job -host pikake -xhost ipp002 -xhost ipp022 sleep 10 46 job -host pikake -xhost ipp002 -xhost ipp022 sleep 10 47 job -host ipp022 -xhost ipp002 -xhost ipp022 sleep 10 48 job -host ipp022 -xhost ipp002 -xhost ipp022 sleep 10 25 49 end 26 50
Note:
See TracChangeset
for help on using the changeset viewer.
