| 6 | === SLURM sacctl command |
| 7 | |
| 8 | This is probably the easiest way to get energy consumption for your interactive and batch jobs. Once your job has finshed, you can use the |
| 9 | `sacct` command enquire the Slurm database about its energy consumption. For further information and an example |
| 10 | on how to use the command for energy measurements, please see [wiki:/Public/User_Guide/Batch_system#Informationonpastjobsandaccounting accounting]. |
| 11 | |
| 12 | === DCDB (coming soon) |
| 13 | |
| 14 | The "Datacenter Database" very frequently (every 10 seconds) stores measured values from node and infrastructure sensors including power and |
| 15 | energy consumption of the compute nodes. This allows for a very fine grained analysis of consumed energy for your jobs, e.g. by specifying |
| 16 | precise time stamps / ranges and by providing access to measured data from different components like CPU, GPU, memory etc. instead of making |
| 17 | available an accumulated value only. On the other hand it offers a convenient way for analysis of SLURM jobs. |
| 18 | |
| 19 | The DCDB can be queried from the login node using the DCDB client tools. A user guide that |
| 20 | gives some more details on the database and explains how to use it for energy measurements will be attached to this page in the next days. |
| 21 | |
| 22 | === Use /sys files |
| 23 | |
| 24 | The energy meters provide their measured values through the "/sys" filesystem on the nodes using different files. |
| 25 | To query the overall energy (in Joules) a node has consumed so far, you can use the `energy_j` file. |
| 26 | You should integrate readings in your SLURM job script before and after you `srun` your commands to measure |
| 27 | consumed energy by your commands (applications): |
| 28 | |
| 29 | Unit=[Joules] |
| 30 | |
| 31 | **CM Module** |
| 32 | |
| 33 | {{{ |
| 34 | srun sh -c 'if [ $SLURM_LOCALID == 0 ]; then echo ${SLURM_NODEID}: $(cat /sys/devices/platform/sem/energy_j); fi' |
| 35 | }}} |
| 36 | |
| 37 | **ESB Module** |
| 38 | |
| 39 | There are two energy meters present for the ESB nodes, one for the CPU blade and one for the GPU part: |
| 40 | |
| 41 | {{{ |
| 42 | srun sh -c 'if [ $SLURM_LOCALID == 0 ]; then echo ${SLURM_NODEID}: $(cat /sys/devices/platform/sem.1/energy_j); fi' |
| 43 | srun sh -c 'if [ $SLURM_LOCALID == 0 ]; then echo ${SLURM_NODEID}: $(cat /sys/devices/platform/sem.2/energy_j); fi' |
| 44 | }}} |
| 45 | |
| 46 | To get the consumed energy by a multi-node job you have to accumulate all the values which makes it quite cumbersome, |
| 47 | but for running on single nodes (maybe even in an interactive session) reading out current values directly from the files |
| 48 | might be quite useful. |
| 49 | |
| 50 | {{{#!comment jk 2020-09-25 original version |