@@ -75,6 +75,59 @@ namespace wrench {
75
75
bool enforce_num_cores = false ,
76
76
bool ignore_avg_cpu = false ,
77
77
bool show_warnings = false );
78
+
79
+
80
+ /* *
81
+ * @brief Create an abstract workflow based on a JSON file in the WfFormat (version 1.4) from WfCommons. This method
82
+ * makes executive decisions when information in the JSON file is incomplete and/or contradictory. Pass true
83
+ * as the last argument to see all warnings on stderr.
84
+ *
85
+ *
86
+ * @param json_string: the JSON string
87
+ * @param reference_flop_rate: a reference compute speed (in flops/sec), assuming a task's computation is purely flops.
88
+ * This is needed because JSON files specify task execution times in seconds,
89
+ * but the WRENCH simulation needs some notion of "amount of computation" to
90
+ * apply reasonable scaling. (Because the XML platform description specifies host
91
+ * compute speeds in flops/sec). The times in the JSON file are thus assumed to be
92
+ * obtained on an machine with flop rate reference_flop_rate. NOTE: This is only used
93
+ * if the JSON file does not provide information regarding the machine on which a task
94
+ * was executed. In this case, the machine speed information is used.
95
+ * @param ignore_machine_specs: If true, always use the above reference_flop_rate instead of using the machine speed information
96
+ * if provided in the JSON file. (default if false)
97
+ * @param redundant_dependencies: Workflows provided by WfCommons
98
+ * sometimes include control/data dependencies between tasks that are already induced by
99
+ * other control/data dependencies (i.e., they correspond to transitive
100
+ * closures or existing edges in the workflow graphs). Passing redundant_dependencies=true
101
+ * force these "redundant" dependencies to be added as edges in the workflow. Passing
102
+ * redundant_dependencies=false will ignore these "redundant" dependencies. Most users
103
+ * would likely pass "false".
104
+ * @param ignore_cycle_creating_dependencies: if true, simply ignore dependencies that would make the workflow graph
105
+ * acyclic. If false, throw an exception if the workflow graph would be made acyclic by
106
+ * adding a dependency.
107
+ * @param min_cores_per_task: If the JSON file does not specify a number of cores for a task, the minimum number of
108
+ * cores on which the task can run is set to this value. (default is 1)
109
+ * @param max_cores_per_task: If the JSON file does not specify a number of cores for a task, the maximum number of
110
+ * cores on which the task can run is set to this value. (default is 1)
111
+ * @param enforce_num_cores: Use the min_cores_per_task and max_cores_per_task values even if the JSON file specifies
112
+ * a number of cores for a task. (default is false)
113
+ * @param ignore_avg_cpu: In WfCommons tasks can include a avgCPU field. If this field is provided, it is used to determine
114
+ * the fraction of the task's execution time that corresponds to CPU usage, which is then used
115
+ * to compute the task's work in flop. If set to true, then the task's execution time reported in the
116
+ * JSON will be assumed to be 100% CPU work. (default is false)
117
+ * @param show_warnings: Show all warnings. (default is false)
118
+ * @return a workflow
119
+ */
120
+
121
+ static std::shared_ptr<Workflow> createWorkflowFromJSONString (const std::string &json_string,
122
+ const std::string &reference_flop_rate,
123
+ bool ignore_machine_specs = false ,
124
+ bool redundant_dependencies = false ,
125
+ bool ignore_cycle_creating_dependencies = false ,
126
+ unsigned long min_cores_per_task = 1 ,
127
+ unsigned long max_cores_per_task = 1 ,
128
+ bool enforce_num_cores = false ,
129
+ bool ignore_avg_cpu = false ,
130
+ bool show_warnings = false );
78
131
};
79
132
80
133
}// namespace wrench
0 commit comments