From 35f9a009c70058a63daa409c2848d0176a4be1ae Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 13 Jan 2006 22:24:02 +0000 Subject: [PATCH] add fallback account suffix git-svn-id: svn://opensvn.adaptivecomputing.com/maui/trunk@49 3f5042e3-fb1d-0410-be18-d6ca2573e517 --- include/header.cfg | 2 +- include/msched-version.h | 2 +- src/moab/MRM.c | 30 ++++++++++++++++++++++-------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/include/header.cfg b/include/header.cfg index 0bc7723..2371c59 100644 --- a/include/header.cfg +++ b/include/header.cfg @@ -1,4 +1,4 @@ -VERSION 3.2.6p12 +VERSION 3.2.6p14 PACKAGE moab AUTHOR Cluster Resources, Inc diff --git a/include/msched-version.h b/include/msched-version.h index 4939fa0..4e7b43b 100644 --- a/include/msched-version.h +++ b/include/msched-version.h @@ -1 +1 @@ -#define MSCHED_VERSION "maui-3.2.6p14-snap.1131673836" +#define MSCHED_VERSION "" diff --git a/src/moab/MRM.c b/src/moab/MRM.c index 803ac90..22891f7 100644 --- a/src/moab/MRM.c +++ b/src/moab/MRM.c @@ -3560,10 +3560,6 @@ int MRMJobPreLoad( -/* NOTE: handling of tasklist information */ -/* TaskList[] contains updated task ordering information */ -/* must update both J->NodeList and J->Req[X]->NodeList */ -/* this call should override, not add to existing info */ int MRMJobPostLoad( @@ -3588,6 +3584,7 @@ int MRMJobPostLoad( char ErrMsg[MAX_MLINE]; char tmpLine[MAX_MLINE]; + char tmpFBAccount[MAX_MLINE]; const char *FName = "MRMJobPostLoad"; @@ -3814,14 +3811,31 @@ int MRMJobPostLoad( J->Name, MDefReason[Reason]); - if (Reason == mhrNoFunds) + /* Bug in the maui-gold interaction when FALLBACKACCOUNT is enabled + neccessitates this double check */ + + if (Reason == mhrNoFunds || Reason == mhrAMFailure) { + /* If the fallbackaccount starts with a + then append it to the + primary accountname */ + + if (MAM[0].FallbackAccount[0] == '+') + { + snprintf(tmpFBAccount,sizeof(tmpFBAccount),"%s%s", + J->Cred.A->Name, + MAM[0].FallbackAccount + 1); + } + else + { + strcpy(tmpFBAccount,MAM[0].FallbackAccount); + } + DBG(3,fRM) DPrint("WARNING: insufficient allocation in account '%s' to run job '%s' (attempting fallback account '%s')\n", J->Cred.A->Name, J->Name, - MAM[0].FallbackAccount); + tmpFBAccount); - if (MAcctFind(MAM[0].FallbackAccount,&A) == SUCCESS) + if (MAcctFind(tmpFBAccount,&A) == SUCCESS) { J->Cred.A = A; @@ -3830,7 +3844,7 @@ int MRMJobPostLoad( else { DBG(2,fRM) DPrint("ALERT: cannot locate fallback account '%s'\n", - MAM[0].FallbackAccount); + tmpFBAccount); } } }