Changeset 42886
- Timestamp:
- Jun 3, 2025, 5:02:21 PM (14 months ago)
- Location:
- tags/ipp-unions-20250528/Ohana/src/opihi/pantasks
- Files:
-
- 1 added
- 8 edited
-
CheckController.c (modified) (4 diffs)
-
CheckJobs.c (modified) (3 diffs)
-
CheckTasks.c (modified) (7 diffs)
-
ControllerOps.c (modified) (3 diffs)
-
JobOps.c (modified) (1 diff)
-
Makefile (modified) (2 diffs)
-
init.c (modified) (2 diffs)
-
init_server.c (modified) (2 diffs)
-
ptstats.c (added)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/CheckController.c
r40424 r42886 1 1 # include "pantasks.h" 2 2 3 void TimerMark (struct timeval *start); 4 float TimerElapsed (struct timeval *start, int reset); 3 static int NjobsTotalSum = 0; 4 static int NpassTotalSum = 0; 5 static float NtimeTotalSum = 0.0; 6 7 void CheckControllerStats (int reset) { 8 9 gprint (GP_LOG, "CC: Npass: %d, Njobs: %d, rate: %f\n", 10 NpassTotalSum, NjobsTotalSum, NjobsTotalSum / NtimeTotalSum); 11 12 if (reset) { 13 NjobsTotalSum = 0; 14 NpassTotalSum = 0; 15 NtimeTotalSum = 0.0; 16 } 17 } 5 18 6 19 int CheckController () { … … 11 24 Job *job; 12 25 IOBuffer buffer; 13 struct timeval start;14 26 15 27 /* get the list of completed jobs (exit / crash), update the job status */ 16 28 if (!CheckControllerStatus()) return (TRUE); 17 29 30 // count the number of times this function was called while controller was active 31 NpassTotalSum ++; 32 18 33 /*** check EXIT jobs ***/ 19 34 InitIOBuffer (&buffer, 0x100); 20 35 36 struct timeval start; 21 37 TimerMark (&start); 22 38 FlushIOBuffer (&buffer); … … 79 95 if (VerboseMode()) gprint (GP_ERR, "clear %d exit jobs %f\n", i, TimerElapsed(&start, TRUE)); 80 96 97 // track the number of jobs actually cleared (might not equal number in the list) 98 int NjobsExit = i; 99 81 100 /*** check CRASH jobs ***/ 82 101 FlushIOBuffer (&buffer); … … 130 149 if (VerboseMode()) gprint (GP_ERR, "clear %d crash jobs %f\n", i, TimerElapsed(&start, TRUE)); 131 150 151 // add in the crash jobs actually cleared (i, not Njobs) and increment the time 152 NjobsTotalSum += i + NjobsExit; 153 NtimeTotalSum += TimerElapsed(&start, TRUE); 154 132 155 FlushIOBuffer (&buffer); 133 156 FreeIOBuffer (&buffer); -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/CheckJobs.c
r38986 r42886 1 1 # include "pantasks.h" 2 2 static int Ncheck = 0; 3 4 static int NjobsTotalSum = 0; 5 static int NpassTotalSum = 0; 6 static float NtimeTotalSum = 0.0; 7 8 void CheckJobsStats (int reset) { 9 10 gprint (GP_LOG, "CJ: Npass: %d, Njobs: %d, rate: %f\n", 11 NpassTotalSum, NjobsTotalSum, NjobsTotalSum / NtimeTotalSum); 12 13 if (reset) { 14 NjobsTotalSum = 0; 15 NpassTotalSum = 0; 16 NtimeTotalSum = 0.0; 17 } 18 } 3 19 4 20 float CheckJobs () { … … 15 31 Ncheck ++; 16 32 33 // count the number of times this function was called while controller was active 34 NpassTotalSum ++; 35 36 struct timeval start; 37 TimerMark (&start); 38 17 39 // actual maximum delay is controlled in job_threads.c 18 40 next_timeout = 1.0; 41 42 int NjobsCheck = 0; 19 43 20 44 JobTaskLock(); 21 45 /** test all jobs: ready to test? finished? **/ 22 46 while ((job = NextJob ()) != NULL) { 47 NjobsCheck ++; 23 48 24 49 task = job[0].task; … … 221 246 222 247 JobTaskUnlock(); 248 249 NjobsTotalSum += NjobsCheck; 250 NtimeTotalSum += TimerElapsed(&start, TRUE); 251 223 252 return (next_timeout); 224 253 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/CheckTasks.c
r41483 r42886 1 1 # include "pantasks.h" 2 2 static int Ncheck = 0; 3 4 static int NtaskTotalSum = 0; 5 static int NpassTotalSum = 0; 6 static float NtimeTotalSum = 0.0; 7 8 void CheckTasksStats (int reset) { 9 10 gprint (GP_LOG, "CT: Npass: %d, Ntask: %d, rate: %f\n", 11 NpassTotalSum, NtaskTotalSum, NtaskTotalSum / NtimeTotalSum); 12 13 if (reset) { 14 NtaskTotalSum = 0; 15 NpassTotalSum = 0; 16 NtimeTotalSum = 0.0; 17 } 18 } 3 19 4 20 float CheckTasks () { … … 11 27 Ncheck ++; 12 28 29 // count the number of times this function was called while controller was active 30 NpassTotalSum ++; 31 32 struct timeval start; 33 TimerMark (&start); 34 13 35 // actual maximum delay is controlled in job_threads.c 14 36 next_timeout = 1.0; 37 38 int NtaskCheck = 0; 15 39 16 40 JobTaskLock(); 17 41 /** test all tasks: ready to test? ready to run? **/ 18 42 while ((task = NextTask ()) != NULL) { 43 NtaskCheck ++; 19 44 20 45 /*** test for all reasons we should skip this task ***/ … … 60 85 JobTaskUnlock(); 61 86 CommandLock(); 87 // XXX measure time to execute this loop? 62 88 status = exec_loop (task[0].exec); 63 89 CommandUnlock(); … … 71 97 /* check if there are errors with this task */ 72 98 if (!ValidateTask (task, TRUE)) { 99 // XXX increment Nskipexec here? If we skip because the task.exec did not generate a valid 100 // command + host, then we need to know... 73 101 continue; 74 102 } … … 77 105 job = CreateJob (task); 78 106 if (!job) { 107 // this failure should not happen : jobID is not valid, probably a programming error 79 108 continue; 80 109 } … … 84 113 /* execute job */ 85 114 if (!SubmitJob (job)) { 115 // this can only fail if there is a communication error with the controller, or if pcontrol cannot 116 // start, or if the host is not defined (but that is required to define a job on the controller) 86 117 DeleteJob (job); 87 118 continue; … … 93 124 } 94 125 JobTaskUnlock(); 126 127 NtaskTotalSum += NtaskCheck; 128 NtimeTotalSum += TimerElapsed(&start, TRUE); 129 95 130 return (next_timeout); 96 131 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/ControllerOps.c
r36623 r42886 481 481 } 482 482 483 static int NreadTotalSum = 0; 484 static int NpassTotalSum = 0; 485 static float NtimeTotalSum = 0.0; 486 487 void CheckControllerOutputStats (int reset) { 488 489 gprint (GP_LOG, "CO: Npass: %d, Nread: %d, rate: %f\n", 490 NpassTotalSum, NreadTotalSum, NreadTotalSum / NtimeTotalSum); 491 492 if (reset) { 493 NreadTotalSum = 0; 494 NpassTotalSum = 0; 495 NtimeTotalSum = 0.0; 496 } 497 } 498 483 499 int CheckControllerOutput () { 484 500 … … 486 502 487 503 if (!ControllerStatus) return (TRUE); 504 505 struct timeval start; 506 TimerMark (&start); 507 508 // count the number of times this function was called while controller was active 509 NpassTotalSum ++; 488 510 489 511 /* read stdout buffer */ … … 510 532 break; 511 533 } 534 535 NreadTotalSum += stdout_buffer.Nbuffer + stderr_buffer.Nbuffer; 536 NtimeTotalSum += TimerElapsed(&start, TRUE); 537 512 538 return (TRUE); 513 539 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/JobOps.c
r40424 r42886 101 101 if (job[0].JobID < 0) { 102 102 free (job); 103 fprintf (stderr, "invalid JobID, programming error?\n"); 103 104 return NULL; 104 105 } -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/Makefile
r41341 r42886 32 32 $(SRC)/run.$(ARCH).o \ 33 33 $(SRC)/stop.$(ARCH).o \ 34 $(SRC)/ptstats.$(ARCH).o \ 34 35 $(SRC)/pantasks.$(ARCH).o \ 35 36 $(SRC)/thread_locks.$(ARCH).o \ … … 43 44 $(SRC)/server.$(ARCH).o \ 44 45 $(SRC)/status_server.$(ARCH).o \ 46 $(SRC)/ptstats.$(ARCH).o \ 45 47 $(SRC)/init_server.$(ARCH).o \ 46 48 $(SRC)/CheckPassword.$(ARCH).o \ -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/init.c
r41341 r42886 25 25 int verbose PROTO((int, char **)); 26 26 int version PROTO((int, char **)); 27 int ptstats PROTO((int, char **)); 27 28 28 29 static Command cmds[] = { … … 41 42 {1, "run", run, "run the scheduler"}, 42 43 {1, "flush", flush_jobs, "flush all jobs from the queue"}, 44 {1, "ptstats", ptstats, "show pantasks througput stats"}, 43 45 {1, "showtask", showtask, "list a task"}, 44 46 {1, "status", status_sys, "get system or task status"}, -
tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/init_server.c
r41341 r42886 22 22 int verbose PROTO((int, char **)); 23 23 int version PROTO((int, char **)); 24 int ptstats PROTO((int, char **)); 25 24 26 int server PROTO((int, char **)); 25 27 … … 40 42 {1, "npending", task_npending, "define maximum number of outstanding jobs for a task"}, 41 43 {1, "periods", task_periods, "define time scales for a task"}, 44 {1, "ptstats", ptstats, "show pantasks througput stats"}, 42 45 {1, "flush", flush_jobs, "flush all jobs from the queue"}, 43 46 {1, "server", server, "server-specific commands"},
Note:
See TracChangeset
for help on using the changeset viewer.
