Commit 92ae80a4 authored by Azat Khuziyakhmetov's avatar Azat Khuziyakhmetov
Browse files

added documentation for the rules

parent d324d5eb
#!/usr/bin/env python3
import os
# Begin import RULES from the array
cur_path = os.path.realpath(__file__)
rules_path = os.path.dirname(cur_path) + "/../../../rules.py"
exec(open(rules_path).read())
# End import
def print_header():
print("# Rules \n"
"\n"
"A rule is a set of [attributes](./attributes.md) with specified values."
"\n")
def format_attr_link(attr):
return "./attributes.md#{}".format(attr)
def print_rule(rule):
print("---")
print("**recommendation**:\n")
print("```")
print(rule["msg"])
print("```")
print("**attributes**:\n")
for attr_name, attr_value in rule["attrs"].items():
print("[{an}]({al}) = `{av}`\n".format(
an = attr_name,
al = format_attr_link(attr_name),
av = attr_value,
))
def main():
print_header()
for arule in RULES:
print_rule(arule)
if __name__ == "__main__":
main()
# Rules
# Rules
Rule is a set of attributes with specified values.
A rule is a set of [attributes](./attributes.md) with specified values.
## Request less walltime
---
**recommendation**:
**Rule**:
```
Some nodes are overloaded. Probably by other processes
```
**attributes**:
`req_walltime` = `HIGH`
[job_nodes_amount](./attributes.md#job_nodes_amount) = `MULT`
[cpu_usage_total_max](./attributes.md#cpu_usage_total_max) = `NORM`
[overloaded_node_exists](./attributes.md#overloaded_node_exists) = `True`
---
**recommendation**:
```
The requested walltime is too hight. Try to request less time
```
**attributes**:
[req_walltime](./attributes.md#req_walltime) = `HIGH`
---
**recommendation**:
```
The CPU usage on some nodes is low, please request less cores or increase amount of processes
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `MULT`
[req_walltime](./attributes.md#req_walltime) = `NORM`
[cpu_usage_total_max](./attributes.md#cpu_usage_total_max) = `LOW`
[node_cpu_usage_min](./attributes.md#node_cpu_usage_min) = `LOW`
[node_cpu_usage_max](./attributes.md#node_cpu_usage_max) = `NORM`
---
**recommendation**:
```
Some nodes were not used during the runtime
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `MULT`
[req_walltime](./attributes.md#req_walltime) = `NORM`
[node_cpu_usage_min](./attributes.md#node_cpu_usage_min) = `ZERO`
[node_cpu_usage_max](./attributes.md#node_cpu_usage_max) = `NORM`
---
**recommendation**:
```
The CPU usage is not distributed equally among the nodes. Try to use the nodes evenly
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `MULT`
[req_walltime](./attributes.md#req_walltime) = `NORM`
[cpu_usage_total_max](./attributes.md#cpu_usage_total_max) = `NORM`
[node_cpu_usage_min](./attributes.md#node_cpu_usage_min) = `LOW`
[node_cpu_usage_max](./attributes.md#node_cpu_usage_max) = `NORM`
---
**recommendation**:
```
The CPU usage of the job is low on all nodes, please request appropriate amount of resources
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `MULT`
[req_walltime](./attributes.md#req_walltime) = `NORM`
[mem_usage_total](./attributes.md#mem_usage_total) = `LOW`
[cpu_usage_total_max](./attributes.md#cpu_usage_total_max) = `LOW`
[node_cpu_usage_min](./attributes.md#node_cpu_usage_min) = `LOW`
---
**recommendation**:
```
The CPU usage of the node is low. It might indicate that the job is not running in full power
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `ONE`
[req_walltime](./attributes.md#req_walltime) = `NORM`
[node_cpu_usage_max](./attributes.md#node_cpu_usage_max) = `LOW`
---
**recommendation**:
```
The node is overloaded. Probably by other processes on the node
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `ONE`
[req_walltime](./attributes.md#req_walltime) = `NORM`
[node_cpu_usage_max](./attributes.md#node_cpu_usage_max) = `NORM`
[overloaded_node_exists](./attributes.md#overloaded_node_exists) = `True`
---
**recommendation**:
```
The node is overloaded and cpu usage of job was high
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `ONE`
[req_walltime](./attributes.md#req_walltime) = `NORM`
[node_cpu_usage_max](./attributes.md#node_cpu_usage_max) = `HIGH`
[overloaded_node_exists](./attributes.md#overloaded_node_exists) = `True`
---
**recommendation**:
```
Swap was used on one of the nodes
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `MULT`
[mem_swap_used](./attributes.md#mem_swap_used) = `True`
---
**recommendation**:
```
Swap was used on the node
```
**attributes**:
[job_nodes_amount](./attributes.md#job_nodes_amount) = `ONE`
[mem_swap_used](./attributes.md#mem_swap_used) = `True`
**Recommendation**:
Request less walltime
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