How do I run a gear on multiple sessions or acquisitions at the same time in Flywheel?
Executing a gear on multiple datasets at once is done by using the "Batch Run Gear" action. When viewing data on the Session Dashboard, you can select entire sessions, or specific acquisitions within a session, on which you want to run a Gear.
Under the Actions menu, select the Batch Run Gears option. A modal then asks you to select the gear type and then you can select from the gear you want from the list of those available on your site. You then are able to choose the version of the gear and set any configuration options available for that gear.
After pressing the Run Gear button, you are then notified how many jobs of that gear you are starting based on the datasets you selected. Selecting 'Confirm' pushes these jobs into your site's job queue and their progress will appear on the provenance tab.
How is the number of jobs queued determined?
It's important to note that it is acquisition containers that are evaluated for matches to Gear inputs. This, when Batch Run Gear is executed on a selection of sessions or acquisitions Flywheel will queue a job for each acquisition that has the correct type (and number) of expected inputs.
For example, for a Gear that has a single input and expects a NIfTI file (as indicated by the Gear author in the Gear's manifest) the Batch Resolver will look at each acquisition to find those which have a single NIfTI file - matching the file type of the input. Note that to avoid ambiguity there should only be a single NIfTI file in that acquisition - acquisitions with multiple matches for a given Gear input will not run.
Why does batch run not queue my job?
If there are no files of the expected type (as indicated by the Gear author in the Gear's manifest) found in the acquisition, Flywheel will not be able to queue a job for that acquisition. Conversely, if there are multiple files that match on a given input, Flywheel will not be able to launch a job. This is because the Batch Resolver cannot determine which file is to be used as input when multiple matches exist in the same container.