fix hierarchical mns w.r.t. MPI installed with a dummy toolchain

enhanced version of #983 by @kcgthb (which should have been opened targeting `develop`
not really, you should use the same function to determine the compiler name if there is any relation between the `intel` here and the `intel` returned by `det_toolchain_compilers_name_version` (actually if the whole logic is the same).

if there is no relation, move this bit of logic to a new function so it can be redefined more easily.