Changeset 26411 for trunk/Ohana/src/opihi/pcontrol
- Timestamp:
- Dec 15, 2009, 3:42:06 PM (17 years ago)
- Location:
- trunk/Ohana/src/opihi/pcontrol
- Files:
-
- 4 added
- 8 edited
-
CheckDoneJob.c (modified) (2 diffs)
-
CheckIdleHost.c (modified) (7 diffs)
-
CheckSystem.c (modified) (1 diff)
-
HostOps.c (modified) (2 diffs)
-
KillJob.c (modified) (2 diffs)
-
MachineOps.c (added)
-
Makefile (modified) (2 diffs)
-
host.c (modified) (1 diff)
-
init.c (modified) (4 diffs)
-
machines.c (added)
-
parameters.c (added)
-
test/machines.sh (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c
r20066 r26411 28 28 29 29 if ((status1 == PCLIENT_DOWN) || (status2 == PCLIENT_DOWN)) { 30 31 // decrement the machine job-host counters 32 DelMachineJob (host, job); 33 30 34 // unlink host & job 31 35 if (DEBUG || VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname); … … 53 57 } 54 58 59 // decrement the machine job-host counters 60 DelMachineJob (host, job); 61 55 62 /* job's state is either EXIT or CRASH (verify?) */ 56 63 // unlink host & job -
trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c
r25872 r26411 1 1 # include "pcontrol.h" 2 2 3 // The connection to the remote host is only allow to live for MAX_CONNECT_TIME seconds. We4 // disconnect and reconnect if a remote host has been connected for too long. This is a5 // (temporary?) work-around for the problem that the remote pclient job tends to grow too large6 // over time.3 // The connection to the remote host is only allowed to live for MAX_CONNECT_TIME seconds. 4 // We disconnect and reconnect if a remote host has been connected for too long. This is 5 // a (temporary?) work-around for the problem that the remote pclient job tends to grow 6 // too large over time. 7 7 8 # define MAX_CONNECT_TIME 36000.0 9 8 static float MAX_WANTHOST_WAIT = 10.0; 9 static float MAX_CONNECT_TIME = 36000.0; 10 10 static FILE *logfile = NULL; 11 11 … … 70 70 71 71 // if (logfile) fprintf (logfile, "start needhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 72 AddMachineJob (host, job); 72 73 73 74 /* take the job off the stack and unlock the stack */ … … 90 91 91 92 // if (logfile) fprintf (logfile, "start wanthost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 93 AddMachineJob (host, job); 92 94 93 95 /* take the job off the stack and unlock the stack */ … … 103 105 if (job[0].mode != PCONTROL_JOB_ANYHOST) continue; 104 106 107 if (!CheckMachineJobs (host, job)) continue; 108 105 109 /* we have found an appropriate job; link it to the host and send to StartJob */ 106 110 job[0].host = (struct Host *) host; … … 108 112 109 113 // if (logfile) fprintf (logfile, "start anyhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 114 AddMachineJob (host, job); 110 115 111 116 /* take the job off the stack and unlock the stack */ … … 124 129 gettimeofday (&now, (void *) NULL); 125 130 dtime = DTIME (now, job[0].start); 126 if (dtime < 10.0) continue; 131 if (dtime < MAX_WANTHOST_WAIT) continue; 132 133 if (!CheckMachineJobs (host, job)) continue; 127 134 128 135 if (logfile) fprintf (logfile, "start wanthost(2) %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 136 AddMachineJob (host, job); 129 137 130 138 /* we have found an appropriate job; link it to the host and send to StartJob */ … … 145 153 } 146 154 155 void SetMaxWantHostWait (float value) { 156 157 MAX_WANTHOST_WAIT = value; 158 return; 159 } 160 161 float GetMaxWantHostWait (void) { 162 163 return MAX_WANTHOST_WAIT; 164 } 165 166 void SetMaxConnectTime (float value) { 167 168 MAX_CONNECT_TIME = value; 169 return; 170 } 171 172 float GetMaxConnectTime (void) { 173 174 return MAX_CONNECT_TIME; 175 } 176 147 177 /** note : host and job popped off IDLE and PENDING stacks, 148 178 unless no job is available **/ -
trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
r25872 r26411 122 122 if (!Njobchecks && !Nhostchecks && (RunLevel != PCONTROL_RUN_NONE)) { 123 123 CheckLiveHosts(0.040); 124 // fprintf (stderr, "sleep a bit\n"); 124 125 usleep (100000); // idle if no jobs are waiting 125 126 } else { 126 127 // if we only have busy jobs, pause a moment before trying again 127 128 if (!Ndonejobs) { 129 // fprintf (stderr, "sleep a bit\n"); 128 130 usleep (100000); 129 131 } -
trunk/Ohana/src/opihi/pcontrol/HostOps.c
r25872 r26411 214 214 host[0].job = NULL; 215 215 216 AddMachineHost (host); 217 216 218 PutHost (host, PCONTROL_HOST_ALLHOSTS, STACK_BOTTOM); 217 219 PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM); … … 225 227 copy = PullStackByID (HostPool_AllHosts, host[0].HostID); 226 228 ASSERT (copy == host, "programming error: ALLHOSTS entry does not match"); 229 230 DelMachineHost (host); 227 231 228 232 FreeIOBuffer (&host[0].comms_buffer); -
trunk/Ohana/src/opihi/pcontrol/KillJob.c
r17477 r26411 19 19 job[0].host = NULL; 20 20 host[0].job = NULL; 21 22 // decrement the machine job-host counters 23 DelMachineJob (host, job); 24 21 25 HarvestHost (host[0].pid); 22 26 PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM); … … 74 78 job[0].host = NULL; 75 79 host[0].job = NULL; 80 81 // decrement the machine job-host counters 82 DelMachineJob (host, job); 83 76 84 PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM); 77 85 PutJob (job, PCONTROL_JOB_CRASH, STACK_BOTTOM); -
trunk/Ohana/src/opihi/pcontrol/Makefile
r17475 r26411 37 37 $(SRC)/IDops.$(ARCH).o \ 38 38 $(SRC)/JobOps.$(ARCH).o \ 39 $(SRC)/MachineOps.$(ARCH).o \ 39 40 $(SRC)/StackOps.$(ARCH).o \ 40 41 $(SRC)/PclientCommand.$(ARCH).o \ … … 53 54 $(SRC)/kill.$(ARCH).o \ 54 55 $(SRC)/pulse.$(ARCH).o \ 56 $(SRC)/parameters.$(ARCH).o \ 55 57 $(SRC)/run.$(ARCH).o \ 58 $(SRC)/machines.$(ARCH).o \ 56 59 $(SRC)/status.$(ARCH).o \ 57 60 $(SRC)/stdout.$(ARCH).o \ -
trunk/Ohana/src/opihi/pcontrol/host.c
r25872 r26411 96 96 usage: 97 97 gprint (GP_LOG, "USAGE: host (command) (hostname)\n"); 98 gprint (GP_ ERR, " valid commands: add, on, retry, check, off, delete\n");99 gprint (GP_ ERR, " -threads Nthreads is optional for 'add'\n");98 gprint (GP_LOG, " valid commands: add, on, retry, check, off, delete\n"); 99 gprint (GP_LOG, " -threads Nthreads is optional for 'add'\n"); 100 100 return (FALSE); 101 101 } -
trunk/Ohana/src/opihi/pcontrol/init.c
r16460 r26411 8 8 int jobstack PROTO((int, char **)); 9 9 int kill_pc PROTO((int, char **)); 10 int machines PROTO((int, char **)); 11 int parameters PROTO((int, char **)); 12 int run PROTO((int, char **)); 10 13 int status PROTO((int, char **)); 11 int run PROTO((int, char **));12 14 int stderr_pc PROTO((int, char **)); 13 15 int stdout_pc PROTO((int, char **)); … … 19 21 20 22 static Command cmds[] = { 21 {1, "host", host, "add / delete / modify host"}, 22 {1, "hoststack", hoststack, "list hosts for a single stack"}, 23 {1, "status", status, "get system status"}, 24 {1, "stop", run, "stop controller processing"}, 25 {1, "run", run, "set controller runlevel"}, 26 {1, "verbose", verbose, "set the verbose mode for job"}, 27 {1, "version", version, "show version information"}, 28 {1, "job", job, "add job"}, 29 {1, "jobstack", jobstack, "list jobs for a single stack"}, 30 {1, "check", check, "get job or host status"}, 31 {1, "delete", delete, "delete job"}, 32 {1, "kill", kill_pc, "kill job"}, 33 {1, "stderr", stderr_pc, "get stderr buffer for job"}, 34 {1, "stdout", stdout_pc, "get stdout buffer for job"}, 35 # ifndef THREADED 36 {1, "pulse", pulse, "set system pulse"}, 23 {1, "check", check, "get job or host status"}, 24 {1, "delete", delete, "delete job"}, 25 {1, "host", host, "add / delete / modify host"}, 26 {1, "hoststack", hoststack, "list hosts for a single stack"}, 27 {1, "job", job, "add job"}, 28 {1, "jobstack", jobstack, "list jobs for a single stack"}, 29 {1, "kill", kill_pc, "kill job"}, 30 {1, "machines", machines, "list machines"}, 31 {1, "parameters", parameters, "get / set system parameters"}, 32 {1, "run", run, "set controller runlevel"}, 33 {1, "status", status, "get system status"}, 34 {1, "stderr", stderr_pc, "get stderr buffer for job"}, 35 {1, "stdout", stdout_pc, "get stdout buffer for job"}, 36 {1, "stop", run, "stop controller processing"}, 37 {1, "verbose", verbose, "set the verbose mode for job"}, 38 {1, "version", version, "show version information"}, 39 # ifndef THREADED 40 {1, "pulse", pulse, "set system pulse"}, 37 41 # endif 38 42 }; … … 47 51 InitJobStacks (); 48 52 InitHostStacks (); 53 InitMachines (); 49 54 } 50 55 … … 52 57 FreeJobStacks (); 53 58 FreeHostStacks (); 59 FreeMachines (); 54 60 }
Note:
See TracChangeset
for help on using the changeset viewer.
