Skip to content
Snippets Groups Projects
Commit 1d7fe705 authored by Millian Poquet's avatar Millian Poquet
Browse files

Merge branch 'feature/nix-ci'

parents 86943d1c 1670c562
Branches
No related tags found
No related merge requests found
Showing with 948 additions and 1242 deletions
.envrc 0 → 100644
use nix
*.user
build
test-out
test-instances
image: oarteam/robin_ci
image: oarteam/batsim_ci
variables:
GIT_SUBMODULE_STRATEGY: none
stages:
- build
- update_dependencies_cache
- test
###############################################################################
# Build stage
###############################################################################
build:
stage: build
script:
- mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build
- |
nix-shell /datamovepkgs -A batsched \
--command 'cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-Denable_warnings=ON \
-Dtreat_warnings_as_errors=ON'
- nix-shell /datamovepkgs -A batsched --command 'make'
artifacts:
paths:
- ${CI_PROJECT_DIR}/build/batsched
- ./ci/build.bash
###############################################################################
# Test stage
# Dependencies cache stage
###############################################################################
# batsim_tests:
# stage: test
# script:
# # Remove nix-installed batsched
# - nix-env -e batsched-v1.1.0
# # Install ci-built batsched
# - export PATH="${PATH}:${CI_PROJECT_DIR}/build"
# # Install and run the redis server
# - nix-env -i redis
# - |
# redis-server>/dev/null &
# while ! nc -z localhost 6379; do
# sleep 1
# done
# # Prepare Batsim directory to generate the tests
# - mkdir -p /batsim/build
# - cd /batsim/build
# - nix-shell /datamovepkgs -A batsim --command 'cmake ..'
update_dependencies_cache:
stage: update_dependencies_cache
script:
- ./ci/update-dependencies-cache.bash
###############################################################################
# Test stage
###############################################################################
test_pinned_batsim:
stage: test
script:
- nix-shell ./ci -A test_pinned --command './ci/run-tests.bash'
# # Finally run the tests
# - cd /batsim
# - echo "Batsim tests are not run yet."
# - batsched --version
# dependencies:
# - build
test_dev_batsim:
stage: test
script:
- nix-shell ./ci -A test_dev --command './ci/run-tests.bash'
#!/usr/bin/env nix-shell
#! nix-shell . -i bash -A batsched_local
set -eux
# Start from a clean build directory
rm -rf ./build
mkdir -p ./build
# Usual cmake build stuff
cd ./build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-Denable_warnings=ON \
-Dtreat_warnings_as_errors=OFF
make -j $(nproc)
let
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/18.03.tar.gz") {};
kapack = import
( fetchTarball "https://github.com/oar-team/kapack/archive/master.tar.gz")
{ inherit pkgs; };
in
let
callPackage = pkgs.lib.callPackageWith (pkgs // pkgs.xlibs // self // kapack);
self = rec {
inherit pkgs kapack;
# Redefine some packages for clarity's sake
batexpe = kapack.batexpe;
batsim_pinned = (kapack.batsim_dev.override {}).overrideAttrs (attrs: rec {
name = "batsim-${version}";
version = "2.0.0-pinned";
src = pkgs.fetchgit {
url = "https://framagit.org/batsim/batsim.git";
rev = "117ce271e806e0492786b38e62145117722133d3";
sha256 = "1j15yx25a6r63sgba51l6ph44c81s7vj3m5jfn186sq1pc2b40hg";
};
});
batsim_dev = kapack.batsim_dev;
pytest = pkgs.python36Packages.pytest;
# Packages defined in this tree
batsched_local = callPackage ./local.nix {};
test_deps_pinned = callPackage ./test-deps.nix {
batsim = batsim_pinned;
};
test_deps_dev = callPackage ./test-deps.nix {
batsim = batsim_dev;
};
# Packages meant to be used as shells
test_pinned = callPackage ./test-env.nix {
batsched = batsched_local;
test_deps = test_deps_pinned;
};
test_dev = callPackage ./test-env.nix {
batsched = batsched_local;
test_deps = test_deps_dev;
};
};
in
self
{ stdenv, batsched_dev }:
(batsched_dev.override {}).overrideAttrs (attrs: rec {
name = "batsched-1.2.1-nix-ci";
src = stdenv.lib.sourceByRegex ../. [
"^src$"
"^src/algo$"
"^src/external$"
".*\.cpp$" ".*\.hpp$"
"^cmake$"
"^cmake/Modules$"
".*\.cmake"
".*\.cmake.in"
"^CMakeLists\.txt$"
];
enableParallelBuilding = true;
doCheck = false;
preConfigure = ''
# Always start from a clean build directory
rm -rf ./build
'';
})
#!/usr/bin/env nix-shell
#! nix-shell . -i bash -A test_deps_dev
if [ "$#" -ne 1 ]; then
echo 'usage: pin-batsim.bash BATSIM-REV'
exit 1
fi
rev=$1
nix-prefetch-git \
--url https://framagit.org/batsim/batsim.git \
--rev ${rev} \
> batsim-pinned.json
#!/usr/bin/env nix-shell
#! nix-shell . -i bash -A test_pinned
set -eu
initial_dir=$(realpath .)
# Run a redis server if needed
redis_launched_here=0
r=$(ps faux | grep redis-server | grep -v grep | wc -l)
if [ $r -eq 0 ]
then
echo "Running a Redis server..."
redis-server>/dev/null &
redis_launched_here=1
while ! nc -z localhost 6379; do
sleep 1
done
fi
# Add built batsched in PATH
export PATH=$(realpath ./build):${PATH}
# Set TEST_ROOT so simulation input files can be found
export TEST_ROOT=$(realpath ./test)
# Print which versions are used
echo "batsched realpath: $(realpath $(which batsched))"
echo "batsim realpath: $(realpath $(which batsim))"
echo "robin realpath: $(realpath $(which robin))"
# Execute the tests (TODO: clean tests)
cd test
pytest
failed=$?
# Stop the redis server if it has been launched by this script
if [ $redis_launched_here -eq 1 ]
then
echo "Stopping the Redis server..."
killall redis-server
fi
cd ${initial_dir}
exit ${failed}
{ stdenv, batsim, batexpe,
which, redis, procps, psmisc, pytest,
nix-prefetch-git
}:
stdenv.mkDerivation rec {
name = "batsched-test-deps";
# This package is not meant to be built
unpackPhase = "true";
installPhase = "true";
propagatedBuildInputs = [ batsim batexpe
which redis procps psmisc pytest
nix-prefetch-git
];
}
{ stdenv, batsched, test_deps }:
stdenv.mkDerivation rec {
name = "batsched-test-env";
# This package is not meant to be built
unpackPhase = "true";
installPhase = "true";
propagatedBuildInputs = [ batsched test_deps ];
}
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nix
set -eu
# (re)build up-to-date CI batsched package + deps, push them on binary cache
nix-build ./ci -A test_pinned | cachix push batsim
nix-build ./ci -A test_dev | cachix push batsim
let
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/18.03.tar.gz") {};
kapack = import
( fetchTarball "https://github.com/oar-team/kapack/archive/master.tar.gz")
{ inherit pkgs; };
in
with kapack;
with pkgs;
(batsched_dev.override {}).overrideAttrs (attrs: rec {
name = "batsched-1.2.1-nix-local";
src = ../.;
enableParallelBuilding = true;
doCheck = false;
})
__pycache__
.pytest_cache
### Running tests
```
pytest
```
### How it works?
1. pytest generates combinations of test input (code in [conftest.py][conftest.py])
2. for each combination of inputs: (code in [test_runner.py][test_runner.py])
1. pytest generates a [robin][robin] input file
2. pytest executes [robin][robin] on the generated file
### Running a specific test
You can manually rerun a test with [robin][robin] (a failing one for example):
```
robin test-instances/FAILING-TEST.yaml
```
You can also run batsim and batsched in different terminals:
``` bash
./test-out/FAILING-TEST/cmd/batsim.bash
# feel free to hack — e.g., prepend command with gdb, valgrind...
./test-out/FAILING-TEST/cmd/sched.bash
```
[conftest.py]: ./conftest.py
[test_runner.py]: ./test_runner.py
[robin]: https://framagit.org/batsim/batexpe
#!/usr/bin/env python3
from collections import namedtuple
import glob
from os.path import abspath, basename
Workload = namedtuple('Workload', ['name', 'filename'])
Platform = namedtuple('Platform', ['name', 'filename'])
def pytest_generate_tests(metafunc):
if 'platform' in metafunc.fixturenames:
platform_files = glob.glob('platforms/*.xml')
platforms = [Platform(
name=basename(platform_file).replace('.xml', ''),
filename=abspath(platform_file)) for platform_file in platform_files]
metafunc.parametrize('platform', platforms)
if 'workload' in metafunc.fixturenames:
workload_files = glob.glob('workloads/*.json')
workloads = [Workload(
name=basename(workload_file).replace('.json', ''),
filename=abspath(workload_file)) for workload_file in workload_files]
metafunc.parametrize('workload', workloads)
if 'algo' in metafunc.fixturenames:
algos = [
'filler',
'easy_bf'
]
metafunc.parametrize('algo', algos)
base_output_directory: /tmp/batsched_ft
base_variables:
test_dir: ${base_working_directory}/test
implicit_instances:
# Algorithms without parameters
noparam:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"easy_bf", "sched_name":"easy_bf"}
- {"name":"filler", "sched_name":"filler"}
- {"name":"conservative_bf", "sched_name":"conservative_bf"}
- {"name":"killer", "sched_name":"killer"}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]}
# Easy BF LLH algorithm
easy_bf_plot:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"easy_bf_plot", "sched_name":"easy_bf_plot_liquid_load_horizon"}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate sched options
- |
#!/bin/bash
cat > ${output_directory}/sched_input.json << EOF
{
"trace_output_filename":"${output_directory}/sched_load_log.csv"
}
EOF
# Sleeper algorithm
sleeper:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"sleeper", "sched_name":"sleeper"}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate sched options
- |
#!/bin/bash
cat > ${output_directory}/sched_input.json << EOF
{
"output_dir":"${output_directory}",
"trace_output_filename":"${output_directory}/sched_load_log.csv",
"pstate_compute":0,
"pstate_sleep":13
}
EOF
# Subpart sleeper algorithm
subpart_sleeper:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"subpart_sleeper", "sched_name":"energy_bf_subpart_sleeper"}
awake_fraction: [1.00, 0.90, 0.50]
monitoring_period: [60, 300, 600, 3600]
needed_time_to_sedate: [0e1, 60e1, 600e1, 1e18]
sedate_idle_on_classical_events: ["true", "false"]
ensured_sleep_bounds:
- {"name":"zero", "lower": 0e1, "upper": 0e1}
- {"name":"T", "lower": 0e1, "upper": 1e18}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate sched options
- |
#!/bin/bash
# Since bash associative arrays are not exported, the variables.bash
# is sourced here.
source ${output_directory}/variables.bash
# Let's generate an input file for the scheduler
cat > ${output_directory}/sched_input.json << EOF
{
"output_dir":"${output_directory}",
"trace_output_filename":"${output_directory}/sched_load_log.csv",
"fraction_of_machines_to_let_awake":${awake_fraction},
"monitoring_period":${monitoring_period},
"idle_time_to_sedate":${needed_time_to_sedate},
"sedate_idle_on_classical_events":${sedate_idle_on_classical_events},
"ensured_sleep_time_lower_bound":${ensured_sleep_bounds[lower]},
"ensured_sleep_time_upper_bound":${ensured_sleep_bounds[upper]},
"power_sleep":9.75,
"power_idle":95,
"energy_switch_on":19030,
"power_compute":190.738,
"energy_switch_off":620,
"time_switch_off":6.1,
"pstate_sleep":13,
"pstate_compute":0,
"time_switch_on":152
}
EOF
# Inertial shutdown algorithm
inertial_shutdown:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"inertial_shutdown", "sched_name":"energy_bf_monitoring_inertial"}
monitoring_period: [60, 600]
needed_time_to_sedate: [0e1, 60e1, 1e18]
sedate_idle_on_classical_events: ["true", "false"]
inertial_alteration: ["p2", "x2"]
up_llh_threshold: [0e4, 10e4]
ensured_sleep_bounds:
- {"name":"zero", "lower": 0e1, "upper": 0e1}
- {"name":"T", "lower": 0e1, "upper": 1e18}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate sched options
- |
#!/bin/bash
# Since bash associative arrays are not exported, the variables.bash
# is sourced here.
source ${output_directory}/variables.bash
# Let's generate an input file for the scheduler
cat > ${output_directory}/sched_input.json << EOF
{
"output_dir":"${output_directory}",
"trace_output_filename":"${output_directory}/sched_load_log.csv",
"inertial_alteration":"${inertial_alteration}",
"upper_llh_threshold":${up_llh_threshold},
"monitoring_period":${monitoring_period},
"idle_time_to_sedate":${needed_time_to_sedate},
"sedate_idle_on_classical_events":${sedate_idle_on_classical_events},
"ensured_sleep_time_lower_bound":${ensured_sleep_bounds[lower]},
"ensured_sleep_time_upper_bound":${ensured_sleep_bounds[upper]},
"power_sleep":9.75,
"power_idle":95,
"energy_switch_on":19030,
"power_compute":190.738,
"energy_switch_off":620,
"time_switch_off":6.1,
"pstate_sleep":13,
"pstate_compute":0,
"time_switch_on":152
}
EOF
# Idle sleeper algorithm
idle_sleeper:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"energy_bf_idle_sleeper", "sched_name":"energy_bf_idle_sleeper"}
monitoring_period: [60, 300, 600, 3600]
needed_time_to_sedate: [0e1, 60e1, 600e1, 1e18]
sedate_idle_on_classical_events: ["true", "false"]
ensured_sleep_bounds:
- {"name":"zero", "lower": 0e1, "upper": 0e1}
- {"name":"T", "lower": 0e1, "upper": 1e18}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate sched options
- |
#!/bin/bash
# Since bash associative arrays are not exported, the variables.bash
# is sourced here.
source ${output_directory}/variables.bash
# Let's generate an input file for the scheduler
cat > ${output_directory}/sched_input.json << EOF
{
"output_dir":"${output_directory}",
"trace_output_filename":"${output_directory}/sched_load_log.csv",
"monitoring_period":${monitoring_period},
"idle_time_to_sedate":${needed_time_to_sedate},
"sedate_idle_on_classical_events":${sedate_idle_on_classical_events},
"ensured_sleep_time_lower_bound":${ensured_sleep_bounds[lower]},
"ensured_sleep_time_upper_bound":${ensured_sleep_bounds[upper]},
"power_sleep":9.75,
"power_idle":95,
"energy_switch_on":19030,
"power_compute":190.738,
"energy_switch_off":620,
"time_switch_off":6.1,
"pstate_sleep":13,
"pstate_compute":0,
"time_switch_on":152
}
EOF
commands_before_instances:
# Crashes if there is no redis-server running
- |
#!/bin/bash -ex
# Let's make sure a Redis server is running
redis_running=$(ps faux | grep redis-server | grep -v grep | wc -l)
if test ${redis_running} -eq 0
then
echo "There is no Redis server currently running!"
exit 1
fi
base_output_directory: /tmp/batsched_kth
base_variables:
test_dir: ${base_working_directory}/test
implicit_instances:
# Algorithms without parameters
noparam:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"kth_sp2", "filename":"${test_dir}/workloads/kth_sp2.json"}
algo:
- {"name":"easy_bf", "sched_name":"easy_bf"}
- {"name":"filler", "sched_name":"filler"}
- {"name":"conservative_bf", "sched_name":"conservative_bf"}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]}
# Subpart sleeper algorithm
subpart_sleeper:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"kth_sp2", "filename":"${test_dir}/workloads/kth_sp2.json"}
algo:
- {"name":"subpart_sleeper", "sched_name":"energy_bf_subpart_sleeper"}
awake_fraction: [0.50]
monitoring_period: [300]
needed_time_to_sedate: [0e1, 1e18]
sedate_idle_on_classical_events: ["false"]
ensured_sleep_bounds:
- {"name":"zero", "lower": 0e1, "upper": 0e1}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate sched options
- |
#!/bin/bash
# Since bash associative arrays are not exported, the variables.bash
# is sourced here.
source ${output_directory}/variables.bash
# Let's generate an input file for the scheduler
cat > ${output_directory}/sched_input.json << EOF
{
"output_dir":"${output_directory}",
"trace_output_filename":"${output_directory}/sched_load_log.csv",
"fraction_of_machines_to_let_awake":${awake_fraction},
"monitoring_period":${monitoring_period},
"idle_time_to_sedate":${needed_time_to_sedate},
"sedate_idle_on_classical_events":${sedate_idle_on_classical_events},
"ensured_sleep_time_lower_bound":${ensured_sleep_bounds[lower]},
"ensured_sleep_time_upper_bound":${ensured_sleep_bounds[upper]},
"power_sleep":9.75,
"power_idle":95,
"energy_switch_on":19030,
"power_compute":190.738,
"energy_switch_off":620,
"time_switch_off":6.1,
"pstate_sleep":13,
"pstate_compute":0,
"time_switch_on":152
}
EOF
# Inertial shutdown algorithm
inertial_shutdown:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"kth_sp2", "filename":"${test_dir}/workloads/kth_sp2.json"}
algo:
- {"name":"inertial_shutdown", "sched_name":"energy_bf_monitoring_inertial"}
monitoring_period: [300]
needed_time_to_sedate: [0e1, 1e18]
sedate_idle_on_classical_events: ["false"]
inertial_alteration: ["x2"]
up_llh_threshold: [1e4]
ensured_sleep_bounds:
- {"name":"zero", "lower": 0e1, "upper": 0e1}
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate sched options
- |
#!/bin/bash
# Since bash associative arrays are not exported, the variables.bash
# is sourced here.
source ${output_directory}/variables.bash
# Let's generate an input file for the scheduler
cat > ${output_directory}/sched_input.json << EOF
{
"output_dir":"${output_directory}",
"trace_output_filename":"${output_directory}/sched_load_log.csv",
"inertial_alteration":"${inertial_alteration}",
"upper_llh_threshold":${up_llh_threshold},
"monitoring_period":${monitoring_period},
"idle_time_to_sedate":${needed_time_to_sedate},
"sedate_idle_on_classical_events":${sedate_idle_on_classical_events},
"ensured_sleep_time_lower_bound":${ensured_sleep_bounds[lower]},
"ensured_sleep_time_upper_bound":${ensured_sleep_bounds[upper]},
"power_sleep":9.75,
"power_idle":95,
"energy_switch_on":19030,
"power_compute":190.738,
"energy_switch_off":620,
"time_switch_off":6.1,
"pstate_sleep":13,
"pstate_compute":0,
"time_switch_on":152
}
EOF
commands_before_instances:
# Crashes if there is no redis-server running
- |
#!/bin/bash -ex
# Let's make sure a Redis server is running
redis_running=$(ps faux | grep redis-server | grep -v grep | wc -l)
if test ${redis_running} -eq 0
then
echo "There is no Redis server currently running!"
exit 1
fi
base_output_directory: /tmp/no_redis
base_variables:
test_dir: ${base_working_directory}/test
implicit_instances:
# Algorithms without parameters
noparam:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"easy_bf", "sched_name":"easy_bf"}
- {"name":"filler", "sched_name":"filler"}
- {"name":"conservative_bf", "sched_name":"conservative_bf"}
- {"name":"killer", "sched_name":"killer"}
redis_enabled: ["false"]
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload --config-file ${output_directory}/batsim.conf -vdebug
sched_command: batsched -v ${algo[sched_name]}
commands_before_execution:
# Generate Batsim config file
- |
#!/bin/bash
cat > ${output_directory}/batsim.conf << EOF
{
"redis": {
"enabled": ${redis_enabled}
},
"job_submission": {
"forward_profiles": true
}
}
EOF
inertial_shutdown:
sweep:
platform :
- {"name":"homo128", "filename":"${test_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"hello", "filename":"${test_dir}/workloads/hello.json"}
- {"name":"medium_late", "filename":"${test_dir}/workloads/medium_late.json"}
algo:
- {"name":"inertial_shutdown", "sched_name":"energy_bf_monitoring_inertial"}
monitoring_period: [60, 600]
needed_time_to_sedate: [0e1, 60e1, 1e18]
sedate_idle_on_classical_events: ["true", "false"]
inertial_alteration: ["p2", "x2"]
up_llh_threshold: [0e4, 10e4]
ensured_sleep_bounds:
- {"name":"zero", "lower": 0e1, "upper": 0e1}
- {"name":"T", "lower": 0e1, "upper": 1e18}
redis_enabled: ["false"]
generic_instance:
timeout: 3600
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${instance_id}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out --mmax-workload -vnetwork-only --config-file ${output_directory}/batsim.conf
sched_command: batsched -v ${algo[sched_name]} --variant_options_filepath ${output_directory}/sched_input.json
commands_before_execution:
# Generate Batsim config file
- |
#!/bin/bash
cat > ${output_directory}/batsim.conf << EOF
{
"redis": {
"enabled": ${redis_enabled}
},
"job_submission": {
"forward_profiles": true
}
}
EOF
# Generate sched options
- |
#!/bin/bash
# Since bash associative arrays are not exported, the variables.bash
# is sourced here.
source ${output_directory}/variables.bash
# Let's generate an input file for the scheduler
cat > ${output_directory}/sched_input.json << EOF
{
"output_dir":"${output_directory}",
"trace_output_filename":"${output_directory}/sched_load_log.csv",
"inertial_alteration":"${inertial_alteration}",
"upper_llh_threshold":${up_llh_threshold},
"monitoring_period":${monitoring_period},
"idle_time_to_sedate":${needed_time_to_sedate},
"sedate_idle_on_classical_events":${sedate_idle_on_classical_events},
"ensured_sleep_time_lower_bound":${ensured_sleep_bounds[lower]},
"ensured_sleep_time_upper_bound":${ensured_sleep_bounds[upper]},
"power_sleep":9.75,
"power_idle":95,
"energy_switch_on":19030,
"power_compute":190.738,
"energy_switch_off":620,
"time_switch_off":6.1,
"pstate_sleep":13,
"pstate_compute":0,
"time_switch_on":152
}
EOF
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment