diff --git a/include/msched.h b/include/msched.h index 1c04bed..35238d3 100644 --- a/include/msched.h +++ b/include/msched.h @@ -2160,6 +2160,7 @@ typedef struct { int SPVJobIsPreemptible; /* (config boolean) */ mbool_t EnableEncryption; + mbool_t PercentBasedFS; char *Argv[MAX_MARG]; diff --git a/src/moab/MFS.c b/src/moab/MFS.c index 279279f..50195cc 100644 --- a/src/moab/MFS.c +++ b/src/moab/MFS.c @@ -886,6 +886,9 @@ int MFSProcessOConfig( case pFSPolicy: + if (strchr(SVal,'*')) + MSched.PercentBasedFS = TRUE; + if (MUBoolFromString(SVal,FALSE) == TRUE) { /* enable backlevel support */ diff --git a/src/moab/MPar.c b/src/moab/MPar.c index 4b3da58..c7dafd2 100644 --- a/src/moab/MPar.c +++ b/src/moab/MPar.c @@ -2462,6 +2462,11 @@ int MParConfigShow( sprintf(Buffer,"%s%-30s %s\n",Buffer,MParam[pFSPolicy],MFSPolicyType[F->FSPolicy]); + sprintf(Buffer,"%s%-30s %s%s\n", + Buffer, + MParam[pFSPolicy],MFSPolicyType[F->FSPolicy], + (MSched.PercentBasedFS == TRUE) ? "%" : ""); + if ((F->FSPolicy == fspNONE) || (VFlag || (PIndex == -1) || (PIndex == pFSPolicy))) { sprintf(Buffer,"%s%-30s %s\n",Buffer,MParam[pFSInterval],MULToTString(F->FSInterval)); diff --git a/src/moab/MPriority.c b/src/moab/MPriority.c index efca285..964259d 100644 --- a/src/moab/MPriority.c +++ b/src/moab/MPriority.c @@ -761,9 +761,18 @@ int MJobGetStartPriority( if (FSTargetUsage > 0.0) { - SFactor[mpsFU] = FSTargetUsage - - (J->Cred.U->F.FSUsage[0] + J->Cred.U->F.FSFactor) / - (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + if (MSched.PercentBasedFS == TRUE) + { + SFactor[mpsFU] = 1.0 - + (((J->Cred.U->F.FSUsage[0] + J->Cred.U->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0)/FSTargetUsage); + } + else + { + SFactor[mpsFU] = FSTargetUsage - + (J->Cred.U->F.FSUsage[0] + J->Cred.U->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + } switch(FSMode) { @@ -797,9 +806,18 @@ int MJobGetStartPriority( if (FSTargetUsage > 0.0) { - SFactor[mpsFG] = FSTargetUsage - - (J->Cred.G->F.FSUsage[0] + J->Cred.G->F.FSFactor) / - (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + if (MSched.PercentBasedFS == TRUE) + { + SFactor[mpsFU] = 1.0 - + (((J->Cred.G->F.FSUsage[0] + J->Cred.G->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0)/FSTargetUsage); + } + else + { + SFactor[mpsFG] = FSTargetUsage - + (J->Cred.G->F.FSUsage[0] + J->Cred.G->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + } switch(FSMode) { @@ -833,9 +851,18 @@ int MJobGetStartPriority( { if (J->Cred.A != NULL) { - SFactor[mpsFA] = FSTargetUsage - - (J->Cred.A->F.FSUsage[0] + J->Cred.A->F.FSFactor) / - (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + if (MSched.PercentBasedFS == TRUE) + { + SFactor[mpsFA] = 1.0 - + (((J->Cred.A->F.FSUsage[0] + J->Cred.A->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0)/FSTargetUsage); + } + else + { + SFactor[mpsFA] = FSTargetUsage - + (J->Cred.A->F.FSUsage[0] + J->Cred.A->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + } } else { @@ -873,9 +900,18 @@ int MJobGetStartPriority( { if (J->Cred.C != NULL) { - SFactor[mpsFC] = FSTargetUsage - - (J->Cred.C->F.FSUsage[0] + J->Cred.C->F.FSFactor) / - (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + if (MSched.PercentBasedFS == TRUE) + { + SFactor[mpsFC] = 1.0 - + (((J->Cred.C->F.FSUsage[0] + J->Cred.C->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0)/FSTargetUsage); + } + else + { + SFactor[mpsFC] = FSTargetUsage - + (J->Cred.C->F.FSUsage[0] + J->Cred.C->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + } } else { @@ -913,9 +949,18 @@ int MJobGetStartPriority( { if (J->Cred.Q != NULL) { - SFactor[mpsFQ] = FSTargetUsage - - (J->Cred.Q->F.FSUsage[0] + J->Cred.Q->F.FSFactor) / - (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + if (MSched.PercentBasedFS == TRUE) + { + SFactor[mpsFQ] = 1.0 - + (((J->Cred.Q->F.FSUsage[0] + J->Cred.Q->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0)/FSTargetUsage); + } + else + { + SFactor[mpsFQ] = FSTargetUsage - + (J->Cred.Q->F.FSUsage[0] + J->Cred.Q->F.FSFactor) / + (GP->F.FSUsage[0] + GP->F.FSFactor) * 100.0; + } } else {