Compute

class gladier.tools.Compute(*args, state_type: str = 'Action', state_name: str | None = None, comment: str | None = None, result_path: str | None = None, parameters: Dict[str, Any] | None = None, input_path: str | None = None, set_parameters_from_properties: bool = True, non_parameter_properties: Set[str] = {'_flow_definition', 'action_scope', 'action_url', 'comment', 'exception_handlers', 'exception_on_action_failure', 'input_path', 'next_state', 'non_parameter_properties', 'parameters', 'result_path', 'run_as', 'set_parameters_from_properties', 'state_name', 'state_type', 'wait_time'}, action_url: str = 'https://compute.actions.globus.org/fxap', action_scope: str | None = None, wait_time: int = 600, exception_on_action_failure: bool = False, run_as: str | None = None, function_to_call: Callable[[Any], Any] | str, endpoint_id: str = '$.input.compute_endpoint', function_parameters: Dict[str, Any] | str | None = None, **kwargs)

Bases: ActionState

The Globus Compute State allows for executing registered functions on a POSIX based system. It requires a registered python function and a valid Globus Compute endpoint to run on.

Example:

def random_int(high_val: int) -> int:
    from random import randint

    return randint(0, high_val)


random_step = GlobusCompute(
    function_to_call=random_int, function_parameters={"high_val": 3}
)