5 # Automatically parallelize this job by running one task per file.
6 arvados.job_setup.one_task_per_input_file(if_sequence=0, and_end_task=True,
9 # Get the input file for the task
10 input_file = arvados.get_task_param_mount('input')
12 # Run the external 'md5sum' program on the input file
13 stdoutdata, stderrdata = arvados.util.run_command(['md5sum', input_file])
15 # Save the standard output (stdoutdata) to "md5sum.txt" in the output collection
16 out = arvados.CollectionWriter()
17 with out.open('md5sum.txt') as out_file:
18 out_file.write(stdoutdata)
19 arvados.current_task().set_output(out.finish())