Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
ewoks
ewoksdask
Commits
0b536477
Commit
0b536477
authored
Dec 09, 2021
by
Wout De Nolf
Browse files
Merge branch 'fix_logging' into 'main'
no explicit logging needed See merge request
!17
parents
248995d8
98e0cd26
Pipeline
#61715
passed with stages
in 2 minutes and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ewoksdask/bindings.py
View file @
0b536477
...
...
@@ -3,7 +3,6 @@ https://docs.dask.org/en/latest/scheduler-overview.html
"""
import
json
import
logging
from
typing
import
Optional
from
dask.distributed
import
Client
from
dask.threaded
import
get
as
multithreading_scheduler
...
...
@@ -17,9 +16,6 @@ from ewokscore.graph import ewoks_jsonload_hook
from
ewokscore.node
import
get_node_label
logger
=
logging
.
getLogger
(
__name__
)
def
execute_task
(
execinfo
,
*
inputs
):
execinfo
=
json
.
loads
(
execinfo
,
object_pairs_hook
=
ewoks_jsonload_hook
)
...
...
@@ -33,27 +29,7 @@ def execute_task(execinfo, *inputs):
varinfo
=
execinfo
[
"varinfo"
],
)
try
:
task
.
execute
()
except
Exception
as
e
:
if
execinfo
[
"enable_logging"
]:
logger
.
error
(
"
\n
EXECUTE %s %s
\n
INPUTS: %s
\n
ERROR: %s"
,
execinfo
[
"node_label"
],
task
,
task
.
input_values
,
e
,
)
raise
if
execinfo
[
"enable_logging"
]
or
True
:
logger
.
info
(
"
\n
EXECUTE %s %s
\n
INPUTS: %s
\n
OUTPUTS: %s"
,
execinfo
[
"node_label"
],
task
,
task
.
input_values
,
task
.
output_values
,
)
task
.
execute
()
return
task
.
output_transfer_data
...
...
@@ -79,7 +55,6 @@ def convert_graph(ewoksgraph, **execute_options):
def
execute_graph
(
graph
,
scheduler
=
None
,
log_task_execution
:
Optional
[
bool
]
=
False
,
results_of_all_nodes
:
Optional
[
bool
]
=
False
,
load_options
:
Optional
[
dict
]
=
None
,
**
execute_options
...
...
@@ -91,9 +66,7 @@ def execute_graph(
raise
RuntimeError
(
"Dask can only execute DAGs"
)
if
ewoksgraph
.
has_conditional_links
:
raise
RuntimeError
(
"Dask cannot handle conditional links"
)
daskgraph
=
convert_graph
(
ewoksgraph
,
enable_logging
=
log_task_execution
,
**
execute_options
)
daskgraph
=
convert_graph
(
ewoksgraph
,
**
execute_options
)
if
results_of_all_nodes
:
nodes
=
list
(
ewoksgraph
.
graph
.
nodes
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment