From 3f10d4eeab122787a75f57935ac140860a64a58b Mon Sep 17 00:00:00 2001 From: wightman Date: Fri, 2 Sep 2005 17:14:36 +0000 Subject: [PATCH] fixes for Idle Policy Limits git-svn-id: svn://opensvn.adaptivecomputing.com/maui/trunk@26 3f5042e3-fb1d-0410-be18-d6ca2573e517 --- src/moab/MCred.c | 117 ++++++++++++++++++++++++++++++----------------- 1 file changed, 76 insertions(+), 41 deletions(-) diff --git a/src/moab/MCred.c b/src/moab/MCred.c index 6b891c5..a7d9b0e 100644 --- a/src/moab/MCred.c +++ b/src/moab/MCred.c @@ -1167,18 +1167,28 @@ int MCredProcessConfig( case mcaMaxIJob: - if (L->IP == NULL) - break; + if (L->IP == NULL) + { + L->IP = (mpu_t *)calloc(1,sizeof(mpu_t)); + } - __MCredParseLimit( - ValLine, - &L->IP->SLimit[mptMaxJob][0], - &L->IP->HLimit[mptMaxJob][0]); + if (L->IP != NULL) + { + __MCredParseLimit( + ValLine, + &L->IP->SLimit[mptMaxJob][0], + &L->IP->HLimit[mptMaxJob][0]); + } break; case mcaMaxINode: + if (L->IP == NULL) + { + L->IP = (mpu_t *)calloc(1,sizeof(mpu_t)); + } + if (L->IP != NULL) { __MCredParseLimit( @@ -1191,62 +1201,87 @@ int MCredProcessConfig( case mcaMaxIPE: - if (L->IP == NULL) - break; - - __MCredParseLimit( - ValLine, - &L->IP->SLimit[mptMaxPE][0], - &L->IP->HLimit[mptMaxPE][0]); + if (L->IP == NULL) + { + L->IP = (mpu_t *)calloc(1,sizeof(mpu_t)); + } + if (L->IP != NULL) + { + __MCredParseLimit( + ValLine, + &L->IP->SLimit[mptMaxPE][0], + &L->IP->HLimit[mptMaxPE][0]); + } + break; case mcaMaxIProc: - if (L->IP == NULL) - break; + if (L->IP == NULL) + { + L->IP = (mpu_t *)calloc(1,sizeof(mpu_t)); + } + + if (L->IP != NULL) + { + __MCredParseLimit( + ValLine, + &L->IP->SLimit[mptMaxProc][0], + &L->IP->HLimit[mptMaxProc][0]); + } - __MCredParseLimit( - ValLine, - &L->IP->SLimit[mptMaxProc][0], - &L->IP->HLimit[mptMaxProc][0]); - break; case mcaMaxIPS: - if (L->IP == NULL) - break; + if (L->IP == NULL) + { + L->IP = (mpu_t *)calloc(1,sizeof(mpu_t)); + } + + if (L->IP != NULL) + { + __MCredParseLimit( + ValLine, + &L->IP->SLimit[mptMaxPS][0], + &L->IP->HLimit[mptMaxPS][0]); + } - __MCredParseLimit( - ValLine, - &L->IP->SLimit[mptMaxPS][0], - &L->IP->HLimit[mptMaxPS][0]); - break; case mcaMaxIWC: - if (L->IP == NULL) - break; + if (L->IP == NULL) + { + L->IP = (mpu_t *)calloc(1,sizeof(mpu_t)); + } + + if (L->IP != NULL) + { + __MCredParseLimit( + ValLine, + &L->IP->SLimit[mptMaxWC][0], + &L->IP->HLimit[mptMaxWC][0]); + } - __MCredParseLimit( - ValLine, - &L->IP->SLimit[mptMaxWC][0], - &L->IP->HLimit[mptMaxWC][0]); - break; case mcaMaxIMem: - if (L->IP == NULL) - break; + if (L->IP == NULL) + { + L->IP = (mpu_t *)calloc(1,sizeof(mpu_t)); + } + + if (L->IP != NULL) + { + __MCredParseLimit( + ValLine, + &L->IP->SLimit[mptMaxMem][0], + &L->IP->HLimit[mptMaxMem][0]); + } - __MCredParseLimit( - ValLine, - &L->IP->SLimit[mptMaxMem][0], - &L->IP->HLimit[mptMaxMem][0]); - break; case mcaOMaxJob: