IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 4, 2005, 5:35:47 PM (21 years ago)
Author:
eugene
Message:

substantial dev work on scheduler/pcontrol/pclient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/include/scheduler.h

    r3143 r4450  
     1# include "external.h"
     2# include "shell.h"
     3# include "dvomath.h"
     4# include "convert.h"
     5# include "display.h"
     6# include <sys/types.h>
     7# include <sys/wait.h>
    18
    2 enum {JOB_BUSY, JOB_EXIT, JOB_CRASH};
     9typedef enum {
     10  JOB_NONE,
     11  JOB_BUSY,
     12  JOB_EXIT,
     13  JOB_CRASH,
     14  JOB_PENDING,
     15} JobStat;
     16
     17typedef enum {
     18  JOB_LOCAL,
     19  JOB_CONTROLLER,
     20} JobMode;
     21
     22typedef enum {
     23  CONTROLLER_HUNG = -1,
     24  CONTROLLER_DOWN = 0,
     25  CONTROLLER_GOOD = 1,
     26} ControllerStat;
     27
     28/* socket / pipe communication buffer */
     29typedef struct {
     30  char *buffer;
     31  int   Nalloc;
     32  int   Nreset;
     33  int   Nblock;
     34  int   Nbuffer;
     35} IOBuffer;
    336
    437/* a task is a description of the wrapping of a job */
     
    1649  char  **argv;
    1750  char   *host;
     51  int     host_required;
    1852
    1953  char   *name;
     
    2862typedef struct {
    2963  int JobID;                            /* internal ID for job */
    30   int PID;                              /* external ID for job */
    31 
    32   Task task;
     64  int pid;                              /* external ID for job */
    3365
    3466  struct timeval last;
     
    3668  int state;
    3769  int exit_status;
     70
     71  int     argc;
     72  char  **argv;
     73  Task   *task;
     74
     75  IOBuffer    stdout;                   /* stdout storage buffer */
     76  IOBuffer    stderr;                   /* stderr storage buffer */
     77  JobMode     mode;                     /* local or controller? */
     78
     79  int         stdout_size;              /* stdout pipe (local only) */
     80  int         stderr_size;              /* stderr pipe (local only) */
     81  int         stdout_fd;                /* stdout pipe (local only) */
     82  int         stderr_fd;                /* stderr pipe (local only) */
    3883} Job;
    3984
     85# define CONTROLLER_PROMPT "pclient:"
    4086
    4187/* scheduler prototypes */
     
    5096int TaskHash (char *input);
    5197int ShowTask (char *name);
     98char *memstr (char *m1, char *m2, int n);
    5299
    53100Job *NextJob ();
     
    65112void SetTaskTimer (struct timeval *timer);
    66113double GetTaskTimer (struct timeval start);
     114
     115int CheckJobs ();
     116int CheckTasks ();
     117int CheckSystem ();
     118int GetJobOutput (char *channel, int pid, IOBuffer *buffer, int Nbytes);
     119int CheckControllerJob (Job *job);
     120int CheckControllerJobStatus (Job *job);
     121int SubmitControllerJob (Job *job);
     122int StartController ();
     123int ControllerCommand (char *command, char *response, IOBuffer *buffer);
     124int SubmitLocalJob (Job *job);
     125int CheckLocalJob (Job *job);
     126int CheckLocalJobStatus (Job *job);
     127void InitTaskTimers ();
Note: See TracChangeset for help on using the changeset viewer.