Skip to content

radical.asyncflow.backends.execution.noop

NoopExecutionBackend

NoopExecutionBackend()

Bases: BaseExecutionBackend

A no-operation execution backend for testing and development purposes.

This backend simulates task execution without actually running any tasks. All submitted tasks immediately return dummy output and transition to DONE state. Useful for testing workflow logic without computational overhead.

Initialize the no-op execution backend.

Sets up dummy task storage, session, and default callback function. Registers backend states and confirms successful initialization.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
16
17
18
19
20
21
22
23
24
25
26
def __init__(self):
    """Initialize the no-op execution backend.

    Sets up dummy task storage, session, and default callback function.
    Registers backend states and confirms successful initialization.
    """
    self.tasks = {}
    self.session = Session()
    self._callback_func: Callable = lambda task, state: None  # default no-op
    StateMapper.register_backend_states_with_defaults(backend=self)
    print('Noop execution backend started successfully')

state

state()

Get the current state of the no-op execution backend.

Returns:

Name Type Description
str

Always returns 'IDLE' as this backend performs no actual work.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
28
29
30
31
32
33
34
def state(self):
    """Get the current state of the no-op execution backend.

    Returns:
        str: Always returns 'IDLE' as this backend performs no actual work.
    """
    return 'IDLE'

task_state_cb

task_state_cb(task: dict, state: str) -> None

Callback function invoked when a task's state changes.

Parameters:

Name Type Description Default
task dict

Dictionary containing task information and metadata.

required
state str

The new state of the task.

required
Note

This is a no-op implementation that performs no actions.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
36
37
38
39
40
41
42
43
44
45
46
def task_state_cb(self, task: dict, state: str) -> None:
    """Callback function invoked when a task's state changes.

    Args:
        task: Dictionary containing task information and metadata.
        state: The new state of the task.

    Note:
        This is a no-op implementation that performs no actions.
    """
    pass

get_task_states_map

get_task_states_map()

Retrieve a mapping of task IDs to their current states.

Returns:

Name Type Description
StateMapper

Object containing the mapping of task states for this backend.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
48
49
50
51
52
53
54
def get_task_states_map(self):
    """Retrieve a mapping of task IDs to their current states.

    Returns:
        StateMapper: Object containing the mapping of task states for this backend.
    """
    return StateMapper(backend=self)

register_callback

register_callback(func: Callable)

Register a callback for task state changes.

Parameters:

Name Type Description Default
func Callable

Function to be called when task states change. Should accept task and state parameters.

required
Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
56
57
58
59
60
61
62
63
def register_callback(self, func: Callable):
    """Register a callback for task state changes.

    Args:
        func: Function to be called when task states change. Should accept
            task and state parameters.
    """
    self._callback_func = func

build_task

build_task(uid, task_desc, task_specific_kwargs)

Build or prepare a task for execution.

Parameters:

Name Type Description Default
uid

Unique identifier for the task.

required
task_desc

Dictionary containing task description and metadata.

required
task_specific_kwargs

Backend-specific keyword arguments for the task.

required
Note

This is a no-op implementation that performs no actual task building.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
65
66
67
68
69
70
71
72
73
74
75
76
def build_task(self, uid, task_desc, task_specific_kwargs):
    """Build or prepare a task for execution.

    Args:
        uid: Unique identifier for the task.
        task_desc: Dictionary containing task description and metadata.
        task_specific_kwargs: Backend-specific keyword arguments for the task.

    Note:
        This is a no-op implementation that performs no actual task building.
    """
    pass

submit_tasks async

submit_tasks(tasks)

Submit tasks for mock execution.

Immediately marks all tasks as completed with dummy output without performing any actual computation.

Parameters:

Name Type Description Default
tasks

List of task dictionaries to be processed. Each task will receive dummy stdout and return_value before being marked as DONE.

required
Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
81
82
83
84
85
86
87
88
89
90
91
92
93
94
async def submit_tasks(self, tasks):
    """Submit tasks for mock execution.

    Immediately marks all tasks as completed with dummy output without
    performing any actual computation.

    Args:
        tasks: List of task dictionaries to be processed. Each task will
            receive dummy stdout and return_value before being marked as DONE.
    """
    for task in tasks:
        task['stdout'] = 'Dummy Output'
        task['return_value'] = 'Dummy Output'
        self._callback_func(task, 'DONE')
link_explicit_data_deps(src_task=None, dst_task=None, file_name=None, file_path=None)

Handle explicit data dependencies between tasks.

Parameters:

Name Type Description Default
src_task

The source task that produces the dependency. Defaults to None.

None
dst_task

The destination task that depends on the source. Defaults to None.

None
file_name

Name of the file that represents the dependency. Defaults to None.

None
file_path

Full path to the file that represents the dependency. Defaults to None.

None
Note

This is a no-op implementation as this backend doesn't handle dependencies.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
def link_explicit_data_deps(self, src_task=None, dst_task=None, file_name=None, file_path=None):
    """Handle explicit data dependencies between tasks.

    Args:
        src_task: The source task that produces the dependency. Defaults to None.
        dst_task: The destination task that depends on the source. Defaults to None.
        file_name: Name of the file that represents the dependency. Defaults to None.
        file_path: Full path to the file that represents the dependency. Defaults to None.

    Note:
        This is a no-op implementation as this backend doesn't handle dependencies.
    """
    pass
link_implicit_data_deps(src_task, dst_task)

Handle implicit data dependencies for a task.

Parameters:

Name Type Description Default
src_task

The source task that produces data.

required
dst_task

The destination task that depends on the source task's output.

required
Note

This is a no-op implementation as this backend doesn't handle dependencies.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
110
111
112
113
114
115
116
117
118
119
120
def link_implicit_data_deps(self, src_task, dst_task):
    """Handle implicit data dependencies for a task.

    Args:
        src_task: The source task that produces data.
        dst_task: The destination task that depends on the source task's output.

    Note:
        This is a no-op implementation as this backend doesn't handle dependencies.
    """
    pass

shutdown async

shutdown() -> None

Shutdown the no-op execution backend.

Performs cleanup operations. Since this is a no-op backend, no actual resources need to be cleaned up.

Source code in doc_env/lib/python3.13/site-packages/radical/asyncflow/backends/execution/noop.py
122
123
124
125
126
127
128
async def shutdown(self) -> None:
    """Shutdown the no-op execution backend.

    Performs cleanup operations. Since this is a no-op backend, no actual
    resources need to be cleaned up.
    """
    print('Dummy shutdown: Nothing to cleanup.')