All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit cb71e741 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add tb-set-cpu-usage and tb-set-mem-usage tb commands for use with

plab experiments.

Must be an integer between 1 and 1000. Okay, just kidding: 1<=x<=5
parent 89e3b5d4
......@@ -224,6 +224,11 @@ namespace eval GLOBALS {
# Hidden variable to relax some restrictions for debugging.
variable enforce_user_restrictions 1
# CPU and MEM usage values. Zero means ignore. For now, lets make
# it an integer, 1 <= x <= 5.
variable cpu_usage 0
variable mem_usage 0
}
# Load all our classes
......
......@@ -241,6 +241,8 @@ Simulator instproc run {} {
var_import ::GLOBALS::forcelinkdelays
var_import ::GLOBALS::multiplex_factor
var_import ::GLOBALS::sync_server
var_import ::GLOBALS::cpu_usage
var_import ::GLOBALS::mem_usage
var_import ::TBCOMPAT::objtypes
var_import ::TBCOMPAT::eventtypes
......@@ -309,8 +311,8 @@ Simulator instproc run {} {
$prog updatedb "sql"
}
set fields [list "forcelinkdelays" "uselinkdelays" "usewatunnels" "uselatestwadata" "wa_delay_solverweight" "wa_bw_solverweight" "wa_plr_solverweight" ]
set values [list $forcelinkdelays $uselinkdelays $usewatunnels $uselatestwadata $wa_delay_solverweight $wa_bw_solverweight $wa_plr_solverweight ]
set fields [list "mem_usage" "cpu_usage" "forcelinkdelays" "uselinkdelays" "usewatunnels" "uselatestwadata" "wa_delay_solverweight" "wa_bw_solverweight" "wa_plr_solverweight" ]
set values [list $mem_usage $cpu_usage $forcelinkdelays $uselinkdelays $usewatunnels $uselatestwadata $wa_delay_solverweight $wa_bw_solverweight $wa_plr_solverweight ]
if { $multiplex_factor != {} } {
lappend fields "multiplex_factor"
......
......@@ -680,3 +680,28 @@ proc tb-set-node-startcmd {node command} {
return $newprog
}
#
# More crude controls.
#
proc tb-set-mem-usage {usage} {
var_import ::GLOBALS::mem_usage
if {$usage < 1 || $usage > 5} {
perror "\[tb-set-mem-usage] usage must be 1 <= factor <= 5"
return
}
set mem_usage $usage
}
proc tb-set-cpu-usage {usage} {
var_import ::GLOBALS::cpu_usage
if {$usage < 1 || $usage > 5} {
perror "\[tb-set-cpu-usage] usage must be 1 <= factor <= 5"
return
}
set cpu_usage $usage
}
Markdown is supported
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