improve silver compatibility

add garrick node MAM interface


git-svn-id: svn://opensvn.adaptivecomputing.com/maui/trunk@6 3f5042e3-fb1d-0410-be18-d6ca2573e517
This commit is contained in:
dev 2005-07-12 23:22:01 +00:00
parent 9a0042c61e
commit e3a3e5501e
18 changed files with 94 additions and 103 deletions

0
include/mg2-proto.h Normal file
View File

View File

@ -94,7 +94,7 @@ int MCredConfigLShow(void *,int,int,int,char *);
char *MOGetName(void *,int,char **);
int MCredInitialize(int,void *,char *);
int MCredAdd(int,char *,void **);
int MCredLoadConfig(int,char *,char *);
int MCredLoadConfig(int,char *,char *,char *);
int MCredAdjustConfig(int,void *);
int MOLoadPvtConfig(void **,int,char *,mpsi_t *,char *);
int MCredSetDefaults(void);
@ -444,7 +444,7 @@ int MSysDSQuery(char *,char *,char *,int *,char *,char *);
int MSysEMSubmit(mpsi_t *,char *,char *,char *);
int MSysEMRegister(mpsi_t *,char *,char *,char *,char *);
int MSysSynchronize(void);
int MSysInitialize(void);
int MSysInitialize(mbool_t);
void MSysShutdown(int);
int MSysDestroyObjects(void);
int MSysDiagnose(char *,int,long);

View File

