Re #9351. Move computation of what output filename will be.

Putting it before the algorithm call gives us a better chance of getting
it right if the algorithm runs over midnight.
Merge branch 'feature/9351_up_required_memory_for_multirep_test' into develop