Statistics
| Branch: | Revision:

iof-tools / utils / cpu-counter.sh @ a256629c

History | View | Annotate | Download (333 Bytes)

1
#!/bin/bash
2

    
3
# This script can be used to count the number of cpus reserved
4
# After setting up the environment, copy it in the cpu_info dir and execute it.
5

    
6
tot=0
7

    
8
for f in `ls node*`
9
do
10
  cpu=`cat $f | json_pp | grep "ansible_processor_vcpus" | cut -d ":" -f2 | cut -d"," -f1 | cut -d " " -f2`
11
  tot=$((tot + cpu))  
12
done
13
echo $tot