Commit 040d6b72 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[helpers] Create remotely synced output if socket is given

parent b5fc0451
...@@ -58,6 +58,7 @@ from .inputs import InputGroup ...@@ -58,6 +58,7 @@ from .inputs import InputGroup
from .outputs import SynchronizationListener from .outputs import SynchronizationListener
from .outputs import OutputList from .outputs import OutputList
from .outputs import Output from .outputs import Output
from .outputs import RemotelySyncedOutput
from .algorithm import Algorithm from .algorithm import Algorithm
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -379,7 +380,13 @@ def create_inputs_from_configuration( ...@@ -379,7 +380,13 @@ def create_inputs_from_configuration(
def create_outputs_from_configuration( def create_outputs_from_configuration(
config, algorithm, prefix, cache_root, input_list=None, data_loaders=None config,
algorithm,
prefix,
cache_root,
input_list=None,
data_loaders=None,
loop_socket=None,
): ):
data_sinks = [] data_sinks = []
...@@ -474,14 +481,25 @@ def create_outputs_from_configuration( ...@@ -474,14 +481,25 @@ def create_outputs_from_configuration(
if not status: if not status:
raise IOError("Cannot create cache sink '%s'" % details["path"]) raise IOError("Cannot create cache sink '%s'" % details["path"])
output_list.add( if loop_socket is not None:
Output( output_list.add(
name, RemotelySyncedOutput(
data_sink, name,
synchronization_listener=synchronization_listener, data_sink,
force_start_index=start_index, loop_socket,
synchronization_listener=synchronization_listener,
force_start_index=start_index,
)
)
else:
output_list.add(
Output(
name,
data_sink,
synchronization_listener=synchronization_listener,
force_start_index=start_index,
)
) )
)
if "result" not in config: if "result" not in config:
logger.debug( logger.debug(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment