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/pantasks
Files:
9 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/ControllerOps.c

    r27491 r32632  
    258258      sprintf (cmd, "job -host %s", job[0].task[0].host);
    259259    }
     260  }
     261 
     262  if (job[0].priority) {
     263    char tmp[64];
     264    snprintf (tmp, 64, " -nice %d", job[0].priority);
     265    strcat (cmd, tmp);
    260266  }
    261267
  • trunk/Ohana/src/opihi/pantasks/JobOps.c

    r31666 r32632  
    107107    job[0].mode = JOB_CONTROLLER;
    108108  }
     109  job[0].priority = task[0].priority;
    109110
    110111  /* we need our own copy of task[0].argv argc is the number of valid args, like the usual command line.  we
  • trunk/Ohana/src/opihi/pantasks/LocalJob.c

    r23530 r32632  
    161161  if (VerboseMode()) gprint (GP_ERR, "local job launched\n");
    162162
     163  /* set nice level for the child process -- maybe I should not exit here... */
     164  if (job[0].priority) {
     165      status = setpriority (PRIO_PROCESS, pid, job[0].priority);
     166      if (status == -1) {
     167          gprint (GP_ERR, "error setting priority\n");
     168          perror ("setpriority: ");
     169          exit (2);
     170      }
     171  }
     172
    163173  /* close the other ends of the pipes */
    164174  close (stdout_fd[1]); stdout_fd[1] = 0;
  • trunk/Ohana/src/opihi/pantasks/Makefile

    r27995 r32632  
    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 \
  • trunk/Ohana/src/opihi/pantasks/TaskOps.c

    r31856 r32632  
    487487
    488488  NewTask[0].active = TRUE;
     489  NewTask[0].priority = 0;
    489490  return (NewTask);
    490491}
     
    595596  if (!strcasecmp (command, "END"))       hash = TASK_END;
    596597  if (!strcasecmp (command, "HOST"))      hash = TASK_HOST;
     598  if (!strcasecmp (command, "NICE"))      hash = TASK_NICE;
    597599  if (!strcasecmp (command, "NMAX"))      hash = TASK_NMAX;
    598600  if (!strcasecmp (command, "ACTIVE"))    hash = TASK_ACTIVE;
  • trunk/Ohana/src/opihi/pantasks/init.c

    r23530 r32632  
    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"},
  • trunk/Ohana/src/opihi/pantasks/init_server.c

    r23530 r32632  
    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 **));
     
    3435  {1, "delete",     delete_job,    "delete job"},
    3536  {1, "host",       task_host,     "define host machine for a task"},
     37  {1, "nice",       task_nice,     "set nice priority level for a task"},
    3638  {1, "ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
    3739  {1, "kill",       kill_job,      "kill job"},
  • trunk/Ohana/src/opihi/pantasks/pantasks_server.c.in

    r27999 r32632  
    1818int main (int argc, char **argv) {
    1919 
     20  char hostname[256], portinfo[256];
    2021  char log_stdout[1024], log_stderr[1024];
    2122  pthread_t JobsAndTasksThread;
     
    100101     pass them to the ListenClient thread */
    101102
     103  /* find the defined server hostname */
     104  if (VarConfig ("PANTASKS_SERVER", "%s", hostname) == NULL) {
     105    gprint (GP_ERR, "pantasks server host undefined\n");
     106    exit (31);
     107  }
     108
     109  /* is a port range defined? otherwise use the default */
     110  memset (portinfo, 0, 256);
     111  VarConfig ("PANTASKS_SERVER_PORT", "%s", portinfo);
     112
    102113  /* create the listening socket */
    103   InitSocket = InitServerSocket (&Address);
     114  InitSocket = InitServerSocket (&Address, hostname, portinfo);
    104115 
    105116  InitPassword ();
  • trunk/Ohana/src/opihi/pantasks/task.c

    r31666 r32632  
    7272      case TASK_NMAX:
    7373      case TASK_HOST:
     74      case TASK_NICE:
    7475      case TASK_EXIT:
    7576      case TASK_EXEC:
Note: See TracChangeset for help on using the changeset viewer.