Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add get_name for batteries. update dag_from_json to support wfformat 1.4
authorAdrien Gougeon <adrien.gougeon@ens-rennes.fr>
Wed, 15 Nov 2023 15:12:19 +0000 (16:12 +0100)
committerAdrien Gougeon <adrien.gougeon@ens-rennes.fr>
Wed, 15 Nov 2023 15:12:19 +0000 (16:12 +0100)
examples/cpp/dag-from-json-simple/dag.json
include/simgrid/plugins/battery.hpp
src/dag/loaders.cpp

index ea77850..fecb6e4 100644 (file)
@@ -2,35 +2,35 @@
   "name": "simple_json",
   "schemaVersion": "1.0",
   "workflow": {
-    "makespan": 0,
+    "makespanInSeconds": 0,
     "executedAt": "2023-03-09T00:00:00-00:00",
     "tasks": [
       {
         "name": "c1",
         "type": "compute",
         "parents": [],
-        "runtime": 1e9,
+        "runtimeInSeconds": 1e9,
         "machine": "Tremblay"
       },
       {
         "name": "t1",
         "type": "transfer",
         "parents": ["c1"],
-        "bytesWritten": 5e8,
+        "writtenBytes": 5e8,
         "machine": "Jupiter"
       },
       {
         "name": "c2",
         "type": "compute",
         "parents": [],
-        "runtime": 5e9,
+        "runtimeInSeconds": 5e9,
         "machine": "Jupiter"
       },
       {
         "name": "c3",
         "type": "compute",
         "parents": ["t1","c2"],
-        "runtime": 2e9,
+        "runtimeInSeconds": 2e9,
         "machine": "Jupiter"
       }
     ],
index 058428b..61937a9 100644 (file)
@@ -133,6 +133,7 @@ public:
   void set_load(const std::string& name, double power_w);
   void set_load(const std::string& name, bool active);
   void connect_host(s4u::Host* host, bool active = true);
+  std::string get_name() {return name_;}
   double get_state_of_charge();
   double get_state_of_health();
   double get_capacity();
index 8520de5..57ec032 100644 (file)
@@ -107,7 +107,7 @@ std::vector<ActivityPtr> create_DAG_from_json(const std::string& filename)
   for (auto const& task: data["workflow"]["tasks"]) {
     if (task["type"] == "compute") {
       current =
-          Exec::init()->set_name(task["name"].get<std::string>())->set_flops_amount(task["runtime"].get<double>());
+          Exec::init()->set_name(task["name"].get<std::string>())->set_flops_amount(task["runtimeInSeconds"].get<double>());
       if (task.contains("machine"))
         dynamic_cast<Exec*>(current.get())
             ->set_host(simgrid::s4u::Engine::get_instance()->host_by_name(task["machine"].get<std::string>()));
@@ -115,7 +115,7 @@ std::vector<ActivityPtr> create_DAG_from_json(const std::string& filename)
     else if (task["type"] == "transfer"){
       current = Comm::sendto_init()
                     ->set_name(task["name"].get<std::string>())
-                    ->set_payload_size(task["bytesWritten"].get<double>());
+                    ->set_payload_size(task["writtenBytes"].get<double>());
       if (task.contains("machine"))
         comms_destinations[current] =
             simgrid::s4u::Engine::get_instance()->host_by_name(task["machine"].get<std::string>());