Changeset 33238
- Timestamp:
- Feb 10, 2012, 1:53:50 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src
- Files:
-
- 2 added
- 21 edited
-
addstar/src/resort_catalog.c (modified) (1 diff)
-
dvomerge/include/dvomerge.h (modified) (1 diff)
-
dvomerge/src/dvorepairCPT.c (modified) (1 diff)
-
dvomerge/src/dvorepairImageVsMeasure.c (modified) (1 diff)
-
elixir/include/elixir.h (modified) (1 diff)
-
elixir/src/MachineOps.c (modified) (1 diff)
-
elixir/src/RemoteOps.c (modified) (4 diffs)
-
elixir/src/SockScan.c (modified) (2 diffs)
-
elixir/src/rconnect.c (modified) (1 diff)
-
imregister/Makefile (modified) (1 diff)
-
imregister/imreg/SetSignals.c (modified) (2 diffs)
-
imregister/imreg/SockScan.c (modified) (2 diffs)
-
imregister/include/imreg.h (modified) (2 diffs)
-
libkapa/src/bDrawFuncs.c (modified) (1 diff)
-
libohana/Makefile (modified) (1 diff)
-
libohana/include/ohana.h (modified) (3 diffs)
-
libohana/src/memstr.c (added)
-
libohana/src/rconnect.c (added)
-
opihi/include/pcontrol.h (modified) (1 diff)
-
opihi/pcontrol/Makefile (modified) (1 diff)
-
opihi/pcontrol/StartHost.c (modified) (1 diff)
-
relastro/src/resort_catalog.c (modified) (1 diff)
-
tools/src/roc.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/addstar/src/resort_catalog.c
r31160 r33238 28 28 return; 29 29 } 30 31 # define myAbort(MSG) { fprintf (stderr, "%s\n", MSG); abort(); }32 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }33 30 34 31 // sort the measure Sequence based on the average Sequence entries -
branches/eam_branches/ipp-20111122/Ohana/src/dvomerge/include/dvomerge.h
r29938 r33238 16 16 # include <arpa/inet.h> 17 17 # include <glob.h> 18 19 # define myAbort(MSG) { fprintf (stderr, "%s\n", MSG); abort(); }20 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }21 18 22 19 int VERBOSE; -
branches/eam_branches/ipp-20111122/Ohana/src/dvomerge/src/dvorepairCPT.c
r29938 r33238 1 1 # include "dvomerge.h" 2 3 # define myAbort(MSG) { fprintf (stderr, "%s\n", MSG); abort(); }4 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }5 2 6 3 // broken cpt file, valid cpm file: we can recover everything in the cpt file from the cpm file: -
branches/eam_branches/ipp-20111122/Ohana/src/dvomerge/src/dvorepairImageVsMeasure.c
r29938 r33238 1 1 # include "dvomerge.h" 2 3 # define myAbort(MSG) { fprintf (stderr, "%s\n", MSG); abort(); }4 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }5 2 6 3 // find images which are missing detections: -
branches/eam_branches/ipp-20111122/Ohana/src/elixir/include/elixir.h
r21153 r33238 169 169 int WaitMsg (char *fifo, char **message, double maxdelay); 170 170 int WriteMsg (char *fifo, char *message); 171 int memstr (char *m1, char *m2, int n); 172 int rconnect (char *hostname, char *command, int *rsock, int *wsock); 173 void GetConfig (char *config, char *field, char *format, int N, void *ptr); 171 void GetConfig (char *config, char *field, char *format, int N, void *ptr); 172 int rconnect_elixir (char *hostname, char *command, int *rsock, int *wsock); -
branches/eam_branches/ipp-20111122/Ohana/src/elixir/src/MachineOps.c
r27588 r33238 202 202 char line[256]; 203 203 204 pid = rconnect (machine[0].hostname, CONNECT, &rsock, &wsock);204 pid = rconnect_elixir (machine[0].hostname, CONNECT, &rsock, &wsock); 205 205 if (pid) { 206 206 machine[0].rsock = rsock; -
branches/eam_branches/ipp-20111122/Ohana/src/elixir/src/RemoteOps.c
r27611 r33238 15 15 16 16 /* set signal to remote machine */ 17 if (!rconnect (machine, CONNECT, &rsock, &wsock)) {17 if (!rconnect_elixir (machine, CONNECT, &rsock, &wsock)) { 18 18 fprintf (stderr, "can't make connection to machine %s to kill process\n", machine); 19 19 exit (1); … … 47 47 48 48 /* send signal to remote machine */ 49 if (!rconnect (machine, CONNECT, &rsock, &wsock)) {49 if (!rconnect_elixir (machine, CONNECT, &rsock, &wsock)) { 50 50 fprintf (stderr, "can't make connection to machine %s to kill process\n", machine); 51 51 exit (1); … … 90 90 91 91 /* send signal to remote machine */ 92 if (!rconnect (machine, CONNECT, &rsock, &wsock)) {92 if (!rconnect_elixir (machine, CONNECT, &rsock, &wsock)) { 93 93 fprintf (stderr, "can't make connection to machine %s to signal process\n", machine); 94 94 exit (1); … … 151 151 152 152 /* make connection to remote machine */ 153 if (!rconnect (machine, CONNECT, &rsock, &wsock)) {153 if (!rconnect_elixir (machine, CONNECT, &rsock, &wsock)) { 154 154 fprintf (stderr, "can't make connection to machine %s to kill process\n", machine); 155 155 exit (1); -
branches/eam_branches/ipp-20111122/Ohana/src/elixir/src/SockScan.c
r10336 r33238 5 5 int SockScan (char *string, Fifo *fifo, int sock) { 6 6 7 int i, done, status; 7 int i, status; 8 char *done; 8 9 9 done = 0;10 for (i = 0; (i < MAXTIME) && !done; i++) {10 done = string; 11 for (i = 0; (i < MAXTIME) && (done != NULL); i++) { 11 12 ShiftFifo (fifo); 12 13 status = ReadtoFifo (fifo, sock); … … 24 25 return (status); 25 26 } 26 27 /* returns (offset to m2) + 1, or 0 if failure */28 int memstr (char *m1, char *m2, int n) {29 30 int i, N;31 32 N = strlen (m2);33 for (i = 0; (i < n - N + 1) && memcmp (m1, m2, N); i++, m1++);34 if (memcmp (m1, m2, N)) {35 return (0);36 }37 else {38 return (i+1);39 }40 41 }42 27 43 28 /* SockScan reads from the given socket looking for the given string -
branches/eam_branches/ipp-20111122/Ohana/src/elixir/src/rconnect.c
r27588 r33238 4 4 one for read, one for write */ 5 5 6 int rconnect (char *hostname, char *command, int *rsock, int *wsock) { 6 // this is a slightly different version than the one in libohana -- use a local name 7 int rconnect_elixir (char *hostname, char *command, int *rsock, int *wsock) { 7 8 8 9 int i, rfd[2], wfd[2], status; -
branches/eam_branches/ipp-20111122/Ohana/src/imregister/Makefile
r31496 r33238 65 65 $(IMREG)/ConfigPID.$(ARCH).o \ 66 66 $(IMREG)/SetSignals.$(ARCH).o \ 67 $(IMREG)/rconnect.$(ARCH).o \68 67 $(IMREG)/FifoOps.$(ARCH).o \ 69 68 $(IMREG)/SockScan.$(ARCH).o \ -
branches/eam_branches/ipp-20111122/Ohana/src/imregister/imreg/SetSignals.c
r27611 r33238 90 90 char username[256], machine[256]; 91 91 char line[512]; 92 int i, wsock, rsock;92 int i, iosock[3]; 93 93 struct stat filestat; 94 94 … … 99 99 100 100 /* send signal to remote machine */ 101 if (!rconnect (machine, CONNECT, &rsock, &wsock)) { 102 fprintf (stderr, "can't make connection to machine %s to kill process %d\n", machine, pid); 101 int errorInfo; 102 if (!rconnect (CONNECT, machine, "/bin/csh", iosock, &errorInfo, TRUE)) { 103 fprintf (stderr, "can't make connection to machine %s to kill process %d (error %d)\n", machine, pid, errorInfo); 103 104 exit (1); 104 105 } 105 106 sprintf (line, "kill -TERM %d\n", pid); 106 if (write ( wsock, line, strlen (line)) != strlen(line)) {107 if (write (iosock[0], line, strlen (line)) != strlen(line)) { 107 108 fprintf (stderr, "error sending signal\n"); 108 109 exit (1); -
branches/eam_branches/ipp-20111122/Ohana/src/imregister/imreg/SockScan.c
r76 r33238 6 6 int SockScan (char *string, Fifo *fifo, int sock) { 7 7 8 int i, done, status; 8 int i, status; 9 char *done; 9 10 10 done = 0;11 for (i = 0; (i < MAXTIME) && !done; i++) {11 done = string; 12 for (i = 0; (i < MAXTIME) && (done != NULL); i++) { 12 13 ShiftFifo (fifo); 13 14 status = ReadtoFifo (fifo, sock); … … 25 26 return (status); 26 27 } 27 28 /* returns (offset to m2) + 1, or 0 if failure */29 int memstr (char *m1, char *m2, int n) {30 31 int i, N;32 33 N = strlen (m2);34 for (i = 0; (i < n - N + 1) && memcmp (m1, m2, N); i++, m1++);35 if (memcmp (m1, m2, N)) {36 return (0);37 }38 else {39 return (i+1);40 }41 42 }43 28 44 29 /* SockScan reads from the given socket looking for the given string -
branches/eam_branches/ipp-20111122/Ohana/src/imregister/include/imreg.h
r27435 r33238 118 118 int Shutdown (int status); 119 119 void RemovePID (void); 120 int rconnect (char *hostname, char *command, int *rsock, int *wsock);121 120 122 121 int InitFifo (Fifo *fifo, int Nalloc, int Nextra); … … 126 125 void FreeFifo (Fifo *fifo); 127 126 int SockScan (char *string, Fifo *fifo, int sock); 128 int memstr (char *m1, char *m2, int n);129 127 130 128 off_t *unique_entries (RegImage *image, off_t Nimage, off_t *subset, off_t *Nmatch); -
branches/eam_branches/ipp-20111122/Ohana/src/libkapa/src/bDrawFuncs.c
r31663 r33238 1 1 # include <kapa_internal.h> 2 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort (); } }3 2 4 3 // move these to the bDrawBuffer type -
branches/eam_branches/ipp-20111122/Ohana/src/libohana/Makefile
r31663 r33238 38 38 $(SRC)/Fread.$(ARCH).o \ 39 39 $(SRC)/IOBufferOps.$(ARCH).o \ 40 $(SRC)/memstr.$(ARCH).o \ 41 $(SRC)/rconnect.$(ARCH).o \ 40 42 $(SRC)/CommOps.$(ARCH).o \ 41 43 $(SRC)/isolate_elements.$(ARCH).o \ -
branches/eam_branches/ipp-20111122/Ohana/src/libohana/include/ohana.h
r33217 r33238 215 215 */ 216 216 # define OHANA_WHITESPACE(c)(((c) == 0x09) || ((c) == 0x0a) || ((c) == 0x0b) || ((c) == 0x0b) || ((c) == 0x0c) || ((c) == 0x0d) || ((c) == 0x20)) 217 # define OHANA_ASSERT(LOGIC,...) { if (!(LOGIC)) { fprintf (stderr, __VA_ARGS__); abort(); } } 218 # define myAssert(LOGIC,...) { if (!(LOGIC)) { fprintf (stderr, __VA_ARGS__); abort(); } } 219 # define myAbort(MSG) { fprintf (stderr, "%s\n", MSG); abort(); } 217 220 218 221 // sorting is now defined as a macro call … … 328 331 off_t Fwrite PROTO((void *ptr, off_t size, off_t nitems, FILE *f, char *type)); 329 332 333 char *memstr PROTO((char *m1, char *m2, int n)); 334 int write_fmt PROTO((int fd, char *format, ...)); 335 330 336 char **isolate_elements PROTO((int argc, char **argv, int *nstack)); 331 337 … … 337 343 // gprint gets a stub implementation in libohana. opihi implements the real one. 338 344 int gprint (gpDest dest, char *format, ...); 345 346 // rconnect is used to run remote programs with a pipe for communication 347 typedef enum { 348 RCONNECT_ERR_NONE = 0, 349 RCONNECT_ERR_EXEC = 1, 350 RCONNECT_ERR_PIPE = 2, 351 RCONNECT_ERR_CONNECT = 3, 352 } RconnectErrors; 353 354 void rconnect_set_timeout (int timeout); 355 int rconnect (char *command, char *hostname, char *shell, int *stdio, int *errorInfo, int doHandshake); 339 356 340 357 /* -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/include/pcontrol.h
r32632 r33238 252 252 int CheckDoneJob (Job *job, Host *host); 253 253 int GetJobOutput (char *command, Host *host, JobOutput *output); 254 int rconnect (char *command, char *hostname, char *shell, int *stdio);255 254 256 255 int PclientCommand (Host *host, char *command, char *response, HostResp response_state); -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/pcontrol/Makefile
r26411 r33238 24 24 $(SRC)/init.$(ARCH).o \ 25 25 $(SRC)/pcontrol.$(ARCH).o \ 26 $(SRC)/rconnect.$(ARCH).o \27 26 $(SRC)/CheckBusyJob.$(ARCH).o \ 28 27 $(SRC)/CheckDoneHost.$(ARCH).o \ -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/pcontrol/StartHost.c
r28241 r33238 14 14 if (VarConfig ("SHELL", "%s", shell) == NULL) strcpy (shell, "pclient"); 15 15 16 if (VerboseMode()) gprint (GP_ERR, "starting host within thread\n");16 if (VerboseMode()) gprint (GP_ERR, "starting remote connection to %s...", host[0].hostname); 17 17 18 pid = rconnect (command, host[0].hostname, shell, stdio); 18 int errorInfo; 19 pid = rconnect (command, host[0].hostname, shell, stdio, &errorInfo, TRUE); 19 20 if (!pid) { 20 21 /** failure to start: extend retry period **/ 21 if (VerboseMode()) gprint (GP_ERR, "failure to start %s \n", host[0].hostname);22 if (VerboseMode()) gprint (GP_ERR, "failure to start %s (error %d)\n", host[0].hostname, errorInfo); 22 23 gettimeofday (&now, (void *) NULL); 23 24 if (ZTIME(host[0].next_start_try) || ZTIME(host[0].last_start_try)) { -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/resort_catalog.c
r32346 r33238 1 1 # include "relastro.h" 2 3 # define myAbort(MSG) { fprintf (stderr, "%s\n", MSG); abort(); }4 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }5 2 6 3 // sort the measure Sequence based on the average Sequence entries -
branches/eam_branches/ipp-20111122/Ohana/src/tools/src/roc.c
r32052 r33238 3 3 # include <sys/types.h> 4 4 # include <regex.h> 5 6 # define myAssert(LOGIC,...) { if (!(LOGIC)) { fprintf (stderr, __VA_ARGS__); exit(4); } }7 5 8 6 # define ROC_HEADER_SIZE 0x1000
Note:
See TracChangeset
for help on using the changeset viewer.
