I want to execute N subprocesses as batches with batch size M. I have used this code in a previous SO thread as a starting point:
Python