Changeset 42897
- Timestamp:
- Jun 17, 2025, 4:31:01 PM (13 months ago)
- Location:
- tags/ipp-unions-20250528/Ohana/src/opihi
- Files:
-
- 2 added
- 13 edited
-
pantasks/Makefile (modified) (1 diff)
-
pantasks/controller.c (modified) (2 diffs)
-
pantasks/controller_hoststack.c (modified) (1 diff)
-
pantasks/controller_hoststats.c (added)
-
pcontrol/CheckSystem.c (modified) (1 diff)
-
pcontrol/GetJobOutput.c (modified) (4 diffs)
-
pcontrol/HostOps.c (modified) (1 diff)
-
pcontrol/Makefile (modified) (1 diff)
-
pcontrol/PclientCommand.c (modified) (3 diffs)
-
pcontrol/StackOps.c (modified) (8 diffs)
-
pcontrol/StartJob.c (modified) (3 diffs)
-
pcontrol/hoststack.c (modified) (1 diff)
-
pcontrol/hoststats.c (added)
-
pcontrol/init.c (modified) (2 diffs)
-
pcontrol/pcstats.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/Makefile
r42895 r42897 76 76 $(SRC)/controller_jobstack.$(ARCH).o \ 77 77 $(SRC)/controller_hoststack.$(ARCH).o \ 78 $(SRC)/controller_hoststats.$(ARCH).o \ 78 79 $(SRC)/controller_machines.$(ARCH).o \ 79 80 $(SRC)/controller_parameters.$(ARCH).o \ -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/controller.c
r42895 r42897 6 6 int controller_jobstack PROTO((int, char **)); 7 7 int controller_hoststack PROTO((int, char **)); 8 int controller_hoststats PROTO((int, char **)); 8 9 int controller_machines PROTO((int, char **)); 9 10 int controller_parameters PROTO((int, char **)); … … 23 24 {1, "host", controller_host, "define host for controller"}, 24 25 {1, "hoststack", controller_hoststack, "define host for controller"}, 26 {1, "hoststats", controller_hoststats, "show processing stats for each host"}, 25 27 // {1, "job", controller_job, "add jobs to controller"}, 26 28 {1, "jobstack", controller_jobstack, "check controller status"}, -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/controller_hoststack.c
r42895 r42897 9 9 if (argc != 2) { 10 10 gprint (GP_ERR, "USAGE: controller hoststack (hoststack)\n"); 11 gprint (GP_ERR, " (hoststack) : idle, busy, done, down, off\n");11 gprint (GP_ERR, " (hoststack) : all, idle, busy, done, down, off, resp\n"); 12 12 return (FALSE); 13 13 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/CheckSystem.c
r42895 r42897 131 131 CheckLiveHosts(0.040); 132 132 // fprintf (stderr, "sleep a bit\n"); 133 usleep (10000 0); // idle if no jobs are waiting133 usleep (10000); // idle if no jobs are waiting 134 134 } else { 135 135 // if we only have busy jobs, pause a moment before trying again 136 136 if (!Ndonejobs) { 137 137 // fprintf (stderr, "sleep a bit\n"); 138 usleep (10000 0);138 usleep (10000); 139 139 } 140 140 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/GetJobOutput.c
r20047 r42897 12 12 int i, status; 13 13 struct timespec request, remain; 14 15 struct timeval start; 16 gettimeofday (&start, (void *) NULL); 14 17 15 18 ASSERT (command, "command missing"); … … 30 33 } 31 34 32 if (output[0].completed) return PCLIENT_GOOD; 35 if (output[0].completed) { 36 struct timeval stop; 37 gettimeofday (&stop, (void *) NULL); 38 39 float dtime = DTIME (stop, start); 40 host[0].read_time += dtime; 41 host[0].read_N_GetJobOutput ++; 42 return PCLIENT_GOOD; 43 } 33 44 34 45 // attempt to read the output->size bytes from the host … … 42 53 if (status == 0) { 43 54 if (VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname); 55 struct timeval stop; 56 gettimeofday (&stop, (void *) NULL); 57 58 float dtime = DTIME (stop, start); 59 host[0].read_time += dtime; 60 host[0].read_N_GetJobOutput ++; 44 61 return PCLIENT_DOWN; 45 62 } 46 63 if (output[0].buffer.Nbuffer < output[0].size) { 47 64 if (VerboseMode()) gprint (GP_ERR, "host %s still has data, keep trying\n", host[0].hostname); 65 struct timeval stop; 66 gettimeofday (&stop, (void *) NULL); 67 68 float dtime = DTIME (stop, start); 69 host[0].read_time += dtime; 70 host[0].read_N_GetJobOutput ++; 48 71 return PCLIENT_HUNG; 49 72 } … … 61 84 if (status == 0) { 62 85 if (VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname); 86 87 struct timeval stop; 88 gettimeofday (&stop, (void *) NULL); 89 90 float dtime = DTIME (stop, start); 91 host[0].read_time += dtime; 92 host[0].read_N_GetJobOutput ++; 93 63 94 return PCLIENT_DOWN; 64 95 } 65 96 if (line == NULL) { 66 97 if (VerboseMode()) gprint (GP_ERR, "host %s not yet at prompt, keep trying\n", host[0].hostname); 98 99 struct timeval stop; 100 gettimeofday (&stop, (void *) NULL); 101 102 float dtime = DTIME (stop, start); 103 host[0].read_time += dtime; 104 host[0].read_N_GetJobOutput ++; 105 67 106 return PCLIENT_HUNG; 68 107 } 108 109 struct timeval stop; 110 gettimeofday (&stop, (void *) NULL); 111 112 float dtime = DTIME (stop, start); 113 host[0].read_time += dtime; 114 host[0].read_N_GetJobOutput ++; 69 115 70 116 output[0].completed = TRUE; -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/HostOps.c
r34844 r42897 211 211 host[0].response = NULL; 212 212 213 host[0].read_time = 0.0; 214 host[0].read_N_Pclient = 0; 215 host[0].read_N_GetJobOutput = 0; 216 host[0].N_jobs_total = 0; 217 213 218 host[0].markoff = FALSE; 214 219 host[0].job = NULL; -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/Makefile
r42895 r42897 51 51 $(SRC)/jobstack.$(ARCH).o \ 52 52 $(SRC)/hoststack.$(ARCH).o \ 53 $(SRC)/hoststats.$(ARCH).o \ 53 54 $(SRC)/kill.$(ARCH).o \ 54 55 $(SRC)/pulse.$(ARCH).o \ -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/PclientCommand.c
r37070 r42897 45 45 struct timespec request, remain; 46 46 47 struct timeval start; 48 gettimeofday (&start, (void *) NULL); 49 47 50 ASSERT (response != NULL, "response missing"); 48 51 ASSERT (buffer != NULL, "buffer missing"); … … 64 67 if (status == -1) nanosleep (&request, &remain); 65 68 } 69 70 struct timeval stop; 71 gettimeofday (&stop, (void *) NULL); 72 73 float dtime = DTIME (stop, start); 74 host[0].read_time += dtime; 75 host[0].read_N_Pclient ++; 76 66 77 if (status == 0) { 67 78 gprint (GP_ERR, "pclient read returns 0 for %s\n", response); … … 69 80 } 70 81 if (line == NULL) { 71 // MARKTIME ("-- client hung (line NULL): %s : %f sec\n", host[0].hostname, dtime); 72 return (PCLIENT_HUNG); 82 // this is really a timeout: data was received, but not the full message, in the allotted time (0.1 sec), 83 // MARKTIME ("-- client hung (line NULL): %s : %f sec\n", host[0].hostname, dtime); 84 return (PCLIENT_HUNG); 73 85 } 74 86 if (status == -1) { 75 // MARKTIME ("-- client hung (status -1): %s : %f sec\n", host[0].hostname, dtime); 76 return (PCLIENT_HUNG); 87 // this is really a timeout: no response was received in the allotted time (0.1 sec), 88 // MARKTIME ("-- client hung (status -1): %s : %f sec\n", host[0].hostname, dtime); 89 return (PCLIENT_HUNG); 77 90 } 78 91 -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/StackOps.c
r39457 r42897 52 52 /* this code correctly handles the negative 'where' and Nobject == 0 */ 53 53 54 static int Np_PushStack = 0; 55 static float dT_PushStack = 0.0; 56 57 void Stats_PushStack (int reset) { 58 59 gprint (GP_LOG, "CPS: Npass: %d, time: %f\n", Np_PushStack, dT_PushStack); 60 61 if (reset) { 62 Np_PushStack = 0; 63 dT_PushStack = 0.0; 64 } 65 } 66 54 67 /* push object on stack at given location */ 55 68 int PushStack (Stack *stack, int where, void *object, int id, char *name) { … … 60 73 ASSERT (stack != NULL, "stack not set"); 61 74 LockStack (stack); 75 76 struct timeval start, stop; 77 gettimeofday (&start, (void *) NULL); 62 78 63 79 if (where < 0) where += stack[0].Nobject + 1; … … 89 105 stack[0].Nobject ++; 90 106 107 gettimeofday (&stop, (void *) NULL); 108 float dtime = DTIME (stop, start); 109 dT_PushStack += dtime; 110 Np_PushStack ++; 111 91 112 UnlockStack (stack); 92 113 return (TRUE); 93 114 } 94 115 116 static int Np_PullStackLoc = 0; 117 static float dT_PullStackLoc = 0.0; 118 119 void Stats_PullStackLoc (int reset) { 120 121 gprint (GP_LOG, "CLS: Npass: %d, time: %f\n", Np_PullStackLoc, dT_PullStackLoc); 122 123 if (reset) { 124 Np_PullStackLoc = 0; 125 dT_PullStackLoc = 0.0; 126 } 127 } 128 95 129 /* get object from specified point in stack (negative == distance from end) */ 96 130 void *PullStackByLocation (Stack *stack, int where) { … … 102 136 LockStack (stack); 103 137 138 struct timeval start, stop; 139 gettimeofday (&start, (void *) NULL); 140 104 141 if (where < 0) where += stack[0].Nobject; 105 142 if (where < 0) { … … 114 151 object = stack[0].object[where]; 115 152 RemoveStackEntry (stack, where); 153 154 gettimeofday (&stop, (void *) NULL); 155 float dtime = DTIME (stop, start); 156 dT_PullStackLoc += dtime; 157 Np_PullStackLoc ++; 158 116 159 UnlockStack (stack); 117 160 return (object); … … 141 184 } 142 185 186 static int Np_PullStack = 0; 187 static float dT_PullStack = 0.0; 188 189 void Stats_PullStack (int reset) { 190 191 gprint (GP_LOG, "CpS: Npass: %d, time: %f\n", Np_PullStack, dT_PullStack); 192 193 if (reset) { 194 Np_PullStack = 0; 195 dT_PullStack = 0.0; 196 } 197 } 198 143 199 /* get object from point in stack (negative == distance from end) */ 144 200 void *PullStackByID (Stack *stack, int id) { … … 150 206 ASSERT (stack != NULL, "stack not set"); 151 207 LockStack (stack); 208 209 struct timeval start, stop; 210 gettimeofday (&start, (void *) NULL); 152 211 153 212 for (i = 0; i < stack[0].Nobject; i++) { … … 157 216 object = stack[0].object[i]; 158 217 RemoveStackEntry (stack, i); 218 219 gettimeofday (&stop, (void *) NULL); 220 float dtime = DTIME (stop, start); 221 dT_PullStack += dtime; 222 Np_PullStack ++; 223 159 224 UnlockStack (stack); 160 225 return (object); 161 226 } 227 228 gettimeofday (&stop, (void *) NULL); 229 float dtime = DTIME (stop, start); 230 dT_PullStack += dtime; 231 Np_PullStack ++; 232 162 233 UnlockStack (stack); 163 234 return (NULL); -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/StartJob.c
r36623 r42897 62 62 job[0].pid = -1; 63 63 gettimeofday (&job[0].start, (void *) NULL); 64 host[0].N_jobs_total ++; 64 65 65 66 if (VerboseMode()) gprint (GP_ERR, "started job on host %s\n", host[0].hostname); … … 95 96 PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM); 96 97 PutJob (job, PCONTROL_JOB_BUSY, STACK_BOTTOM); 97 gettimeofday (&job[0].start, NULL); 98 // XXX this time stamp overrides the original start of the command, in StartJob 99 // gettimeofday (&job[0].start, NULL); 98 100 return (TRUE); 99 101 } … … 122 124 PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM); 123 125 PutJob (job, PCONTROL_JOB_BUSY, STACK_BOTTOM); 124 gettimeofday (&job[0].start, NULL); 126 // XXX this time stamp overrides the original start of the command, in StartJob 127 // gettimeofday (&job[0].start, NULL); 125 128 return (TRUE); 126 129 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/hoststack.c
r8296 r42897 9 9 if (argc != 2) { 10 10 gprint (GP_ERR, "USAGE: hoststack (hoststack)\n"); 11 gprint (GP_ERR, " (hoststack) : idle, busy, done, down, off\n");11 gprint (GP_ERR, " (hoststack) : all, idle, busy, done, down, off, resp\n"); 12 12 return (FALSE); 13 13 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/init.c
r42895 r42897 5 5 int host PROTO((int, char **)); 6 6 int hoststack PROTO((int, char **)); 7 int hoststats PROTO((int, char **)); 7 8 int job PROTO((int, char **)); 8 9 int jobstack PROTO((int, char **)); … … 26 27 {1, "host", host, "add / delete / modify host"}, 27 28 {1, "hoststack", hoststack, "list hosts for a single stack"}, 29 {1, "hoststats", hoststats, "list host statistics for a single stack"}, 28 30 {1, "job", job, "add job"}, 29 31 {1, "jobstack", jobstack, "list jobs for a single stack"}, -
tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/pcstats.c
r42895 r42897 26 26 Stats_CheckLiveHosts (Reset); 27 27 28 Stats_PushStack (Reset); 29 Stats_PullStack (Reset); 30 Stats_PullStackLoc (Reset); 31 28 32 return (TRUE); 29 33
Note:
See TracChangeset
for help on using the changeset viewer.
