IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 8, 2011, 2:54:20 PM (15 years ago)
Author:
eugene
Message:

add nice ability to pantasks/pcontrol/pclient; add ports to pantasks_server; minor updates to dvo skycoverage, etc

Location:
trunk/Ohana/src/opihi/pcontrol
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c

    r29540 r32632  
    55// a (temporary?) work-around for the problem that the remote pclient job tends to grow
    66// 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 ****/
    730
    831static float MAX_WANTHOST_WAIT = 10.0;
  • trunk/Ohana/src/opihi/pcontrol/JobOps.c

    r29540 r32632  
    195195}
    196196
    197 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv, int Nxhosts, char **xhosts) {
     197IDtype AddJob (char *hostname, JobMode mode, int timeout, int priority, int argc, char **argv, int Nxhosts, char **xhosts) {
    198198
    199199  int JobID;
     
    220220
    221221  job[0].mode     = mode;
     222  job[0].priority = priority;
    222223
    223224  job[0].state = 0;
     
    270271  FREE (job);
    271272}
     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
     278void 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  
    2525  bzero (line, Nline);
    2626  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  }
    2732  for (i = 0; i < job[0].argc; i++) {
    2833    strcat (line, " ");
  • trunk/Ohana/src/opihi/pcontrol/job.c

    r29558 r32632  
    55  char *Host = NULL;
    66  char **targv = NULL;
    7   int i, N, Mode, targc, Timeout;
     7  int i, N, Mode, targc, Timeout, priority;
    88  IDtype JobID;
    99  char **xhosts = NULL;
     
    4343  }
    4444
     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
    4552  xhosts = NULL;
    4653  Nxhosts = 0;
     
    6067  }
    6168
    62   if (argc < 2) {
    63     FREE (Host);
    64     goto usage;
    65   }
     69  if (argc < 2) goto usage;
    6670 
    6771  targc = argc - 1;
     
    7276
    7377  // 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);
    7579  gprint (GP_LOG, "JobID: %d\n", (int) JobID);
    7680  return (TRUE);
  • trunk/Ohana/src/opihi/pcontrol/status.c

    r21379 r32632  
    5959    }
    6060
     61    PrintID (GP_LOG, job[0].JobID);
     62    gprint (GP_LOG, " %2d ", job[0].priority);
    6163    for (j = 0; j < job[0].argc; j++) {
    6264      gprint (GP_LOG, "%s ", job[0].argv[j]);
    6365    }
    64     PrintID (GP_LOG, job[0].JobID);
    6566    gprint (GP_LOG, "\n");
    6667  }
Note: See TracChangeset for help on using the changeset viewer.