@ -1509,6 +1509,8 @@ typedef struct {
int OType;
} sres_t;
#define srsv_t sres_t
typedef struct {
long Time;
short Type;

0
include/msu-proto.h Normal file
View File

View File

@ -366,7 +366,9 @@ int MACLLoadConfig(
ACL[ACLStart + AIndex].Affinity = nmPositiveAffinity;
for (tail = ptr + strlen(ptr) - 1;strchr("-+=%^!*",*tail);tail++)
tail = ptr + strlen(ptr) - 1;
if (strchr("-+=%^!*",*tail) != NULL)
{
switch(*tail)
{
@ -423,8 +425,8 @@ int MACLLoadConfig(
/* NO-OP */
break;
} /* END switch(*tail) */
} /* END for (tail) */
} /* END switch(*tail) */
} /* END if (tail) */
/* extract modifier */

View File

@ -457,7 +457,7 @@ int MAMAllocJDebit(
/* PROCCOUNT -> PROCS (QBank 2.9) */
/* CLASS supported in 2.9 */
sprintf(AMISBuffer,"COMMAND=make_withdrawal AUTH=%s MACHINE=%s%s%s USER=%s WCTIME=%ld PROCCOUNT=%d PROCCRATE=%.2lf %sCLASS=%s NODETYPE=%s JOBID=%s JOBTYPE=job",
sprintf(AMISBuffer,"COMMAND=make_withdrawal AUTH=%s MACHINE=%s%s%s USER=%s WCTIME=%ld PROCCOUNT=%d PROCCRATE=%.2lf %sCLASS=%s NODETYPE=%s JOBID=%s JOBTYPE=job NODES=%d",
MSched.Admin1User[0],
R->Name,
(AccountName[0] != '\0') ? " ACCOUNT=" : "",
@ -469,7 +469,8 @@ int MAMAllocJDebit(
QOSString,
(J->Cred.C != NULL) ? J->Cred.C->Name : DEFAULT,
NodeType,
J->Name);
J->Name,
J->NodeCount);
rc = MAMQBDoCommand(
A,
@ -771,7 +772,7 @@ int MAMAllocRDebit(
case mamtQBANK:
sprintf(AMISBuffer,"COMMAND=make_withdrawal AUTH=%s MACHINE=%s ACCOUNT=%s USER=%s WCTIME=%ld PROCCRATE=%.2lf PROCCOUNT=%d QOS=%s CLASS=%s NODETYPE=%s JOBID=%s JOBTYPE=res",
sprintf(AMISBuffer,"COMMAND=make_withdrawal AUTH=%s MACHINE=%s ACCOUNT=%s USER=%s WCTIME=%ld PROCCRATE=%.2lf PROCCOUNT=%d QOS=%s CLASS=%s NODETYPE=%s JOBID=%s JOBTYPE=res NODES=%d",
MSched.Admin1User[0],
MRM[0].Name,
AName,
@ -782,7 +783,8 @@ int MAMAllocRDebit(
DEFAULT,
"DEFAULT",
NodeType,
R->Name);
R->Name,
R->NodeCount);
rc = MAMQBDoCommand(
AM,
@ -1084,7 +1086,7 @@ int MAMAllocJReserve(
case mamtQBANK:
sprintf(AMISBuffer,"COMMAND=make_reservation AUTH=%s MACHINE=%s%s%s USER=%s WCLIMIT=%ld PROCCOUNT=%d %sCLASS=%s NODETYPE=%s TYPE=%s JOBID=%s JOBTYPE=%s",
sprintf(AMISBuffer,"COMMAND=make_reservation AUTH=%s MACHINE=%s%s%s USER=%s WCLIMIT=%ld PROCCOUNT=%d %sCLASS=%s NODETYPE=%s TYPE=%s JOBID=%s JOBTYPE=%s NODES=%d",
MSched.Admin1User[0],
RM->Name,
(AccountName[0] != '\0') ? " ACCOUNT=" : "",
@ -1097,7 +1099,8 @@ int MAMAllocJReserve(
NodeType,
AM->ClientName,
J->Name,
(TestAlloc == TRUE) ? "tempjob" : "job");
(TestAlloc == TRUE) ? "tempjob" : "job",
J->NodeCount);
rc = MAMQBDoCommand(
AM,
@ -3811,7 +3814,7 @@ int MAMAllocRReserve(
case mamtQBANK:
sprintf(Line,"COMMAND=make_reservation AUTH=%s MACHINE=%s ACCOUNT=%s USER=%s WCLIMIT=%ld PROCCOUNT=%d QOS=%s CLASS=%s NODETYPE=%s TYPE=%s JOBID=%s",
sprintf(Line,"COMMAND=make_reservation AUTH=%s MACHINE=%s ACCOUNT=%s USER=%s WCLIMIT=%ld PROCCOUNT=%d QOS=%s CLASS=%s NODETYPE=%s TYPE=%s JOBID=%s NODES=%d",
MSched.Admin1User[0],
MRM[0].Name,
AName,
@ -3822,7 +3825,8 @@ int MAMAllocRReserve(
DEFAULT,
NodeType,
MSCHED_SNAME,
ResName);
ResName,
NodeCount);
rc = MAMQBDoCommand(A,0,Line,NULL,&StatusCode,Response);

View File

@ -1402,7 +1402,7 @@ int MBFGreedy(
sindex = 0;
scount = 0;
memcpy(LBFQueue,0,sizeof(LBFQueue));
memset(LBFQueue,0,sizeof(LBFQueue));
memset(BFIndex,0,sizeof(BFIndex));
SPC = 0;

View File

@ -40,9 +40,10 @@ char *__MCredShowLimit(mpu_t *,int,int,int);
int MCredLoadConfig(
int OIndex, /* I */
char *CName, /* I */
char *ABuf) /* I (optional) */
int OIndex,
char *CName,
char *ABuf,
char *EMsg)
{
char IndexName[MAX_MNAME];
@ -57,11 +58,6 @@ int MCredLoadConfig(
mfs_t *CFSPtr = NULL;
mcredl_t *CLPtr = NULL;
/* FORMAT: <KEY>=<VAL>[<WS><KEY>=<VAL>]... */
/* <VAL> -> <ATTR>=<VAL>[:<ATTR>=<VAL>]... */
/* load all/specified cred config info */
head = (ABuf != NULL) ? ABuf : MSched.ConfigBuffer;
if (head == NULL)

View File

@ -699,6 +699,8 @@ char *MJobGetName(
Host = ptr;
JobID = NULL;
StepID = NULL;
while (ptr != NULL)

View File

@ -33,9 +33,9 @@ int MLimitEnforceAll(
int ResourceLimitsExceeded; /* boolean */
int VRes;
int VLimit;
int VVal;
int VRes = -1;
int VLimit = -1;
int VVal = -1;
int rc;

View File

@ -1153,6 +1153,9 @@ int MNodeGetPreemptList(
{
R = N->R[rindex];
if (R == NULL)
break;
if ((R == (mres_t *)1) ||
(R->Name[0] == '\0') ||
(R->Name[0] == '\1'))
@ -3617,6 +3620,10 @@ int MNodeSetClass(
{
ptr = MUStrTok(ClassString,"+",&TokPtr);
}
else
{
ptr = NULL;
}
while ((C != NULL) && (ptr != NULL))
{
@ -5102,7 +5109,7 @@ int MUNLGetMinAVal(
mnalloc_t *NL, /* I */
int NAttr, /* I */
mnode_t **NPtr, /* O (optional) */
void **Val) /* O (optional) */
void **Val) /* O */
{
mnode_t *N;
@ -5118,7 +5125,12 @@ int MUNLGetMinAVal(
{
return(FAILURE);
}
if (NAttr == mnaNodeType)
{
((char *)Val)[0] = '\0';
}
switch (NAttr)
{
case mnaSpeed:

View File

@ -3,7 +3,7 @@
/* Contains: *
* int MPBSInitialize(R,SC) *
* int MPBSWorkloadQuery(R,JCount,SC) *
* int __MPBSJobGetState(Name,Status,PJob,FlagsP) *
* int __MPBSJobGetState(Name,Status,PJob) *
* int MPBSClusterQuery(R,RCount,SC) *
* int __MPBSGetNodeState(Name,State,PNode) *
* int MPBSJobStart(J,R,Msg,SC) *
@ -89,7 +89,7 @@ int __MPBSSystemQuery(mrm_t *,int *);
int MPBSJobUpdate(struct batch_status *,mjob_t *,short *,int);
int MPBSNodeLoad(mnode_t *,struct batch_status *,int,mrm_t *);
int MPBSNodeUpdate(mnode_t *,struct batch_status *,enum MNodeStateEnum,mrm_t *);
int __MPBSJobGetState(struct batch_status *,mrm_t *,char *,enum MJobStateEnum *,mulong *);
int __MPBSJobGetState(struct batch_status *,mrm_t *,char *,enum MJobStateEnum *);
int __MPBSGetNodeState(char *,enum MNodeStateEnum *,struct batch_status *);
int MPBSQueryMOM(mnode_t *,mrm_t *,char *,int *);
int MPBSGetClassInfo(mnode_t *N,char C[][MAX_MNAME],char A[][MAX_MNAME]);
@ -545,8 +545,6 @@ int MPBSWorkloadQuery(
mjob_t *JNext;
mulong JobFlagBM;
const char *FName = "MPBSWorkloadQuery";
DBG(1,fPBS) DPrint("%s(%s,JCount,SC)\n",
@ -632,13 +630,11 @@ int MPBSWorkloadQuery(
RMJID[0] = '\0';
if (__MPBSJobGetState(cur_job,R,RMJID,&Status,&JobFlagBM) == FAILURE)
if (__MPBSJobGetState(cur_job,R,RMJID,&Status) == FAILURE)
break;
MJobGetName(NULL,RMJID,R,SJID,sizeof(SJID),mjnShortName);
J = NULL;
switch (Status)
{
case mjsIdle:
@ -774,9 +770,6 @@ int MPBSWorkloadQuery(
break;
} /* END switch (Status) */
if (J != NULL)
J->IFlags |= JobFlagBM;
} /* END for (cur_job) */
pbs_statfree(jobs);
@ -837,8 +830,7 @@ int __MPBSJobGetState(
struct batch_status *PJob, /* I */
mrm_t *R, /* I */
char *JobName, /* O (optional) */
enum MJobStateEnum *Status,
mulong *FlagsP)
enum MJobStateEnum *Status) /* O */
{
struct attrl *AP;
@ -850,9 +842,6 @@ int __MPBSJobGetState(
strcpy(JobName,PJob->name);
}
if (FlagsP != NULL)
*FlagsP = 0;
for (AP = PJob->attribs;AP != NULL;AP = AP->next)
{
if (!strcmp(AP->name,ATTR_state))
@ -897,11 +886,8 @@ int __MPBSJobGetState(
break;
case 'E':
if (FlagsP != NULL)
*FlagsP |= (1 << mjifIsExiting);
case 'E': /* differences between 'exiting' and 'completed?' */
*Status = mjsRunning;
break;
@ -3328,8 +3314,6 @@ int MPBSJobLoad(
tpbsa_t TA;
mulong tmpUL;
const char *FName = "MPBSJobLoad";
DBG(2,fPBS) DPrint("%s(%s,%s,J,TaskList,%d)\n",
@ -3345,7 +3329,7 @@ int MPBSJobLoad(
memset(&TA,0,sizeof(TA));
if (__MPBSJobGetState(PJob,&MRM[RMIndex],NULL,&J->State,&tmpUL) == FAILURE)
if (__MPBSJobGetState(PJob,&MRM[RMIndex],NULL,&J->State) == FAILURE)
{
DBG(1,fPBS) DPrint("ALERT: cannot get job state info for job '%s'\n",
J->Name);
@ -3355,8 +3339,6 @@ int MPBSJobLoad(
return(FAILURE);
}
J->IFlags |= tmpUL;
/* add resource requirements information */
if (MReqCreate(J,NULL,&RQ,FALSE) == FAILURE)
@ -3576,8 +3558,6 @@ int MPBSJobUpdate(
int MaxJobMem;
int MaxJobSwap;
mulong tmpUL;
const char *FName = "MPBSJobUpdate";
DBG(2,fPBS) DPrint("%s(%s,%s,TaskList,%d)\n",
@ -3597,7 +3577,7 @@ int MPBSJobUpdate(
TaskList[0] = -1;
if (__MPBSJobGetState(PJob,&MRM[RMIndex],NULL,&J->State,&tmpUL) == FAILURE)
if (__MPBSJobGetState(PJob,&MRM[RMIndex],NULL,&J->State) == FAILURE)
{
DBG(1,fPBS) DPrint("ALERT: cannot get job state info for job '%s'\n",
J->Name);
@ -3605,8 +3585,6 @@ int MPBSJobUpdate(
return(FAILURE);
}
J->IFlags |= tmpUL;
RQ = J->Req[0];
TaskCount = 1;
@ -5005,11 +4983,8 @@ int MPBSNodeSetAttr(
memset(&tmpAP,0,sizeof(tmpAP));
if (A != NULL)
{
AP = (struct attrl *)A;
}
AP = (struct attrl *)A;
DBG(6,fPBS) DPrint("INFO: PBS node attribute '%s' value: '%s' (r: %s)\n",
AP->name,
(AP->value != NULL) ? AP->value : "NULL",

View File

@ -754,11 +754,6 @@ int MRMJobCancel(
break;
} /* END switch(MSched.Mode) */
if (J->IFlags & (1 << mjifIsExiting))
{
return(SUCCESS);
}
memset(RMList,0,sizeof(RMList));
rmcount = 0;
@ -4208,11 +4203,11 @@ int MRMJobPostUpdate(
{
mreq_t *RQ;
int index;
int nindex;
int rqindex;
int tindex;
int jnindex;
int index = 0;
int nindex = 0;
int rqindex = 0;
int tindex = 0;
int jnindex = 0;
int TC;

View File

@ -1300,13 +1300,13 @@ int MJobSelectMNL(
int AvailableTaskCount[MAX_MREQ_PER_JOB];
int TotalAvailINC;
int TotalAvailITC;
int TotalAvailIPC;
int TotalAvailINC = 0;
int TotalAvailITC = 0;
int TotalAvailIPC = 0;
int TotalAvailPNC;
int TotalAvailPTC;
int TotalAvailPPC;
int TotalAvailPNC = 0;
int TotalAvailPTC = 0;
int TotalAvailPPC = 0;
int PreempteeTCList[MAX_MJOB];
int PreempteeNCList[MAX_MJOB];
@ -1349,7 +1349,7 @@ int MJobSelectMNL(
int SC;
int AllowPreemption;
int AllowPreemption = FALSE;
int PIsConditional = FALSE;
const char *FName = "MJobSelectMNL";

View File

@ -15,8 +15,8 @@ mgcred_t *MUser[MAX_MUSER + MAX_MHBUF];
mgcred_t MGroup[MAX_MGROUP + MAX_MHBUF];
mgcred_t MAcct[MAX_MACCT + MAX_MHBUF];
mres_t *MRes[MAX_MRES];
sres_t SRes[MAX_MSRES];
sres_t OSRes[MAX_MSRES];
srsv_t SRes[MAX_MSRES];
srsv_t OSRes[MAX_MSRES];
mjobl_t MJobName[MAX_MJOB + MAX_MHBUF];
mam_t MAM[MAX_MAM];
mrange_t MRange[MAX_MRANGE];
@ -70,7 +70,7 @@ int __MSysTestRLMerge();
int MSysInitialize()
int MSysInitialize(mbool_t DoInit)
{
int index;
@ -162,7 +162,7 @@ int MSysInitialize()
S->E[mxoSched] = &MSched;
S->T[mxoSRes] = &SRes[0];
S->S[mxoSRes] = sizeof(sres_t);
S->S[mxoSRes] = sizeof(srsv_t);
S->M[mxoSRes] = MAX_MSRES;
S->E[mxoSRes] = &SRes[MAX_MSRES - 1];
@ -375,21 +375,21 @@ int MSysLoadConfig(
MCfgProcessBuffer(MSched.ConfigBuffer);
MCredLoadConfig(mxoSys,NULL,NULL);
MCredLoadConfig(mxoSys,NULL,NULL,NULL);
MCredLoadConfig(mxoQOS,"DEFAULT",NULL);
MCredLoadConfig(mxoQOS,NULL,NULL);
MCredLoadConfig(mxoQOS,"DEFAULT",NULL,NULL);
MCredLoadConfig(mxoQOS,NULL,NULL,NULL);
MCredLoadConfig(mxoUser,"DEFAULT",NULL);
MCredLoadConfig(mxoUser,NULL,NULL);
MCredLoadConfig(mxoUser,"DEFAULT",NULL,NULL);
MCredLoadConfig(mxoUser,NULL,NULL,NULL);
MCredLoadConfig(mxoGroup,"DEFAULT",NULL);
MCredLoadConfig(mxoAcct,"DEFAULT",NULL);
MCredLoadConfig(mxoClass,"DEFAULT",NULL);
MCredLoadConfig(mxoGroup,"DEFAULT",NULL,NULL);
MCredLoadConfig(mxoAcct,"DEFAULT",NULL,NULL);
MCredLoadConfig(mxoClass,"DEFAULT",NULL,NULL);
MCredLoadConfig(mxoGroup,NULL,NULL);
MCredLoadConfig(mxoAcct,NULL,NULL);
MCredLoadConfig(mxoClass,NULL,NULL);
MCredLoadConfig(mxoGroup,NULL,NULL,NULL);
MCredLoadConfig(mxoAcct,NULL,NULL,NULL);
MCredLoadConfig(mxoClass,NULL,NULL,NULL);
MSRLoadConfig(NULL);

View File

@ -100,6 +100,9 @@ int MUGetPair(
for (index = 0;index < MAX_MNAME;index++)
{
if (ptr[index] == '\0')
break;
if (CmpRelative == TRUE)
{
if (isspace(ptr[index]) ||
@ -131,7 +134,7 @@ int MUGetPair(
for (index = index + 1;index < MAX_MNAME;index++)
{
if (ptr[index] == ']')
if ((ptr[index] == ']') || (ptr[index] == '\0'))
break;
if (AttrArray != NULL)

View File

@ -103,7 +103,7 @@ int main(
FName,
ArgC);
MSysInitialize();
MSysInitialize(TRUE);
ServerSetSignalHandlers();
@ -1215,7 +1215,7 @@ int ServerProcessRequests()
MSysDestroyObjects();
MSysInitialize();
MSysInitialize(TRUE);
ServerSetSignalHandlers();

View File

@ -3924,12 +3924,12 @@ int UIChangeParameter(
/* evaluate cred config */
MCredLoadConfig(mxoSys,NULL,RBuffer);
MCredLoadConfig(mxoQOS,NULL,RBuffer);
MCredLoadConfig(mxoUser,NULL,RBuffer);
MCredLoadConfig(mxoGroup,NULL,RBuffer);
MCredLoadConfig(mxoAcct,NULL,RBuffer);
MCredLoadConfig(mxoClass,NULL,RBuffer);
MCredLoadConfig(mxoSys,NULL,RBuffer,NULL);
MCredLoadConfig(mxoQOS,NULL,RBuffer,NULL);
MCredLoadConfig(mxoUser,NULL,RBuffer,NULL);
MCredLoadConfig(mxoGroup,NULL,RBuffer,NULL);
MCredLoadConfig(mxoAcct,NULL,RBuffer,NULL);
MCredLoadConfig(mxoClass,NULL,RBuffer,NULL);
/* MNodeLoadConfig(NULL,RBuffer); */