File: test1.76.bash

package info (click to toggle)
slurm-wlm 22.05.8-4%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 48,492 kB
  • sloc: ansic: 475,246; exp: 69,020; sh: 8,862; javascript: 6,528; python: 6,444; makefile: 4,185; perl: 4,069; pascal: 131
file content (27 lines) | stat: -rwxr-xr-x 904 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
#
# It is assumed this script runs on cpu $1
# 
# Assumptions for embedded values.
# o the running slurm is idle
# o TaskPlugin=task/cgroup

if test -f "/sys/devices/system/cpu/cpu$1/cpufreq/scaling_governor"
	then
		echo "scaling frequency is supported"
	else
		echo "scaling frequency not supported"
		exit 0
fi

sleep 15
smin=$(cat /sys/devices/system/cpu/cpu$1/cpufreq/scaling_min_freq)
scur=$(cat /sys/devices/system/cpu/cpu$1/cpufreq/scaling_cur_freq)
smax=$(cat /sys/devices/system/cpu/cpu$1/cpufreq/scaling_max_freq)
sgov=$(cat /sys/devices/system/cpu/cpu$1/cpufreq/scaling_governor)
govs=$(cat /sys/devices/system/cpu/cpu$1/cpufreq/scaling_available_governors)
freqs=$(cat /sys/devices/system/cpu/cpu$1/cpufreq/scaling_available_frequencies)

echo "available_governors $govs"
echo "available_frequencies $freqs"
echo "scaling_values: gov=$sgov min=$smin cur=$scur max=$smax"