From e073a650a4dcc09b120d9375263c2380705ba6f2 Mon Sep 17 00:00:00 2001 From: Adam Parler Date: Thu, 4 Jan 2024 01:16:14 -0800 Subject: [PATCH] Updated the MPI scripts, errors found --- scripts/stage1/install_mpich.sh | 2 +- scripts/stage1/install_openmpi.sh | 45 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/scripts/stage1/install_mpich.sh b/scripts/stage1/install_mpich.sh index bdc3812..c1354c3 100755 --- a/scripts/stage1/install_mpich.sh +++ b/scripts/stage1/install_mpich.sh @@ -163,7 +163,7 @@ proc ModulesHelp { } { puts stderr "\tModifies: MPI_ROOT, MANPATH, PATH, LD_LIBRARY_PATH, AVFS_MPI, AVFS_MPI_VERSION, IBV_FORK_SAFE" } -module-whatis "load MVAPICH2.0.1 environment" +module-whatis "load MPICH${mpich_ver} environment" module-whatis "Modifies: MPI_ROOT, MANPATH, PATH, LD_LIBRARY_PATH, AVFS_MPI, AVFS_MPI_VERSION, IBV_FORK_SAFE" diff --git a/scripts/stage1/install_openmpi.sh b/scripts/stage1/install_openmpi.sh index 460df87..722e4ba 100755 --- a/scripts/stage1/install_openmpi.sh +++ b/scripts/stage1/install_openmpi.sh @@ -168,6 +168,51 @@ prepend_path LD_LIBRARY_PATH "${pkg_install_dir}/lib" prepend_path LD_RUN_PATH "${pkg_install_dir}/lib" prepend_path LIBRARY_PATH "${pkg_install_dir}/lib" prepend_path CPATH "${pkg_install_dir}/include" +EOF + mkdir -p "${MODULEDIR}/mpi/openmpi" + cat << EOF > "${MODULEDIR}/mpi/openmpi/${openmpi_ver}" +#%Module1.0 +## +## OpenMPI ${openmpi_ver} modulefile +## +proc ModulesHelp { } { + global version + + puts stderr "\tThis loads the OpenMPI ${openmpi_ver} environment." + puts stderr "\tModifies: MPI_ROOT, MANPATH, PATH, LD_LIBRARY_PATH, AVFS_MPI, AVFS_MPI_VERSION, IBV_FORK_SAFE" +} + +module-whatis "load OPENMPI${openmpi_ver} environment" +module-whatis "Modifies: MPI_ROOT, MANPATH, PATH, LD_LIBRARY_PATH, AVFS_MPI, AVFS_MPI_VERSION, IBV_FORK_SAFE" + + +# for Tcl script use only +if { [info exists env(AVFS_COMPILER) ] } { + set compiler_type \$env(AVFS_COMPILER) +} else { + puts stderr "\tNo compiler loaded." + exit +} +if { [info exists env(AVFS_COMPILER_VERSION) ] } { + set compiler_version \$env(AVFS_COMPILER_VERSION) +} else { + puts stderr "\tError in \$compiler_type module: AVFS_COMPILER_VERSION not set, please notify administrator" + exit +} + +set mpi_root "${INSTALLDIR}/openmpi/${openmpi_ver}/\${compiler_type}/\${compiler_version}" +if { ! [file exists \$mpi_root ] } { + puts stderr "\t The combination of compiler and MPI does not appear to be built yet" + exit +} + +setenv MPI_ROOT "\$mpi_root" +setenv AVFS_MPI "openmpi" +setenv AVFS_MPI_VERSION "${openmpi_ver}" +setenv IBV_FORK_SAFE 1 +prepend-path PATH "\$mpi_root/bin" +prepend-path LD_LIBRARY_PATH "\$mpi_root/lib" +prepend-path MANPATH "\$mpi_root/share/man" EOF fi cat "${BUILDDIR}/setup_openmpi" >> ${SETUPFILE}