[mod3 (homebrewed)]$ module purge
[mod3 (homebrewed)]$ module load pgi/19.4
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) pgi/19.4   2) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (pgi/19.4, nompi)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module load openmpi/3.1
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) pgi/19.4      2) openmpi/3.1   3) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (pgi/19.4, openmpi/3.1)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module unload openmpi
[mod3 (homebrewed)]$ module switch pgi intel/2019
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) intel/2019   2) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (intel/2019, nompi)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module load intelmpi
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) intel/2019         2) intelmpi/default   3) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (intel/2019, intelmpi)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module switch intelmpi mvapich/2.3.1
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) intel/2019      2) mvapich/2.3.1   3) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (intel/2019, nompi)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module switch mvapich openmpi/4.0
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) intel/2019    2) openmpi/4.0   3) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (intel/2019, openmpi/4.0)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module unload openmpi
[mod3 (homebrewed)]$ module switch intel/2019 gcc/9.1.0
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) gcc/9.1.0   2) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (gcc/9.1.0, nompi)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module load mvapich/2.3.1
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) gcc/9.1.0       2) mvapich/2.3.1   3) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (gcc/9.1.0, nompi)
[mod3 (homebrewed)]$ module unload foo
[mod3 (homebrewed)]$ module switch mvapich openmpi/4.0
[mod3 (homebrewed)]$ module load foo/2.4
[mod3 (homebrewed)]$ module list
Currently Loaded Modulefiles:
  1) gcc/9.1.0     2) openmpi/4.0   3) foo/2.4
[mod3 (homebrewed)]$ foo
foo 2.4 (gcc/9.1.0, openmpi/4.0)
