not creating unnecesarry threads in the last iteration, fix for non padde first step
not creating unnecesarry threads in the last iteration, fix for non padde first step

stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math