IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32585


Ignore:
Timestamp:
Oct 28, 2011, 10:06:45 AM (15 years ago)
Author:
eugene
Message:

add nice levels to pantasks / pcontrol / pclient

Location:
branches/eam_branches/ipp-20110906/Ohana/src/opihi
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/include/pantasks.h

    r32584 r32585  
    4040      TASK_END,
    4141      TASK_HOST,
     42      TASK_NICE,
    4243      TASK_STDOUT,
    4344      TASK_STDERR,
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/Makefile

    r27995 r32585  
    8383$(SRC)/task.$(ARCH).o \
    8484$(SRC)/task_host.$(ARCH).o \
     85$(SRC)/task_nice.$(ARCH).o \
    8586$(SRC)/task_nmax.$(ARCH).o \
    8687$(SRC)/task_active.$(ARCH).o \
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/TaskOps.c

    r32584 r32585  
    596596  if (!strcasecmp (command, "END"))       hash = TASK_END;
    597597  if (!strcasecmp (command, "HOST"))      hash = TASK_HOST;
     598  if (!strcasecmp (command, "NICE"))      hash = TASK_NICE;
    598599  if (!strcasecmp (command, "NMAX"))      hash = TASK_NMAX;
    599600  if (!strcasecmp (command, "ACTIVE"))    hash = TASK_ACTIVE;
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init.c

    r23530 r32585  
    44int task            PROTO((int, char **));
    55int task_host       PROTO((int, char **));
     6int task_nice       PROTO((int, char **));
    67int task_nmax       PROTO((int, char **));
    78int task_npending   PROTO((int, char **));
     
    3334  {1, "halt",       halt,          "halt the scheduler (no job harvesting)"},
    3435  {1, "host",       task_host,     "define host machine for a task"},
     36  {1, "nice",       task_nice,     "set nice priority level for a task"},
    3537  {1, "ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
    3638  {1, "kill",       kill_job,      "kill job"},
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init_server.c

    r23530 r32585  
    3434  {1, "delete",     delete_job,    "delete job"},
    3535  {1, "host",       task_host,     "define host machine for a task"},
     36  {1, "nice",       task_nice,     "set nice priority level for a task"},
    3637  {1, "ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
    3738  {1, "kill",       kill_job,      "kill job"},
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task.c

    r31666 r32585  
    7272      case TASK_NMAX:
    7373      case TASK_HOST:
     74      case TASK_NICE:
    7475      case TASK_EXIT:
    7576      case TASK_EXEC:
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task_nice.c

    r32584 r32585  
    77  Task *task;
    88
    9   if (argc != 3) {
     9  if (argc != 2) {
    1010    gprint (GP_ERR, "USAGE: nice (priority)\n");
    1111    return (FALSE);
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pclient/job.c

    r32584 r32585  
    33int job (int argc, char **argv) {
    44
    5   int i, pid, status, priority;
     5  int i, N, pid, status, priority;
    66  char **targv;
    77
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/JobOps.c

    r32584 r32585  
    272272}
    273273
     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
    274278void ResortJobStack (int StackID) {
    275279
     
    277281  LockStack (stack);
    278282
    279 # define SWAPFUNC(A,B){ \
    280   void *tmpObject = stack[0].object[A]; \
    281   stack[0].object[A] = stack[0].object[B]; \
    282   stack[0].object[B] = tmpObject; \
    283   void *tmpName = stack[0].name[A]; \
    284   stack[0].name[A] = stack[0].name[B]; \
    285   stack[0].name[B] = tmpName; \
    286   void *tmpID = stack[0].id[A]; \
    287   stack[0].id[A] = stack[0].id[B]; \
    288   stack[0].id[B] = tmpID; \
    289 }
     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  }
    290294
    291295# define COMPARE(A,B)(((Job *)stack[0].object[A]).VALUE < ((Job *)stack[0].object[B]).VALUE)
    292296
    293   OHANA_SORT (N, COMPARE, SWAPFUNC);
     297  OHANA_SORT (stack[0].Nobject, COMPARE, SWAPFUNC);
    294298
    295299# undef SWAPFUNC
     
    298302  UnlockStack (stack);
    299303}
     304
     305***/
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/job.c

    r32584 r32585  
    6767  }
    6868
    69   if (argc < 2) {
    70     FREE (Host);
    71     goto usage;
    72   }
     69  if (argc < 2) goto usage;
    7370 
    7471  targc = argc - 1;
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/status.c

    r21379 r32585  
    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.