Commit bac3ed53 authored by Azat Khuziyakhmetov's avatar Azat Khuziyakhmetov
Browse files

initial commit to rcm docs

parent e3a1ca2a
# Recommendation system
This is the implementation of the recommendation system in the project ProfiT-HPC.
The main components of the system are:
- attributes
- rules
The attributes are functions which check some basic parameters and return a single value from the specified set of values.
Rules are formed by combining the attributes and assuming that they equal to a particular value.
The corresponding documentation on the attributes and rules implemented in the system can be found at `./docs`, namely at [docs/attributes](./docs/ and [docs/rules](./docs/
......@@ -112,16 +112,18 @@ class Attributes:
return res
def duration_ratio(Aggr):
dur_ratio = Aggr.job.run_time / Aggr.job.requested_time
def req_walltime(Aggr):
MIN_R = 4
rtime = Aggr.job.run_time
utime = Aggr.job.requested_time
res = "UNKNOWN"
if dur_ratio > 0.9:
if rtime > MIN_R && utime < rtime/2 && utime < (rtime - SHIFT_R):
res = "HIGH"
elif dur_ratio > 0.5:
res = "ZERO"
res = "LOW"
res = "NORM"
return res
# Attributes
**Definition**: attribute is a property of the job with predefined values.
Here are listed the attributes used for making rules.
## req_walltime
The attribute for the requested walltime.
`HIGH` - The requested walltime is higher than requested
`NORM` - The requested walltime is in the tolerable range
`R` - Requested walltime (hours). `U` - Used walltime (hours).
`HIGH` = `R > 4` & `U < R / 2` & `U < R - 6`
`NORM` = ! `HIGH`
*The `HIGH` values are highlighted*
This diff is collapsed.
import matplotlib.pyplot as plt
import numpy as np
XLIM = 32
YLIM = 20
tx = np.arange(0.0, XLIM)
plt.axis([0, XLIM, 0, YLIM])
plt.ylabel('Used walltime (hours)')
plt.xlabel('Requested walltime (hours)')
plt.grid(True, which="both", linestyle='--')
# lines
x_const = 4
x_is_const = [x_const, x_const], [0, YLIM]
half_x = tx/2
y_is_less = tx - 6
# plot the lines
plt.plot(tx, tx, label="R=U")
plt.plot(*x_is_const, label="R=4")
plt.plot(tx, half_x, label="U=R/2")
plt.plot(tx, y_is_less, label="U=R-6")
# highlight the area
plt.fill_between(tx, half_x, where=tx >= x_const, color='red', alpha=0.3)
plt.fill_between(tx, y_is_less, half_x, where=y_is_less >= half_x, color='red', alpha=0.3)
plt.legend(loc='lower right')
# Rules
Rule is a set of attributes with specified values.
## Request less walltime
`req_walltime` = `HIGH`
Request less walltime
......@@ -5,5 +5,5 @@ RULES = [
{"attrs": {"min_proc_ratio": "HIGH"}, "msg": "All nodes have more processes than requested"},
{"attrs": {"min_proc_ratio": "ZERO"}, "msg": "Some nodes were not used at all"},
{"attrs": {"overloaded_node_exists": True}, "msg": "Some nodes are overloaded. Probably by other processes"},
{"attrs": {"duration_ratio": "LOW"}, "msg": "The requested walltime is too hight. Try to request less time"},
{"attrs": {"req_runtime": "LOW"}, "msg": "The requested walltime is too hight. Try to request less time"},
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment