(Click to open topic with navigation)
When used solely for usage tracking, Moab Accounting Manager logs resource usage in usage records. This usage can be queried to report what resources were used when and by whom. In this case, there is no need for charge rates, funds, allocations, liens or quotes. There is no need to define account membership. The only real consideration is whether you want to customize the usage record to display usage properties unique to your site.
Set the accounting.mode parameter to usage-tracking in both the goldd.conf and gold.conf files.
Example 22-1: Setting the accounting mode to usage-tracking
You must set the accounting.mode parameter in the server and client configuration files (goldd.conf and gold.conf). After editing the goldd.conf file, you will need to restart goldd.
$ vi /opt/mam/etc/goldd.conf
accounting.mode = usage-tracking
$ vi /opt/mam/etc/gold.conf
accounting.mode = usage-tracking
$ goldd -r
Usage record customization (optional)
As an example, we will add a usage record property to track GPU usage. See the section on Customizing the usage record object for additional examples.
Example 22-2: Adding a GPU Field to the Usage Record
$ goldsh Attribute Create Object=UsageRecord Name=GPUs DataType=Integer
Successfully created 1 attribute
Example 22-3: Selecting the Usage Record fields we would like to see via glsusage
We can select the usage records fields that show up in glsusage by editing the usagerecord.show attribute in the client configuration file (gold.conf). This is the same parameter that would have to be edited for the new GPU attribute to show up in glsusage. The web GUI will automatically display the new attribute.
$ vi /var/gold/etc/gold.conf
usagerecord.show = Id,Instance,User,Account,Machine,Stage,Processors,GPUs,Nodes,Duration,StartTime,EndTime
Integrate Moab Accounting Manager with the Moab Workload Manager
If you have not done so already, you need to configure the Moab suite to interact with Moab Accounting Manager. See Integrate Moab Accounting Manager with Moab Workload Manager for more information.
Now let's submit a job and examine the effects on the accounting system.
Example 22-4: Submit a job
$ echo sleep 300 | msub -A chemistry -l procs=12,walltime=600
After a job completes, the usage is recorded. Let's examine the usage record that was created (see Querying usage records).
Example 22-5: List usage records
$ glsusage
Id Type Instance User Account Machine Processors GPUs Nodes Duration StartTime EndTime
-- ---- -------- ---- --------- ------- ---------- ---- ----- -------- ------------------- -------------------
1 Job Moab.1 amy chemistry colony 12 1 300 2014-05-06 10:11:49 2014-05-06 10:16:49