Sorry, I haven't looked at the details, but is the "MPI-MVAPICH2" case really inside the elif for toolchain.OPENMPI?
It's counter-intuitive...