def new_main_func(cfg, output_dir, *args, **kwargs):
    pdb_ = (MultiprocessingPdb(FolderLock(output_dir)) if (comm.get_world_size() > 1) else None)
    return post_mortem_if_fail(pdb_)(main_func)(cfg, output_dir, *args, **kwargs)
def new_main_func(cfg, output_dir, *args, **kwargs):
    pdb_ = (MultiprocessingPdb(FolderLock(output_dir)) if (comm.get_world_size() > 1) else None)
    return post_mortem_if_fail(pdb_)(main_func)(cfg, output_dir, *args, **kwargs)