Adjusting pid creation. Create one output file per pid.