diff --git a/campaign1.py b/campaign1.py index 1a966afbc4b43cdea8730d542edd5b4f2c2db4c3..91d06817cd8fc56f8f63db8b2dc86f570dee455f 100755 --- a/campaign1.py +++ b/campaign1.py @@ -17,16 +17,15 @@ random.seed(1997) nb_expe = 50 - start_dates = [random.randint(jun1, nov30 - 72 * 3600) for _ in range(nb_expe)] -xp_a_relancer = [7, 26] +#xp_a_relancer = [7, 26] with concurrent.futures.ProcessPoolExecutor() as executor: instances = [] - # for i in range(nb_expe): - for i in xp_a_relancer: + for i in range(nb_expe): + # for i in xp_a_relancer: print(f"Submit expe {i}") # start_instance(expe_num, start_date, prepare_workload, clean_log) instances.append(executor.submit(start_instance, i, start_dates[i], False, True)) diff --git a/campaign2.py b/campaign2.py new file mode 100755 index 0000000000000000000000000000000000000000..364e8d9b68e1b19786ba436f7577f631f3442850 --- /dev/null +++ b/campaign2.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +import random +from time import * +import concurrent.futures + +from instance1 import start_instance + +# Prepare the start date samples +begin_trace = 1356994806 # according to original SWF header +jun1_unix_time = mktime(strptime('Sun Jun 1 00:00:00 2014')) +nov30_unix_time = mktime(strptime('Sun Nov 30 23:59:59 2014')) +jun1 = (int)(jun1_unix_time - begin_trace) +nov30 = (int)(nov30_unix_time - begin_trace) + +random.seed(4186341) +nb_expe = 50 + + +# TODO +# We fix the demand response window to be at 16 on day 2 + + +# start_dates = [random.randint(jun1, nov30 - 72 * 3600) +# for _ in range(nb_expe)] + +# with concurrent.futures.ProcessPoolExecutor() as executor: +# instances = [] +# for i in range(nb_expe): +# print(f"Submit expe {i}") +# # start_instance(expe_num, start_date, prepare_workload, clean_log) +# instances.append(executor.submit( +# start_instance, i, start_dates[i], False, True)) + +# for instance in concurrent.futures.as_completed(instances): +# print(f"Expe {instance.result()} terminated")