diff --git a/batsim.nix b/batsim.nix new file mode 100644 index 0000000000000000000000000000000000000000..81ef513a697cdb97dc71131abf7587c293f5d7b1 --- /dev/null +++ b/batsim.nix @@ -0,0 +1,14 @@ +let + kapack = import + ( fetchTarball "https://github.com/oar-team/nur-kapack/archive/master.tar.gz") {}; +in + +kapack.pkgs.mkShell rec { + name = "tuto-env-master"; + buildInputs = [ + kapack.batsim-master # simulator + kapack.batsched-master # scheduler + kapack.batexpe-master # experiment management tools + kapack.pkgs.curl # used to retrieve batsim workloads/platforms + ]; +} diff --git a/generationJson.py b/generationJson.py new file mode 100755 index 0000000000000000000000000000000000000000..ac57279c351df567371b1b7b240456952f6dd306 --- /dev/null +++ b/generationJson.py @@ -0,0 +1,52 @@ +import json +import random +#Author : Karim /Adem + +data = { + "nb_res": 3, + "jobs": [ + {"id": 1, "subtime": 0, "walltime": 100, "res": 1, "profile": "France_2018"}, + {"id": 2, "subtime": 100, "walltime": 200, "res": 1, "profile": "France_2019"}, + {"id": 3, "subtime": 200, "walltime": 300, "res": 1, "profile": "France_2020"}, + {"id": 4, "subtime": 300, "walltime": 400, "res": 1, "profile": "France_2021"}, + {"id": 5, "subtime": 400, "walltime": 500, "res": 2, "profile": "Morocco_2018"}, + {"id": 6, "subtime": 500, "walltime": 600, "res": 2, "profile": "Morocco_2019"}, + {"id": 7, "subtime": 600, "walltime": 700, "res": 2, "profile": "Morocco_2020"}, + {"id": 8, "subtime": 700, "walltime": 800, "res": 2, "profile": "Morocco_2021"}, + {"id": 9, "subtime": 800, "walltime": 900, "res": 3, "profile": "USA_2018"}, + {"id": 10, "subtime": 900, "walltime": 1000, "res": 3, "profile": "USA_2019"}, + {"id": 11, "subtime": 1000, "walltime": 1100, "res": 3, "profile": "USA_2020"}, + {"id": 12, "subtime": 1100, "walltime": 1200, "res": 3, "profile": "USA_2021"} + ], + "profiles": { + + } +} + +# On génère des valeurs aléatoires avec une marge de 2 en partant sur de "vrai" données +def generate_random_carbon(base, margin=2): + return f"{random.randint(base - margin, base + margin)}kg" + +# Profils avec les émissions de carbone spécifiques et la marge de ±2kg +specific_carbon_emissions = { + "France_2018": 67, "France_2019": 69, "France_2020": 67, "France_2021": 65, + "Morocco_2018": 613, "Morocco_2019": 627, "Morocco_2020": 642, "Morocco_2021": 631, + "USA_2018": 412, "USA_2019": 393, "USA_2020": 369, "USA_2021": 379 +} + + +for profile, base_emission in specific_carbon_emissions.items(): + data["profiles"][profile] = { + "type": "delay", + "delay": 1, + "carbon_emission": generate_random_carbon(base_emission) + } + +# nom du fichier en sortie +filename = 'jsonInput.json' + +# On écrit les données dans le fichier Json +with open(filename, 'w') as file: + json.dump(data, file, indent=4) + +print(filename) diff --git a/multicloud.xml b/multicloud.xml new file mode 100644 index 0000000000000000000000000000000000000000..b0c22bdb151445d9070a802a203c250890f75204 --- /dev/null +++ b/multicloud.xml @@ -0,0 +1,38 @@ +<?xml version='1.0'?> +<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd"> +<platform version="4.1"> + +<zone id="AS0" routing="Full"> + <cluster id="dcA" prefix="a" suffix="" radical="0-511" + speed="1Gf" bw="125MBps" lat="50us" bb_bw="2.25GBps" + bb_lat="500us" /> + <cluster id="dcB" prefix="b" suffix="" radical="0-511" + speed="1Gf" bw="125MBps" lat="50us" bb_bw="2.25GBps" + bb_lat="500us" /> + <cluster id="dcC" prefix="c" suffix="" radical="0-511" + speed="1Gf" bw="125MBps" lat="50us" bb_bw="2.25GBps" + bb_lat="500us" /> + + <cluster id="mastercluster" prefix="master_host" suffix="" radical="0-0" + speed="1Gf" bw="125MBps" lat="50us" bb_bw="2.25GBps" + bb_lat="500us"> + <prop id="role" value="master" /> + </cluster> + + <link id="backbone" bandwidth="1.25GBps" latency="500us" /> + + <zoneRoute src="dcA" dst="mastercluster" gw_src="adcA_router" + gw_dst="master_hostmastercluster_router"> + <link_ctn id="backbone" /> + </zoneRoute> + <zoneRoute src="dcB" dst="mastercluster" gw_src="bdcB_router" + gw_dst="master_hostmastercluster_router"> + <link_ctn id="backbone" /> + </zoneRoute> + <zoneRoute src="dcC" dst="mastercluster" gw_src="cdcC_router" + gw_dst="master_hostmastercluster_router"> + <link_ctn id="backbone" /> + </zoneRoute> + +</zone> +</platform>