run function setup before changing into the optimizer dir to allow temporary output dirs