aiaccel.job.utils.split_tasks

aiaccel.job.utils.split_tasks(task_list: list[Any]) list[Any][source]

Return the task shard assigned to the current array job.

This function uses TASK_INDEX and TASK_STEPSIZE from the environment to slice task_list. The start position is computed as TASK_INDEX - 1. If TASK_INDEX is not defined, the input is returned as is.

Parameters:

task_list (list[Any]) – Full list of tasks to be split across array jobs.

Returns:

Tasks assigned to the current array job.

Return type:

list[Any]