IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 15, 2009, 3:42:06 PM (17 years ago)
Author:
eugene
Message:

add tracking of uniquely-named machines and feature to limit the number of unwanted-host jobs (and additional pantasks / pcontrol commands

File:
1 edited

Legend:

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

    r25872 r26411  
    11# include "pcontrol.h"
    22
    3 // The connection to the remote host is only allow to live for MAX_CONNECT_TIME seconds.  We
    4 // disconnect and reconnect if a remote host has been connected for too long.  This is a
    5 // (temporary?) work-around for the problem that the remote pclient job tends to grow too large
    6 // 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.
    77
    8 # define MAX_CONNECT_TIME 36000.0
    9 
     8static float MAX_WANTHOST_WAIT = 10.0;
     9static float MAX_CONNECT_TIME = 36000.0;
    1010static FILE *logfile = NULL;
    1111
     
    7070
    7171    // 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);
    7273
    7374    /* take the job off the stack and unlock the stack */
     
    9091
    9192    // 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);
    9294
    9395    /* take the job off the stack and unlock the stack */
     
    103105    if (job[0].mode != PCONTROL_JOB_ANYHOST) continue;
    104106
     107    if (!CheckMachineJobs (host, job)) continue;
     108
    105109    /* we have found an appropriate job; link it to the host and send to StartJob */
    106110    job[0].host = (struct Host *) host;
     
    108112
    109113    // 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);
    110115
    111116    /* take the job off the stack and unlock the stack */
     
    124129    gettimeofday (&now, (void *) NULL);
    125130    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;
    127134
    128135    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);
    129137
    130138    /* we have found an appropriate job; link it to the host and send to StartJob */
     
    145153}
    146154
     155void SetMaxWantHostWait (float value) {
     156
     157  MAX_WANTHOST_WAIT = value;
     158  return;
     159}
     160
     161float GetMaxWantHostWait (void) {
     162
     163  return MAX_WANTHOST_WAIT;
     164}
     165
     166void SetMaxConnectTime (float value) {
     167
     168  MAX_CONNECT_TIME = value;
     169  return;
     170}
     171
     172float GetMaxConnectTime (void) {
     173
     174  return MAX_CONNECT_TIME;
     175}
     176
    147177/** note : host and job popped off IDLE and PENDING stacks,
    148178    unless no job is available **/
Note: See TracChangeset for help on using the changeset viewer.