@@ -8,16 +8,16 @@ synthetic workflow instances with a variety of characteristics. The
88:class: `~wfcommons.generator.generator.WorkflowGenerator ` class uses recipes
99of workflows (as described in :ref: `workflow-recipe-generator-label `)
1010for creating the realistic synthetic instances. The resulting workflows are represented in the
11- WfCommons JSON format (WfFormat) , which is already supported by simulation frameworks such as
11+ :ref: ` json- format-label ` , which is already supported by simulation frameworks such as
1212`WRENCH <https://wrench-project.org >`_.
1313
14-
1514.. _recipes-list :
1615
1716WfCommons Workflows Recipes
1817---------------------------
1918
20- The current list of available workflow recipes include:
19+ This Python package provides several *workflow recipes * for generating realistic
20+ synthetic workflow instances. The current list of available workflow recipes include:
2121
2222- :class: `~wfcommons.wfchef.recipes.blast_recipe.BlastRecipe `: :code: `from wfcommons.wfchef.recipes import BlastWorkflowRecipe `
2323- :class: `~wfcommons.wfchef.recipes.bwa_recipe.BwaRecipe `: :code: `from wfcommons.wfchef.recipes import BwaRecipe `
@@ -34,10 +34,10 @@ The Workflow Instances Generator
3434--------------------------------
3535
3636Synthetic workflow instances are generated using the
37- :class: `~wfcommons.generator.generator.WorkflowGenerator ` class. This
38- class takes as input a :class: `~wfcommons.generator.workflow.abstract_recipe.WorkflowRecipe `
39- object (see above in :ref: `workflow-recipe-generator-label `), and provides two methods for generating synthetic
40- workflow instances:
37+ :class: `~wfcommons.generator.generator.WorkflowGenerator ` class. This class takes
38+ as input a :class: `~wfcommons.generator.workflow.abstract_recipe.WorkflowRecipe `
39+ object (see in :ref: `workflow-recipe-generator-label `), and provides two methods
40+ for generating synthetic workflow instances:
4141
4242- :meth: `~wfcommons.generator.generator.WorkflowGenerator.build_workflow `: generates a single synthetic workflow
4343 instance based on the workflow recipe used to instantiate the generator.
@@ -48,9 +48,9 @@ The build methods use the workflow recipe for generating realistic synthetic
4848workflow instances, in which the workflow structure follows workflow composition
4949rules defined in the workflow recipe, and tasks runtime, and input and output
5050data sizes are generated according to distributions obtained from actual workflow
51- execution instances (see :ref: `traces -label `).
51+ execution instances (see :ref: `instances -label `).
5252
53- Each generated instance is a represented as a :class: `~wfcommons.common.workflow.Workflow `
53+ Each generated instance is represented as a :class: `~wfcommons.common.workflow.Workflow `
5454object (which in itself is an extension of the
5555`NetworkX DiGraph <https://networkx.github.io/documentation/stable/reference/classes/digraph.html >`_
5656class). The :class: `~wfcommons.common.workflow.Workflow ` class provides two
@@ -60,7 +60,7 @@ methods for writing the generated workflow instance into files:
6060- :meth: `~wfcommons.common.workflow.Workflow.write_json `: write a JSON file of a workflow instance.
6161
6262All workflow recipes provide a common method, :code: `from_num_tasks `, that defines the lower
63- bound for the total number of tasks in the synthetic workflow.
63+ bound for the total number of tasks in the generated synthetic workflow.
6464
6565Increasing/Reducing Runtime and File Sizes
6666******************************************
@@ -75,13 +75,11 @@ runtimes and/or files sizes determined by a factor provided by the user:
7575The following example shows how to create a Seismology workflow recipe in which task
7676runtime is increased by 10%, input files by 50%, and output files reduced by 20%: ::
7777
78- from wfcommons.generator import SeismologyRecipe
78+ from wfcommons.wfchef.recipes import SeismologyRecipe
7979
8080 # creating a Seismology workflow recipe with increased/decreased runtime and file sizes
8181 recipe = SeismologyRecipe.from_num_tasks(num_tasks=100, runtime_factor=1.1, input_file_size_factor=1.5, output_file_size_factor=0.8)
8282
83-
84-
8583Examples
8684--------
8785
@@ -110,4 +108,36 @@ workflow instances for every size defined in the array :code:`num_tasks`: ::
110108 workflows = generator.build_workflows(10)
111109
112110 for i, workflow in enumerate(workflows):
113- workflow.write_json(f'blast-workflow-{task}-{i}.json')
111+ workflow.write_json(f'blast-workflow-{task}-{i}.json')
112+
113+
114+
115+
116+
117+ Examples
118+ --------
119+
120+ The following example generates 10 *Epigenomics * synthetic workflow instances
121+ based on the number of tasks entered by the user (1000), builds the synthetic workflow instances, and writes the
122+ synthetic instances to JSON files. ::
123+
124+ from wfcommons.wfchef.recipes import EpigenomicsRecipe
125+ from wfcommons.generator import WorkflowGenerator
126+
127+ generator = WorkflowGenerator(EpigenomicsRecipe.from_num_tasks(1000))
128+ for i, workflow in enumerate(generator.build_workflows(10)):
129+ workflow.write_json(f'epigenomics-workflow-{i}.json')
130+
131+ The example below generates a *Cycles * (agroecosystem) synthetic workflow instance based on the number
132+ of tasks entered by the user (250), builds the synthetic workflow instance, and writes the synthetic
133+ instance to a JSON file. ::
134+
135+ from wfcommons.wfchef.recipes import CyclesRecipe
136+ from wfcommons.generator import WorkflowGenerator
137+
138+ generator = WorkflowGenerator(CyclesRecipe.from_num_tasks(250))
139+ workflow = generator.build_workflow()
140+ workflow.write_json(f'cycles-workflow.json')
141+
142+ ..
143+ maybe we should pout examples only on generator, because we need it
0 commit comments