Test running sbatch command

This commit is contained in:
2018-10-12 17:37:08 +02:00
parent 3c79c4c113
commit c953e724cc
2 changed files with 97 additions and 9 deletions

View File

@@ -5,6 +5,8 @@ extern crate yaml_rust;
use benchmark_repository::BenchmarkRepository;
use std::path::Path;
use std::process::Command;
use yaml_rust::YamlLoader;
fn main()
@@ -19,6 +21,8 @@ fn main()
let content = benchmark_repository.read_file(Path::new("instances.yml"), "config").unwrap();
let instances = &YamlLoader::load_from_str(&content).unwrap()[0];
let mut i = 0;
for configuration in configurations.as_vec().unwrap()
{
for (instance_set_id, instance_set) in instances.as_hash().unwrap()
@@ -40,8 +44,33 @@ fn main()
continue;
}
println!("to do: [{}, {}, {}/{}/{}]", configuration_id, instance_set_id, instance_ipc, instance_domain, instance_number);
let branch_name = benchmark_repository.create_branch_for_job(i);
Command::new("sbatch")
.args(&["/home/pluehne/test-job.sh"])
.env("JOB_BRANCH_NAME", &branch_name)
.output()
.expect("Could not execute command");
i += 1;
if i > 10
{
break;
}
}
if i > 10
{
break;
}
}
if i > 10
{
break;
}
}
benchmark_repository.join();
}