run a given script on a pool of samples