Bugfix template to handle case in which no parent has been set.
This bug crashed mpiexec if called within a slurm environment.