Commit 6cbf60b2 authored by Millian Poquet's avatar Millian Poquet
Browse files

Tests cleanup, CMake test integration

parent 354c3648
......@@ -131,3 +131,95 @@ endif()
if (ignore_assertions)
target_compile_definitions(batsim PRIVATE NDEBUG)
endif()
###########
# Testing #
###########
enable_testing()
# Execution scripts tests
add_test(exec1_tiny
${CMAKE_SOURCE_DIR}/tools/experiments/execute_one_instance.py
${CMAKE_SOURCE_DIR}/tools/experiments/instance_examples/pybatsim_filler_tiny.yaml
-od /tmp/batsim_tools_tests/exec1/out/instance_examples/pftiny
-wd ${CMAKE_SOURCE_DIR})
add_test(exec1_medium
${CMAKE_SOURCE_DIR}/tools/experiments/execute_one_instance.py
${CMAKE_SOURCE_DIR}/tools/experiments/instance_examples/pybatsim_filler_medium.yaml
-od /tmp/batsim_tools_tests/exec1/out/instance_examples/pfmedium
-wd ${CMAKE_SOURCE_DIR})
add_test(execN_mixed
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/tools/experiments/instances_examples/pyfiller_tiny_medium_mixed.yaml
-bod /tmp/batsim_tools_tests/execN
-bwd ${CMAKE_SOURCE_DIR})
add_test(execN_ssh1
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_no_energy.yaml
-bwd ${CMAKE_SOURCE_DIR}
-bod /tmp/batsim_tests/ssh1
--mpi_hostfile ${CMAKE_SOURCE_DIR}/test/mpi_hostfile_localhost
--nb_workers_per_host 1)
add_test(execN_ssh2
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_no_energy.yaml
-bwd ${CMAKE_SOURCE_DIR}
-bod /tmp/batsim_tests/ssh2
--mpi_hostfile ${CMAKE_SOURCE_DIR}/test/mpi_hostfile_localhost
--nb_workers_per_host 2)
add_test(execN_ssh4
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_no_energy.yaml
-bwd ${CMAKE_SOURCE_DIR}
-bod /tmp/batsim_tests/ssh4
--mpi_hostfile ${CMAKE_SOURCE_DIR}/test/mpi_hostfile_localhost
--nb_workers_per_host 4)
# Batsim tests
add_test(no_energy
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_no_energy.yaml
-bwd ${CMAKE_SOURCE_DIR})
add_test(energy
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_energy.yaml
-bwd ${CMAKE_SOURCE_DIR})
add_test(walltime
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_walltime.yaml
-bwd ${CMAKE_SOURCE_DIR})
add_test(long_simulation_time
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_long_simulation_time.yaml
-bwd ${CMAKE_SOURCE_DIR})
add_test(space_sharing
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_space_sharing.yaml
-bwd ${CMAKE_SOURCE_DIR})
add_test(smpi
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_smpi.yaml
-bwd ${CMAKE_SOURCE_DIR})
add_test(batexec
${CMAKE_SOURCE_DIR}/tools/experiments/execute_instances.py
${CMAKE_SOURCE_DIR}/test/test_batexec.yaml
-bwd ${CMAKE_SOURCE_DIR})
......@@ -9,16 +9,7 @@
# ‾‾‾‾‾‾‾‾‾‾‾‾‾
# Clean test output directories
\rm -rf test/out/energy
\rm -rf test/out/instance_examples
\rm -rf test/out/sshprocess*
\rm -rf test/out/long_simulation_time
\rm -rf test/out/no_energy
\rm -rf test/out/space_sharing
\rm -rf test/out/smpi
\rm -rf test/out/unique
\rm -rf test/out/walltime
\rm -rf test/out/batexec
\rm -rf /tmp/batsim_tests
# Run a travis server if needed
server_launched_by_me=0
......@@ -41,17 +32,16 @@ tools/experiments/execute_instances.py \
./tools/experiments/instances_examples/pyfiller_tiny_medium_mixed.yaml
# Run different tests
tools/experiments/execute_instances.py test/test_unique.yaml -bod test/out/unique
tools/experiments/execute_instances.py test/test_walltime.yaml -bod test/out/walltime
tools/experiments/execute_instances.py test/test_no_energy.yaml -bod test/out/no_energy
tools/experiments/execute_instances.py test/test_space_sharing.yaml -bod test/out/space_sharing
tools/experiments/execute_instances.py test/test_energy.yaml -bod test/out/energy
tools/experiments/execute_instances.py test/test_energy.yaml -bod test/out/sshprocess1 --mpi_hostfile test/mpi_hostfile_localhost
tools/experiments/execute_instances.py test/test_energy.yaml -bod test/out/sshprocess2 --mpi_hostfile test/mpi_hostfile_localhost --nb_workers_per_host 2
tools/experiments/execute_instances.py test/test_energy.yaml -bod test/out/sshprocess4 --mpi_hostfile test/mpi_hostfile_localhost --nb_workers_per_host 4
tools/experiments/execute_instances.py test/test_walltime.yaml
tools/experiments/execute_instances.py test/test_no_energy.yaml
tools/experiments/execute_instances.py test/test_space_sharing.yaml
tools/experiments/execute_instances.py test/test_energy.yaml
tools/experiments/execute_instances.py test/test_energy.yaml -bod /tmp/batsim_tests/sshprocess1 --mpi_hostfile test/mpi_hostfile_localhost
tools/experiments/execute_instances.py test/test_energy.yaml -bod /tmp/batsim_tests/sshprocess2 --mpi_hostfile test/mpi_hostfile_localhost --nb_workers_per_host 2
tools/experiments/execute_instances.py test/test_energy.yaml -bod /tmp/batsim_tests/sshprocess4 --mpi_hostfile test/mpi_hostfile_localhost --nb_workers_per_host 4
#tools/experiments/execute_instances.py test/test_smpi.yaml -bod test/out/smpi
tools/experiments/execute_instances.py test/test_long_simulation_time.yaml -bod test/out/long_simulation_time
tools/experiments/execute_instances.py test/test_batexec.yaml -bod test/out/batexec
tools/experiments/execute_instances.py test/test_long_simulation_time.yaml
tools/experiments/execute_instances.py test/test_batexec.yaml
# Let's stop the redis server if it has been launched by this script
if [ $server_launched_by_me -eq 1 ]
......
......@@ -4,28 +4,61 @@
#base_working_directory: ~/proj/batsim
# If needed, the output directory of this script can be specified within this file
#base_output_directory: ~/proj/batsim/results
base_output_directory: /tmp/batsim_tests/batexec
base_variables:
batsim_dir: ${base_working_directory}
implicit_instances:
implicit:
sweep:
platform :
- ["smallPF", "platforms/small_platform.xml"]
- {"name":"small", "filename":"${batsim_dir}/platforms/small_platform.xml"}
workload :
- ["tiny", "workload_profiles/test_workload_profile.json"]
pybatsim_algo:
- fillerSched
- {"name":"tiny", "filename":"${batsim_dir}/workload_profiles/test_workload_profile.json"}
generic_instance:
timeout: 10
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${pybatsim_algo}_${workload[0]}
batsim_command: batsim -c -p ${platform[1]} -w ${workload[1]} -e ${output_directory}/out -s ${output_directory}/socket -L
output_directory: ${base_output_directory}/results/${pybatsim_algo[name]}_${workload[name]}_${platform[name]}
batsim_command: batsim -c -p ${platform[filename]} -w ${workload[filename]} -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: echo "I do not even exist."
# commands_before_execution:
# - ls .
# - |
# #!/usr/bin/python3
# print('Hello from python3!')
# - |
# #!/usr/bin/python2
# print 'Hello from python2!'
commands_before_instances:
- |
#!/usr/bin/python2
# Let's check that the base working directory looks like Batsim's
import os
import sys
bwd = os.environ['base_working_directory']
if os.path.isdir(bwd):
dirs = [bwd + '/' + x for x in ['cmake', 'platforms', 'schedulers',
'src', 'tools']]
for dir in dirs:
if not os.path.isdir(dir):
print('The base working directory seems to be bad: there is '
"no '{}' directory.", dir)
sys.exit(1)
sys.exit(0)
else:
print("The base working directory does not exist!")
sys.exit(2)
- |
#!/usr/bin/python2
# Let's clean the output directory if needed
import os
import shutil
import sys
bod = os.environ['base_output_directory']
if os.path.isdir(bod):
dirs = [bod + '/' + x for x in ['instances', 'sweeper', 'results']]
for dir in dirs:
if os.path.isdir(dir):
shutil.rmtree(dir)
sys.exit(0)
......@@ -4,37 +4,65 @@
#base_working_directory: ~/proj/batsim
# If needed, the output directory of this script can be specified within this file
#base_output_directory: ~/proj/batsim/results
base_output_directory: /tmp/batsim_tests/energy
base_variables:
agg_dir: ${base_output_directory}/aggregated
agg_data_file: ${agg_dir}/agg_data.csv
batsim_dir: ${base_working_directory}
implicit_instances:
implicit:
sweep:
platform :
- {"name":"homo128", "filename":"platforms/energy_platform_homogeneous_no_net_128.xml"}
- {"name":"homo128", "filename":"${batsim_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"tiny", "filename":"workload_profiles/test_workload_profile.json"}
- {"name":"medium", "filename":"workload_profiles/batsim_paper_workload_example.json"}
- {"name":"tiny", "filename":"${batsim_dir}/workload_profiles/test_workload_profile.json"}
- {"name":"medium", "filename":"${batsim_dir}/workload_profiles/batsim_paper_workload_example.json"}
pybatsim_algo:
- fillerSched
- easyBackfillNotopo
- {"name":"filler", "algo_name":"fillerSched"}
- {"name":"easy", "algo_name":"easyBackfillNotopo"}
generic_instance:
timeout: 10
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${pybatsim_algo}_${workload["name"]}
batsim_command: batsim -p ${platform["filename"]} -w ${workload["filename"]} -E -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo} -s ${output_directory}/socket
commands_after_execution:
- cat ${output_directory}/out_schedule.csv | tail -n 1 | tr -d '\n' >> ${agg_data_file}
- printf ",${platform['name']},${workload['name']},${pybatsim_algo}\n" >> ${agg_data_file}
output_directory: ${base_output_directory}/results/${pybatsim_algo[name]}_${workload[name]}_${platform[name]}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -E -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo[algo_name]} -s ${output_directory}/socket
commands_before_instances:
- mkdir ${agg_dir}
- printf "nb_jobs,nb_jobs_finished,nb_jobs_success,nb_jobs_killed,success_rate,makespan,max_turnaround_time,scheduling_time,jobs_execution_time_boundary_ratio,consumed_joules,platform,workload,algo\n" > ${agg_data_file}
- |
#!/usr/bin/python2
# Let's check that the base working directory looks like Batsim's
import os
import sys
bwd = os.environ['base_working_directory']
if os.path.isdir(bwd):
dirs = [bwd + '/' + x for x in ['cmake', 'platforms', 'schedulers',
'src', 'tools']]
for dir in dirs:
if not os.path.isdir(dir):
print('The base working directory seems to be bad: there is '
"no '{}' directory.", dir)
sys.exit(1)
sys.exit(0)
else:
print("The base working directory does not exist!")
sys.exit(2)
- |
#!/usr/bin/python2
# Let's clean the output directory if needed
import os
import shutil
import sys
bod = os.environ['base_output_directory']
if os.path.isdir(bod):
dirs = [bod + '/' + x for x in ['instances', 'sweeper', 'results']]
for dir in dirs:
if os.path.isdir(dir):
shutil.rmtree(dir)
sys.exit(0)
commands_after_instances:
- cp ${agg_data_file} ${agg_dir}/copy_of_data_file.csv
- diff ${agg_data_file} ${agg_dir}/copy_of_data_file.csv
......@@ -4,28 +4,62 @@
#base_working_directory: ~/proj/batsim
# If needed, the output directory of this script can be specified within this file
#base_output_directory: ~/proj/batsim/results
base_output_directory: /tmp/batsim_tests/long_simulation_time
base_variables:
batsim_dir: ${base_working_directory}
implicit_instances:
implicit:
sweep:
platform :
- ["smallPF", "platforms/energy_platform_homogeneous_no_net_128.xml"]
- {"name":"homo128", "filename":"${batsim_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- ["long_workload", "workload_profiles/long_workload.json"]
- {"name":"long_workload", "filename":"${batsim_dir}/workload_profiles/long_workload.json"}
pybatsim_algo:
- fillerSched
- {"name":"filler", "algo_name":"fillerSched"}
generic_instance:
timeout: 10
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${pybatsim_algo}_${workload[0]}
batsim_command: batsim -p ${platform[1]} -w ${workload[1]} -E -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo} -s ${output_directory}/socket
# commands_before_execution:
# - ls .
# - |
# #!/usr/bin/python3
# print('Hello from python3!')
# - |
# #!/usr/bin/python2
# print 'Hello from python2!'
output_directory: ${base_output_directory}/results/${pybatsim_algo[name]}_${workload[name]}_${platform[name]}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo[algo_name]} -s ${output_directory}/socket
commands_before_instances:
- |
#!/usr/bin/python2
# Let's check that the base working directory looks like Batsim's
import os
import sys
bwd = os.environ['base_working_directory']
if os.path.isdir(bwd):
dirs = [bwd + '/' + x for x in ['cmake', 'platforms', 'schedulers',
'src', 'tools']]
for dir in dirs:
if not os.path.isdir(dir):
print('The base working directory seems to be bad: there is '
"no '{}' directory.", dir)
sys.exit(1)
sys.exit(0)
else:
print("The base working directory does not exist!")
sys.exit(2)
- |
#!/usr/bin/python2
# Let's clean the output directory if needed
import os
import shutil
import sys
bod = os.environ['base_output_directory']
if os.path.isdir(bod):
dirs = [bod + '/' + x for x in ['instances', 'sweeper', 'results']]
for dir in dirs:
if os.path.isdir(dir):
shutil.rmtree(dir)
sys.exit(0)
......@@ -4,34 +4,64 @@
#base_working_directory: ~/proj/batsim
# If needed, the output directory of this script can be specified within this file
#base_output_directory: ~/proj/batsim/results
base_output_directory: /tmp/batsim_tests/no_energy
base_variables:
agg_dir: ${base_output_directory}/aggregated
batsim_dir: ${base_working_directory}
implicit_instances:
implicit:
sweep:
platform :
- {"name":"smallPF", "filename":"platforms/energy_platform_homogeneous_no_net_128.xml"}
- {"name":"homo128", "filename":"${batsim_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
workload :
- {"name":"tinyWL", "filename": "workload_profiles/test_workload_profile.json"}
- {"name":"mediumWL", "filename": "workload_profiles/batsim_paper_workload_example.json"}
- {"name":"tiny", "filename":"${batsim_dir}/workload_profiles/test_workload_profile.json"}
- {"name":"medium", "filename":"${batsim_dir}/workload_profiles/batsim_paper_workload_example.json"}
pybatsim_algo:
- {"name": "filler", "pybatsim_name": "fillerSched"}
- {"name": "easy", "pybatsim_name": "easyBackfillNotopo"}
- {"name":"filler", "algo_name":"fillerSched"}
- {"name":"easy", "algo_name":"easyBackfillNotopo"}
generic_instance:
timeout: 10
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${pybatsim_algo["name"]}_${workload["name"]}_${platform["name"]}
batsim_command: batsim -p ${platform["filename"]} -w ${workload["filename"]} -e ${output_directory}/out -s ${output_directory}/socket
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo["pybatsim_name"]} -s ${output_directory}/socket
commands_after_execution:
- tools/batsim_output_csv_to_swf.py ${output_directory}/out_jobs.csv ${output_directory}/out_jobs.swf
- cp ${output_directory}/out_jobs.csv ${agg_dir}/${pybatsim_algo["name"]}_${workload["name"]}_${platform["name"]}.csv
- cp ${output_directory}/out_jobs.swf ${agg_dir}/${pybatsim_algo["name"]}_${workload["name"]}_${platform["name"]}.swf
output_directory: ${base_output_directory}/results/${pybatsim_algo[name]}_${workload[name]}_${platform[name]}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo[algo_name]} -s ${output_directory}/socket
commands_before_instances:
- rm -rf ${agg_dir}
- mkdir -p ${agg_dir}
- |
#!/usr/bin/python2
# Let's check that the base working directory looks like Batsim's
import os
import sys
bwd = os.environ['base_working_directory']
if os.path.isdir(bwd):
dirs = [bwd + '/' + x for x in ['cmake', 'platforms', 'schedulers',
'src', 'tools']]
for dir in dirs:
if not os.path.isdir(dir):
print('The base working directory seems to be bad: there is '
"no '{}' directory.", dir)
sys.exit(1)
sys.exit(0)
else:
print("The base working directory does not exist!")
sys.exit(2)
- |
#!/usr/bin/python2
# Let's clean the output directory if needed
import os
import shutil
import sys
bod = os.environ['base_output_directory']
if os.path.isdir(bod):
dirs = [bod + '/' + x for x in ['instances', 'sweeper', 'results']]
for dir in dirs:
if os.path.isdir(dir):
shutil.rmtree(dir)
sys.exit(0)
......@@ -4,29 +4,63 @@
#base_working_directory: ~/proj/batsim
# If needed, the output directory of this script can be specified within this file
#base_output_directory: ~/proj/batsim/results
base_output_directory: /tmp/batsim_tests/smpi
base_variables:
batsim_dir: ${base_working_directory}
implicit_instances:
implicit:
sweep:
platform :
- ["smallPF", "platforms/small_platform.xml"]
- {"name":"small", "filename":"${batsim_dir}/platforms/small_platform.xml"}
workload :
- ["compute", "workload_profiles/test_smpi_compute_only.json"]
- ["mixed", "workload_profiles/test_smpi_mixed_comp_comm.json"]
- {"name":"compute", "filename":"${batsim_dir}/workload_profiles/test_smpi_compute_only.json"}
- {"name":"mixed", "filename":"${batsim_dir}/workload_profiles/test_smpi_mixed_comp_comm.json"}
pybatsim_algo:
- fillerSched
- {"name":"filler", "algo_name":"fillerSched"}
generic_instance:
timeout: 10
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${pybatsim_algo}_${workload[0]}
batsim_command: batsim -p ${platform[1]} -w ${workload[1]} -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo} -s ${output_directory}/socket
# commands_before_execution:
# - ls .
# - |
# #!/usr/bin/python3
# print('Hello from python3!')
# - |
# #!/usr/bin/python2
# print 'Hello from python2!'
output_directory: ${base_output_directory}/results/${pybatsim_algo[name]}_${workload[name]}_${platform[name]}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -e ${output_directory}/out -s ${output_directory}/socket -L
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo[algo_name]} -s ${output_directory}/socket
commands_before_instances:
- |
#!/usr/bin/python2
# Let's check that the base working directory looks like Batsim's
import os
import sys
bwd = os.environ['base_working_directory']
if os.path.isdir(bwd):
dirs = [bwd + '/' + x for x in ['cmake', 'platforms', 'schedulers',
'src', 'tools']]
for dir in dirs:
if not os.path.isdir(dir):
print('The base working directory seems to be bad: there is '
"no '{}' directory.", dir)
sys.exit(1)
sys.exit(0)
else:
print("The base working directory does not exist!")
sys.exit(2)
- |
#!/usr/bin/python2
# Let's clean the output directory if needed
import os
import shutil
import sys
bod = os.environ['base_output_directory']
if os.path.isdir(bod):
dirs = [bod + '/' + x for x in ['instances', 'sweeper', 'results']]
for dir in dirs:
if os.path.isdir(dir):
shutil.rmtree(dir)
sys.exit(0)
......@@ -4,26 +4,68 @@
#base_working_directory: ~/proj/batsim
# If needed, the output directory of this script can be specified within this file
#base_output_directory: ~/proj/batsim/results
base_output_directory: /tmp/batsim_tests/space_sharing
base_variables:
batsim_dir: ${base_working_directory}
implicit_instances:
implicit:
sweep:
platform :
- ["smallPF", "platforms/energy_platform_homogeneous_no_net_128.xml"]
- {"name":"homo128", "filename":"${batsim_dir}/platforms/energy_platform_homogeneous_no_net_128.xml"}
random_seed:
- 0
- 1
- 2
- 3
workload :
- ["tiny", "workload_profiles/test_workload_profile.json"]
- ["medium", "workload_profiles/batsim_paper_workload_example.json"]
- {"name":"tiny", "filename":"${batsim_dir}/workload_profiles/test_workload_profile.json"}
- {"name":"medium", "filename":"${batsim_dir}/workload_profiles/batsim_paper_workload_example.json"}
pybatsim_algo:
- randomSched
- {"name":"random", "algo_name":"randomSched"}
generic_instance:
timeout: 20
working_directory: ${base_working_directory}
output_directory: ${base_output_directory}/results/${pybatsim_algo}_${workload[0]}
batsim_command: batsim -p ${platform[1]} -w ${workload[1]} -h -e ${output_directory}/out -s ${output_directory}/socket
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo} -s ${output_directory}/socket
output_directory: ${base_output_directory}/results/${pybatsim_algo[name]}_${workload[name]}_${platform[name]}_${random_seed}
batsim_command: batsim -p ${platform[filename]} -w ${workload[filename]} -e ${output_directory}/out -s ${output_directory}/socket -L -h
sched_command: python2 schedulers/pybatsim/launcher.py ${pybatsim_algo[algo_name]} -s ${output_directory}/socket
commands_before_instances:
- |
#!/usr/bin/python2
# Let's check that the base working directory looks like Batsim's
import os
import sys
bwd = os.environ['base_working_directory']
if os.path.isdir(bwd):
dirs = [bwd + '/' + x for x in ['cmake', 'platforms', 'schedulers',
'src', 'tools']]
for dir in dirs:
if not os.path.isdir(dir):
print('The base working directory seems to be bad: there is '
"no '{}' directory.", dir)
sys.exit(1)
sys.exit(0)
else:
print("The base working directory does not exist!")
sys.exit(2)
- |
#!/usr/bin/python2
# Let's clean the output directory if needed
import os
import shutil
import sys
bod = os.environ['base_output_directory']
if os.path.isdir(bod):
dirs = [bod + '/' + x for x in ['instances', 'sweeper', 'results']]
for dir in dirs:
if os.path.isdir(dir):
shutil.rmtree(dir)
sys.exit(0)
# This script should be called from Batsim's root directory
# If needed, the working directory of this script can be specified within this file
#base_working_directory: ~/proj/batsim