Changeset 32632 for trunk/Ohana/src/opihi/pcontrol
- Timestamp:
- Nov 8, 2011, 2:54:20 PM (15 years ago)
- Location:
- trunk/Ohana/src/opihi/pcontrol
- Files:
-
- 5 edited
- 1 copied
-
CheckIdleHost.c (modified) (1 diff)
-
JobOps.c (modified) (3 diffs)
-
StackOpsLL.c (copied) (copied from branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/StackOpsLL.c )
-
StartJob.c (modified) (1 diff)
-
job.c (modified) (4 diffs)
-
status.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c
r29540 r32632 5 5 // a (temporary?) work-around for the problem that the remote pclient job tends to grow 6 6 // too large over time. 7 8 /**** 9 10 queueing strategy: 11 12 We have a problem when the queue contains many jobs of different processing times. If we 13 start with an equal number of jobs in two classes, fast and slow, eventually, we will end 14 up with all hosts running the slow jobs and the fast jobs completely blocked. If J1 takes 15 T1 and J2 takes T2, and jobs have equal probability to land in a slot... ?? 16 17 It seems like we should boost the probability of the fast jobs over the slow jobs (of 18 course, the end result of that will be all fast jobs draining and the slow jobs hanging 19 around). 20 21 There is also a problem related to LAP, in that chip stage has a huge number of tasks in 22 the queue (effectively infinite). Make the probability of the job being selected 23 proportional to something. In any case, we need a user-controllable way to change the 24 probability of selection 25 26 As things are implemented below, the selection order depends on the queue order. The 27 easiest way to modify the probabilities is to re-sort based on something. 28 29 ****/ 7 30 8 31 static float MAX_WANTHOST_WAIT = 10.0; -
trunk/Ohana/src/opihi/pcontrol/JobOps.c
r29540 r32632 195 195 } 196 196 197 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv, int Nxhosts, char **xhosts) {197 IDtype AddJob (char *hostname, JobMode mode, int timeout, int priority, int argc, char **argv, int Nxhosts, char **xhosts) { 198 198 199 199 int JobID; … … 220 220 221 221 job[0].mode = mode; 222 job[0].priority = priority; 222 223 223 224 job[0].state = 0; … … 270 271 FREE (job); 271 272 } 273 274 /*** ResortJobStack can be used to adjust priorities based on some info we supply. This 275 is not finished -- to finish this, I need to define the metric of interest and 276 arrange for that to be passed to the jobs in pcontrol 277 278 void ResortJobStack (int StackID) { 279 280 Stack *stack = GetJobStack (StackID); 281 LockStack (stack); 282 283 # define SWAPFUNC(A,B){ \ 284 void *tmpObject = stack[0].object[A]; \ 285 stack[0].object[A] = stack[0].object[B]; \ 286 stack[0].object[B] = tmpObject; \ 287 void *tmpName = stack[0].name[A]; \ 288 stack[0].name[A] = stack[0].name[B]; \ 289 stack[0].name[B] = tmpName; \ 290 void *tmpID = stack[0].id[A]; \ 291 stack[0].id[A] = stack[0].id[B]; \ 292 stack[0].id[B] = tmpID; \ 293 } 294 295 # define COMPARE(A,B)(((Job *)stack[0].object[A]).VALUE < ((Job *)stack[0].object[B]).VALUE) 296 297 OHANA_SORT (stack[0].Nobject, COMPARE, SWAPFUNC); 298 299 # undef SWAPFUNC 300 # undef COMPARE 301 302 UnlockStack (stack); 303 } 304 305 ***/ -
trunk/Ohana/src/opihi/pcontrol/StartJob.c
r28317 r32632 25 25 bzero (line, Nline); 26 26 strcpy (line, "job"); 27 if (job[0].priority) { 28 char tmp[64]; 29 snprintf (tmp, 64, " -nice %d", job[0].priority); 30 strcat (line, tmp); 31 } 27 32 for (i = 0; i < job[0].argc; i++) { 28 33 strcat (line, " "); -
trunk/Ohana/src/opihi/pcontrol/job.c
r29558 r32632 5 5 char *Host = NULL; 6 6 char **targv = NULL; 7 int i, N, Mode, targc, Timeout ;7 int i, N, Mode, targc, Timeout, priority; 8 8 IDtype JobID; 9 9 char **xhosts = NULL; … … 43 43 } 44 44 45 priority = 0; 46 if ((N = get_argument (argc, argv, "-nice"))) { 47 remove_argument (N, &argc, argv); 48 priority = atoi (argv[N]); 49 remove_argument (N, &argc, argv); 50 } 51 45 52 xhosts = NULL; 46 53 Nxhosts = 0; … … 60 67 } 61 68 62 if (argc < 2) { 63 FREE (Host); 64 goto usage; 65 } 69 if (argc < 2) goto usage; 66 70 67 71 targc = argc - 1; … … 72 76 73 77 // a JobID < 0 mean the job was not accepted 74 JobID = AddJob (Host, Mode, Timeout, targc, targv, Nxhosts, xhosts);78 JobID = AddJob (Host, Mode, Timeout, priority, targc, targv, Nxhosts, xhosts); 75 79 gprint (GP_LOG, "JobID: %d\n", (int) JobID); 76 80 return (TRUE); -
trunk/Ohana/src/opihi/pcontrol/status.c
r21379 r32632 59 59 } 60 60 61 PrintID (GP_LOG, job[0].JobID); 62 gprint (GP_LOG, " %2d ", job[0].priority); 61 63 for (j = 0; j < job[0].argc; j++) { 62 64 gprint (GP_LOG, "%s ", job[0].argv[j]); 63 65 } 64 PrintID (GP_LOG, job[0].JobID);65 66 gprint (GP_LOG, "\n"); 66 67 }
Note:
See TracChangeset
for help on using the changeset viewer.
