add support for 'select' resource and version loading

git-svn-id: svn://opensvn.adaptivecomputing.com/maui/trunk@44 3f5042e3-fb1d-0410-be18-d6ca2573e517
This commit is contained in:
dev
2005-10-29 17:56:32 +00:00
parent 23b38689b1
commit f7d620d527
3 changed files with 85 additions and 11 deletions
+1 -1
View File
@@ -1 +1 @@
#define MSCHED_VERSION "maui-3.2.6p14-snap.1129916435"
#define MSCHED_VERSION "maui-3.2.6p14-snap.1129921819"
+19 -4
View File
@@ -1230,9 +1230,10 @@ int MJobUpdateFlags(
}
} /* END if (RQ != NULL) */
DBG(7,fSTRUCT) DPrint("INFO: job flags for job %s: %x\n",
DBG(7,fSTRUCT) DPrint("INFO: job flags for job %s: %x, req napolicy=%s\n",
J->Name,
(int)J->Flags);
(int)J->Flags,
(RQ != NULL) ? MNAccessPolicy[RQ->NAccessPolicy] : "N/A");
/* update job attributes */
@@ -1311,17 +1312,21 @@ int MReqCheckResourceMatch(
(J->ReqHList != NULL) &&
(RQ->DRes.Procs != 0))
{
Found = FALSE;
for (index = 0;J->ReqHList[index].N != NULL;index++)
{
if (N == J->ReqHList[index].N)
{
DBG(5,fSCHED) DPrint("INFO: node in requested hostlist\n");
return(SUCCESS);
Found = TRUE;
break;
}
} /* END for (index) */
if ((J->ReqHList[index].N == NULL) &&
if ((Found == FALSE) &&
((J->ReqHLMode != mhlmSubset) ||
(MPar[0].EnableMultiNodeJobs == FALSE)))
{
@@ -1332,6 +1337,16 @@ int MReqCheckResourceMatch(
return(FAILURE);
}
if ((Found == FALSE) && (J->ReqHLMode == mhlmExactSet))
{
DBG(5,fSCHED) DPrint("INFO: node is not in specified hostlist\n");
if (RIndex != NULL)
*RIndex = marHostList;
return(FAILURE);
}
} /* END if ((J->Flags & (1 << mjfHostList)) && ... ) */
} /* END if (J != NULL) */
+65 -6
View File
@@ -1053,6 +1053,43 @@ int __MPBSSystemQuery(
sizeof(MSched.DefaultC->Name));
}
}
else if (!strcmp(AP->name,"pbs_version"))
{
char tmpLine[MMAX_LINE];
char *ptr;
char *TokPtr;
int Version;
/* FORMAT: <PRODNAME>_X.Y.Z.<BUILDNUMBER> where <PRODNAME> is { PBSPro | TORQUE } */
if (R->Version <= 0)
{
MUStrCpy(tmpLine,AP->value,sizeof(tmpLine));
Version = 0;
ptr = MUStrTok(tmpLine,"_",&TokPtr);
ptr = MUStrTok(NULL,".",&TokPtr);
if (ptr != NULL)
Version += (int)strtol(ptr,NULL,10) * 100;
ptr = MUStrTok(NULL,".",&TokPtr);
if (ptr != NULL)
Version += (int)strtol(ptr,NULL,10) * 10;
ptr = MUStrTok(NULL,".",&TokPtr);
if (ptr != NULL)
Version += (int)strtol(ptr,NULL,10);
R->Version = Version;
}
}
} /* END for (AP) */
} /* END for (SP) */
@@ -1481,7 +1518,8 @@ int MPBSLoadQueueInfo(
}
else if (!strcmp(AP->name,"resources_default"))
{
if (!strcmp(AP->resource,"neednodes"))
if (!strcmp(AP->resource,"neednodes") ||
!strcmp(AP->resource,"select"))
{
char *ptr;
@@ -1749,7 +1787,14 @@ int MPBSJobStart(
return(FAILURE);
}
if (MPBSJobModify(J,R,ATTR_l,"neednodes",HostList,NULL,NULL) == FAILURE)
if (MPBSJobModify(
J,
R,
ATTR_l,
(char *)(R->Version >= 710) ? "select" : "neednodes",
HostList,
NULL,
NULL) == FAILURE)
{
DBG(0,fPBS) DPrint("ERROR: cannot set hostlist for job '%s'\n",
J->Name);
@@ -1880,7 +1925,14 @@ int MPBSJobStart(
if (J->NeedNodes != NULL)
{
if (MPBSJobModify(J,R,ATTR_l,"neednodes",J->NeedNodes,NULL,NULL) == FAILURE)
if (MPBSJobModify(
J,
R,
ATTR_l,
(char *)(R->Version >= 710) ? "select" : "neednodes",
J->NeedNodes,
NULL,
NULL) == FAILURE)
{
DBG(7,fPBS) DPrint("WARNING: cannot reset hostlist for job '%s')\n",
J->Name);
@@ -4428,7 +4480,14 @@ int MPBSJobRequeue(
/* restore PBS 'neednodes' value to original value */
if (MPBSJobModify(J,R,ATTR_l,"neednodes",J->NeedNodes,NULL,NULL) == FAILURE)
if (MPBSJobModify(
J,
R,
ATTR_l,
(char *)(R->Version >= 710) ? "select" : "neednodes",
J->NeedNodes,
NULL,
NULL) == FAILURE)
{
DBG(7,fPBS) DPrint("WARNING: cannot reset hostlist for job '%s')\n",
J->Name);
@@ -4864,7 +4923,7 @@ int MPBSJobMigrate(
J,
R,
"Resource_List",
"neednodes",
(char *)(R->Version >= 710) ? "select" : "neednodes",
tmpHList,
EMsg,
SC) == FAILURE)
@@ -5448,7 +5507,7 @@ int MPBSJobSetAttr(
/* get resource information */
if (!strcmp(AP->resource,"neednodes"))
if (!strcmp(AP->resource,"neednodes") || !strcmp(AP->resource,"select"))
{
/* record PBS neednodes value */