Hi.

Attached is a patch to implement the CHARGEPOLICY=DEBITALLPE flag in AMCFG.

It should work out of the box with FILE and QBANK accounting.  In gold you 
need the following to change from processor to PE accounting:

goldsh Attribute Create Object=Job Name=PE DataType=Float
goldsh ChargeRate Create Type=Resource Name=PE Rate=1.0
goldsh ChargeRate Modify Type==Resource Name==Processors Rate=0.0

The charge rates should then look something like:

goldsh ChargeRate Query

Type     Name       Rate Description
-------- ---------- ---- -----------
Resource PE         1
Resource Processors 0


Regards,
r.

-- 

  The Computer Center, University of Tromsø, N-9037 TROMSØ Norway.
              phone:+47 77 64 41 07, fax:+47 77 64 41 00
        Roy Dragseth, Team Leader, High Performance Computing
         Direct call: +47 77 64 62 56. email: [email protected]

--- ./src/moab/MAM.c.orig	2009-04-02 13:24:48.000000000 +0200
+++ ./src/moab/MAM.c	2009-04-03 12:38:45.000000000 +0200
@@ -116,6 +116,8 @@
  *
  *                                              */
 
+#include <math.h>
+
 #include "moab.h"
 #include "moab-proto.h"
  
@@ -380,6 +382,7 @@
   mnode_t *N;
  
   double ProcConsumptionRate;
+  double PE;
  
   int    ProcCount = 0;
   int    Memory = 0; 
@@ -473,14 +476,15 @@
     } 
 
   ProcConsumptionRate = 1.0;
- 
+  PE = (double)ProcCount;
+
   switch (A->ChargePolicy)
     {
     case mamcpDebitAllPE:
     case mamcpDebitSuccessfulPE:
 
-      /* NO-OP */
- 
+      MJobGetPE(J,&MPar[0],&PE);
+      ProcConsumptionRate = PE / (double)ProcCount;
       break;
  
     case mamcpDebitAllCPU:
@@ -669,6 +673,14 @@
         MXMLAddE(JE,AE);
         }
 
+      if (PE > 0.0)
+        {
+        AE = NULL;
+        MXMLCreateE(&AE,"PE");
+        MXMLSetVal(AE,(void *)&PE,mdfDouble);
+        MXMLAddE(JE,AE);
+        }
+
       if (Memory > 0)
         {
         AE = NULL;
@@ -1116,6 +1128,7 @@
   long    WCLimit;
 
   int     ProcCount;
+  double  PE;
   int     Memory = 0;
 
   char    JobType[MMAX_NAME];
@@ -1236,7 +1249,6 @@
     int nindex;
 
     ProcCount = 0;
-
     for (nindex = 0;J->NodeList[nindex].N != NULL;nindex++)
       {
       ProcCount += J->NodeList[nindex].N->CRes.Procs;
@@ -1247,6 +1259,8 @@
     ProcCount = MAX(1,MJobGetProcCount(J));
     }
 
+  MJobGetPE(J,&MPar[0],&PE);
+
   WCLimit = J->WCLimit;
 
   if (P->UseMachineSpeed == TRUE)
@@ -1424,6 +1438,14 @@
         MXMLAddE(JE,AE);
         }
 
+      if (PE > 0.0)
+        {
+        AE = NULL;
+        MXMLCreateE(&AE,"PE");
+        MXMLSetVal(AE,(void *)&PE,mdfDouble);
+        MXMLAddE(JE,AE);
+        }
+
       if (Memory > 0)
         {
         AE = NULL;
_______________________________________________
mauiusers mailing list
[email protected]
http://www.supercluster.org/mailman/listinfo/mauiusers

Reply via email to