diff --git a/build.sh b/build.sh
index c4fe469..380bd98 100755
--- a/build.sh
+++ b/build.sh
@@ -428,6 +428,130 @@ mpi_osu()
         return 0
 }
 
+mvapich2()
+{
+    local iwarp=0
+
+    if [ "$MVAPICH2_IMPL" = "iwarp" ]; then
+        iwarp=1
+    fi
+
+    echo
+
+    if [ $iwarp -eq 0 ]; then
+        echo "Building the MVAPICH2 RPM with IB support. Please wait..."
+    else
+        echo "Building the MVAPICH2 RPM with iWARP support. Please wait..."
+    fi
+
+    echo
+
+    for mpi_comp in ${MPI_COMPILER_mvapich2}
+    do
+        MVAPICH2_RPM=${MVAPICH2_NAME}_${mpi_comp}-${MVAPICH2_VER}-${MVAPICH2_REL}.${build_arch}.rpm
+        MVAPICH2_PREFIX="${STACK_PREFIX}/mpi/${mpi_comp}/${MVAPICH2_NAME}-${MVAPICH2_VERSION}"
+
+        case ${mpi_comp} in
+            gcc)
+                MVAPICH2_COMP_ENV="CC=gcc CXX=g++"
+
+                if [ $is_gfortran -eq 1 ]; then
+                    MVAPICH2_COMP_ENV="$MVAPICH2_COMP_ENV F77=gfortran"
+                elif [ $is_gcc_g77 -eq 1 ]; then
+                    MVAPICH2_COMP_ENV="$MVAPICH2_COMP_ENV F77=g77"
+                fi
+            ;;
+            pathscale)
+                MVAPICH2_COMP_ENV="CC=pathcc CXX=pathCC F77=pathf90 F90=pathf90"
+
+                # On i686 the PathScale compiler requires -g optimization
+                # for MVAPICH2 in the shared library configuration.
+                if [ "$ARCH" = "i686" ]; then
+                    MVAPICH2_COMP_ENV="$MVAPICH2_COMP_ENV OPT_FLAG=-g"
+                fi
+            ;;
+            pgi)
+                MVAPICH2_COMP_ENV="CC=pgcc CXX=pgCC F77=pgf77 F90=pgf90"
+            ;;
+            intel)
+                # The -i-dynamic flag is required for MVAPICH2 in the shared
+                # library configuration.
+                MVAPICH2_COMP_ENV='CC="icc -i-dynamic" CXX="icpc -i-dynamic" F77="ifort -i-dynamic" F90="ifort -i-dynamic"'
+            ;;
+        esac
+
+        ex rpmbuild --rebuild \
+           --define \'_topdir ${RPM_DIR}\' \
+           --define \'_name ${MVAPICH2_NAME}_${mpi_comp}\' \
+           --define \'_prefix ${MVAPICH2_PREFIX}\' \
+           --define \'build_root ${BUILD_ROOT}\' \
+           --define \'open_ib_home ${STACK_PREFIX}\' \
+           --define \'ofed_build_root ${BUILD_ROOT}\' \
+           --define \'comp_env ${MVAPICH2_COMP_ENV}\' \
+           --define \'iwarp ${iwarp}\' \
+           --define \'romio 1\' \
+           --define \'shared_libs 1\' \
+           --define \'auto_req 1\' \
+           $MVAPICH2_SRC_RPM
+        ex "$MV -f ${RPM_DIR}/RPMS/$build_arch/${MVAPICH2_RPM} $RPMS"
+        let BUILD_COUNTER++
+
+        if [ "$mpitests" == "y" ]; then
+            echo
+            echo "Building the mpitests RPM over MVAPICH2 using the ${mpi_comp} compiler. Please wait..."
+            echo
+            MPITESTS_RPM=${MPITESTS_NAME}_${MVAPICH2_NAME}_${mpi_comp}-${MPITESTS_VERSION}.${build_arch}.rpm
+
+            # rowland: The MVAPICH2 SRPM was built above by specifying
+            # ofed_build_root (set to the same as its build_root), thus
+            # enabling its ofed_bootstrap mode internally.  This means that
+            # it was installed in the same temporary location as the OFED
+            # libraries in the proper place and built in such a way as to
+            # be able to use the OFED libraries in that location. It was
+            # also left in place after the RPM was created so that the
+            # mpitests package could be built.   However, files like mpicc
+            # were cleaned up so that they will point to the final location
+            # of the OFED libraries, which causes a problem when building
+            # the mpitests package below.  Therefore, I am exporting
+            # LD_LIBRARY_PATH very carefully to make this work.  I restore
+            # the original state after the mpitests build.  This works, and
+            # seems necessary due to the way the OFED libraries are in a
+            # temporary "bootstrap" directory.
+            MVAPICH2_OLD_LD_PATH="$LD_LIBRARY_PATH"
+
+            if [ -d ${BUILD_ROOT}/${STACK_PREFIX}/lib ]; then
+                export LD_LIBRARY_PATH="${BUILD_ROOT}${STACK_PREFIX}/lib:$LD_LIBRARY_PATH"
+            fi
+
+            if [ -d ${BUILD_ROOT}${STACK_PREFIX}/lib64 ]; then
+                export LD_LIBRARY_PATH="${BUILD_ROOT}${STACK_PREFIX}/lib64:$LD_LIBRARY_PATH"
+            fi
+
+            ex rpmbuild --rebuild \
+               --define \'_topdir ${RPM_DIR}\' \
+               --define \'_name ${MPITESTS_NAME}_${MVAPICH2_NAME}_${mpi_comp}\' \
+               --define \'path_to_mpihome ${MVAPICH2_PREFIX}\' \
+               --define \'buildroot ${BUILD_ROOT}\' \
+               --define \'stack_prefix ${STACK_PREFIX}\' \
+               $MPITESTS_SRC_RPM
+
+            if [ -z "$MVAPICH2_OLD_LD_PATH" ]; then
+                # LD_LIBRARY_PATH wasn't really set the first time, so I don't
+                # want to actually export it to nothing, though it shouldn't
+                # matter in the end I think.  I want the exported environment
+                # to be _exactly_ the same as the original.
+                unset LD_LIBRARY_PATH
+            else
+                export LD_LIBRARY_PATH="${MVAPICH2_OLD_LD_PATH}"
+            fi
+
+            ex "$MV -f ${RPM_DIR}/RPMS/$build_arch/${MPITESTS_RPM} $RPMS"
+            let BUILD_COUNTER++
+        fi
+    done
+    return 0
+}
+
 openmpi()
 {
     local rpm_cnt=0
diff --git a/build_env.sh b/build_env.sh
index 11df470..881c39e 100644
--- a/build_env.sh
+++ b/build_env.sh
@@ -188,10 +188,10 @@ DIAGS_PACKAGES="$MANAGEMENT_LIBS openib-
 ###
 
 BASIC_PACKAGES="${IB_BASIC_PACKAGES} ${MISC_PACKAGES}"
-HPC_PACKAGES="${BASIC_PACKAGES} ${MANAGEMENT_LIBS} openib-diags mpi_osu openmpi mpitests ibutils"
+HPC_PACKAGES="${BASIC_PACKAGES} ${MANAGEMENT_LIBS} openib-diags mpi_osu mvapich2 openmpi mpitests ibutils"
 HPC_PACKAGES="${HPC_PACKAGES} librdmacm librdmacm-devel librdmacm-utils dapl dapl-devel"
 # The list of ALL_PACKAGES should preserve the order of dependencies
-ALL_PACKAGES="${IB_ALL_PACKAGES} mpi_osu openmpi mpitests ibutils" # pdsh
+ALL_PACKAGES="${IB_ALL_PACKAGES} mpi_osu mvapich2 openmpi mpitests ibutils" # pdsh
 
 PREV_RELEASE_PACKAGES="opensm-devel opensm-libs ibtsal openib mpi_ncsa thca ib-osm osm ibadm ib-diags"
 PREV_RELEASE_PACKAGES="$PREV_RELEASE_PACKAGES diags ibgdiag ibdiag ib-management"
@@ -263,6 +263,14 @@ if [[ -n "${SCRIPTS_SRC_RPM}" && -s ${SC
     SCRIPTS_VERSION=${SCRIPTS_VER}-${SCRIPTS_REL}
 fi
 
+MVAPICH2_SRC_RPM=$(/bin/ls -1 ${SRPMS}/mvapich2*src.rpm 2> $NULL)
+if [[ -n "${MVAPICH2_SRC_RPM}" && -s ${MVAPICH2_SRC_RPM} ]]; then
+    MVAPICH2_NAME=$(rpm --queryformat "[%{NAME}]" -qp $MVAPICH2_SRC_RPM)
+    MVAPICH2_VER=$(rpm --queryformat "[%{VERSION}]" -qp $MVAPICH2_SRC_RPM)
+    MVAPICH2_REL=$(rpm --queryformat "[%{RELEASE}]" -qp $MVAPICH2_SRC_RPM)
+    MVAPICH2_VERSION=${MVAPICH2_VER}-${MVAPICH2_REL}
+fi
+
 OPENMPI_SRC_RPM=$(/bin/ls -1 ${SRPMS}/openmpi*src.rpm 2> $NULL)
 if [[ -n "${OPENMPI_SRC_RPM}" && -s ${OPENMPI_SRC_RPM} ]]; then
     OPENMPI_NAME=$(rpm --queryformat "[%{NAME}]" -qp $OPENMPI_SRC_RPM)
@@ -749,6 +757,18 @@ showInstalled()
                         done
                     fi
                 ;;
+                mvapich2)
+                    mpi_packs=$($RPM -qa | grep ${MVAPICH2_NAME})
+                    if [ -n "${mpi_packs}" ]; then
+                        for mpi_pack in ${mpi_packs}
+                        do
+                            if ( $RPM -q $mpi_pack > $NULL 2>&1 ); then
+                                print_package_info $mpi_pack
+                                let RC++
+                            fi
+                        done
+                    fi
+                ;;
                 openmpi)
                     mpi_packs=$($RPM -qa | grep ${OPENMPI_NAME})
                     if [ -n "${mpi_packs}" ]; then
@@ -795,7 +815,7 @@ is_compiler()
             if ! ( $WHICH gcc > $NULL 2>&1 ); then
                 return 1
             fi
-            if [ "${mpipackage}" == "mpi_osu" ]; then
+            if [ "${mpipackage}" == "mpi_osu" ] || [ "${mpipackage}" == "mvapich2" ]; then
                 if ( $WHICH gfortran > $NULL 2>&1 ); then
                     is_gfortran=1
                     return 0
@@ -824,7 +844,7 @@ is_compiler()
             if ! ( $WHICH pathcc > $NULL 2>&1 ); then
                 return 1
             fi
-            if [ "${mpipackage}" == "mpi_osu" ]; then
+            if [ "${mpipackage}" == "mpi_osu" ] || [ "${mpipackage}" == "mvapich2" ]; then
                 if ( $WHICH pathCC > $NULL 2>&1 && $WHICH pathf90 > $NULL 2>&1 ); then
                     is_pathCC=1
                     is_pathf90=1
@@ -849,7 +869,7 @@ is_compiler()
             if ! ( $WHICH pgcc > $NULL 2>&1 ); then
                 return 1
             fi
-            if [ "${mpipackage}" == "mpi_osu" ]; then
+            if [ "${mpipackage}" == "mpi_osu" ]|| [ "${mpipackage}" == "mvapich2" ]; then
                 if ( $WHICH pgf77 > $NULL 2>&1 && $WHICH pgf90 > $NULL 2>&1 ); then
                     is_pgf77=1
                     is_pgf90=1
@@ -876,7 +896,7 @@ is_compiler()
             if ! ( $WHICH icc > $NULL 2>&1 ); then
                 return 1
             fi
-            if [ "${mpipackage}" == "mpi_osu" ]; then
+            if [ "${mpipackage}" == "mpi_osu" ] || [ "${mpipackage}" == "mvapich2" ]; then
                 if ( $WHICH icpc > $NULL 2>&1 && $WHICH ifort > $NULL 2>&1 ); then
                     is_icpc=1
                     is_ifort=1
@@ -945,6 +965,21 @@ set_mpi_env()
                 read -p "Do you wish to create/install an ${mpipackage} RPM with ${mpi_compiler}? [Y/n]:" ans
                 if [[ "$ans" == "" || "$ans" == "y" || "$ans" == "Y" || "$ans" == "yes" ]]; then
                     MPI_COMPILER="$MPI_COMPILER ${mpi_compiler}"
+
+                    # MVAPICH2 can be built with iWARP support only if
+                    # librdmacm and librdmacm-devel are there.
+                    if [ "$mpipackage" = "mvapich2" ] &&
+                       (echo -n ${SELECTED_PACKAGES} | grep -w "librdmacm" > $NULL) &&
+                       (echo -n ${SELECTED_PACKAGES} | grep -w "librdmacm-devel" > $NULL); then
+                        read -p "Do you wish to build mvapich2 with iWARP support only (default is IB) [y/N]:" ans
+                        if [[ "$ans" == "y" || "$ans" == "Y" || "$ans" == "yes" ]]; then
+                            MVAPICH2_IMPL=iwarp
+                        else
+                            MVAPICH2_IMPL=ib
+                        fi
+                    else
+                        MVAPICH2_IMPL=ib
+                    fi
                 fi
             done
 
@@ -955,6 +990,11 @@ set_mpi_env()
                         MPI_COMPILER=${MPI_COMPILER_mpi_osu}
                     fi
                 ;;
+                mvapich2)
+                    if [ ! -z "${MPI_COMPILER_mvapich2}" ]; then
+                        MPI_COMPILER=${MPI_COMPILER_mvapich2}
+                    fi
+                ;;
                 openmpi)
                     if [ ! -z "${MPI_COMPILER_openmpi}" ]; then
                         MPI_COMPILER=${MPI_COMPILER_openmpi}
@@ -1001,6 +1041,24 @@ set_mpi_env()
                 echo
                 echo "The following compiler(s) will be used to ${prog%*.*} the ${mpipackage} RPM(s): $MPI_COMPILER_mpi_osu"
             ;;
+            mvapich2)
+                if [ ! -n "${MPI_COMPILER}" ]; then
+                    warn_echo "No compilers for ${mpipackage} were found"
+                    return 1
+                fi
+
+                MPI_COMPILER_mvapich2=${MPI_COMPILER}
+                if ! ( grep -w MPI_COMPILER_mvapich2 $CONFIG > $NULL 2>&1 ); then
+                    echo "MPI_COMPILER_mvapich2=\"${MPI_COMPILER_mvapich2}\"" >> $CONFIG
+                fi
+
+                if ! ( grep -w MVAPICH2_IMPL $CONFIG > $NULL 2>&1 ); then
+                    echo "MVAPICH2_IMPL=\"${MVAPICH2_IMPL}\"" >> $CONFIG
+                fi
+
+                echo
+                echo "The following compiler(s) will be used to ${prog%*.*} the ${mpipackage} RPM(s): $MPI_COMPILER_mvapich2"
+            ;;
             openmpi)
                 if [ ! -n "${COMPILERS_FOUND}" ]; then
                     warn_echo "No compilers for ${mpipackage} were found"
@@ -1236,6 +1294,7 @@ mstflint_RUN_REQ=""
 librdmacm_RUN_REQ=""
 oiscsi_iser_RUN_REQ="open-iscsi"
 mpi_osu_RUN_REQ=""
+mvapich2_RUN_REQ=""
 openmpi_RUN_REQ=""
 mpitests_RUN_REQ=""
 ofed_docs_RUN_REQ=""
@@ -1273,6 +1332,7 @@ mstflint_BUILD_REQ=""
 librdmacm_BUILD_REQ=""
 oiscsi_iser_BUILD_REQ="db-devel open-iscsi"
 mpi_osu_BUILD_REQ=""    
+mvapich2_BUILD_REQ=""
 openmpi_BUILD_REQ=""    
 mpitests_BUILD_REQ=""
 ofed_docs_BUILD_REQ=""
@@ -1361,7 +1421,7 @@ check_build_req()
                         build_32bit=1
                     fi
                 ;;
-                openmpi|mpi_osu|ibutils)
+                openmpi|mpi_osu|mvapich2|ibutils)
                     if ! ( grep libstdc++.so ${rpms_cache} | grep 64bit > $NULL 2>&1 ); then
                         err_echo "libstdc++ 64-bit version is required to build $1 packages"
                         let RC++
@@ -1677,6 +1737,21 @@ set_package_deps()
                                 OPENIB_PACKAGES=$(echo "$OPENIB_PACKAGES libibverbs libibverbs-devel" | tr -s ' ' '\n' | sort -n | uniq)
                             fi   
                     ;;
+		    mvapich2)
+                            # Set compilation environment for MVAPICH2
+                            if ! set_mpi_env mvapich2; then
+                                warn_echo "MVAPICH2 cannot be installed"
+                                sed -i -e 's/mvapich2=y/mvapich2=n/g' $CONFIG
+                                export mvapich2=n
+                            else
+                                EXTRA_PACKAGES=$(echo "$EXTRA_PACKAGES mvapich2" | tr -s ' ' '\n' | sort -rn | uniq)
+                                if [ "$MVAPICH2_IMPL" = "iwarp" ]; then
+                                    OPENIB_PACKAGES=$(echo "$OPENIB_PACKAGES libibverbs libibverbs-devel libibumad libibumad-devel librdmacm librdmacm-devel" | tr -s ' ' '\n' | sort -n | uniq)
+                                else
+                                    OPENIB_PACKAGES=$(echo "$OPENIB_PACKAGES libibverbs libibverbs-devel libibumad libibumad-devel" | tr -s ' ' '\n' | sort -n | uniq)
+                                fi
+                            fi
+                    ;;
                     openmpi)
                             # Set compilation environment for Open MPI
                             if ! set_mpi_env openmpi; then
@@ -1690,7 +1765,7 @@ set_package_deps()
 
                     ;;
                     mpitests)
-                        if (echo -n ${SELECTED_PACKAGES} | grep -Ew "mpi_osu|openmpi" > $NULL 2>&1); then
+                        if (echo -n ${SELECTED_PACKAGES} | grep -Ew "mpi_osu|mvapich2|openmpi" > $NULL 2>&1); then
                             EXTRA_PACKAGES=$(echo "$EXTRA_PACKAGES mpitests" | tr -s ' ' '\n' | sort -rn | uniq)
                         fi
                     ;;
diff --git a/install.sh b/install.sh
index a7e26af..224f584 100755
--- a/install.sh
+++ b/install.sh
@@ -150,6 +150,17 @@ rmInstalled()
         done    
     fi
 
+    MVAPICH2_LIST=$(rpm -qa | grep ${MVAPICH2_NAME})
+
+    if [ -n "$MVAPICH2_LIST" ]; then
+        for mpi_name in $MVAPICH2_LIST
+        do
+            if ( $RPM -q ${mpi_name} > $NULL 2>&1 ); then
+                ex "$RPM -e ${mpi_name}"
+            fi
+        done
+    fi
+
     OPENMPI_LIST=$(rpm -qa | grep ${OPENMPI_NAME})
 
     if [ -n "$OPENMPI_LIST" ]; then
@@ -278,6 +289,12 @@ is_rpms()
                    [ ! -f ${RPMS}/${MPI_OSU_MPICH_NAME}_${mpi_comp}-${MPI_OSU_MPICH_VER}-${MPI_OSU_MPICH_REL}.${build_arch}.rpm ] && return 1
                done    
             ;;
+            mvapich2)
+               for mpi_comp in ${MPI_COMPILER_mvapich2}
+               do
+                   [ ! -f ${RPMS}/${MVAPICH2_NAME}_${mpi_comp}-${MVAPICH2_VER}-${MVAPICH2_REL}.${build_arch}.rpm ] && return 1
+               done
+            ;;
             openmpi)
                for mpi_comp in ${MPI_COMPILER_openmpi}
                do
@@ -1007,6 +1024,43 @@ mpi_osu()
     return 0
 }
 
+# MVAPICH2 RPM installation (the MPI_COMPILER_mvapich2 variable should contain the list of compilers)
+mvapich2()
+{
+    local rpm_cnt=0
+
+    if ! check_run_req mvapich2 err; then
+        return 2
+    fi
+
+    for mpi_comp in ${MPI_COMPILER_mvapich2}
+    do
+        MVAPICH2_RPM=${MVAPICH2_NAME}_${mpi_comp}-${MVAPICH2_VER}-${MVAPICH2_REL}.${build_arch}.rpm
+
+        if [ -f ${RPMS}/${MVAPICH2_RPM} ]; then
+            ex "$RPM -Uhv ${RPMS}/${MVAPICH2_RPM}"
+            let rpm_cnt++
+        else
+            echo "${RPMS}/${MVAPICH2_RPM} not found"
+        fi
+
+        if [ "$mpitests" == "y" ]; then
+            MPITESTS_RPM=${MPITESTS_NAME}_${MVAPICH2_NAME}_${mpi_comp}-${MPITESTS_VERSION}.${build_arch}.rpm
+            if [ -f ${RPMS}/${MPITESTS_RPM} ]; then
+                ex "$RPM -Uhv ${RPMS}/${MPITESTS_RPM}"
+                let rpm_cnt++
+            fi
+        fi
+    done
+
+    if [ $rpm_cnt -eq 0 ]; then
+        err_echo "MVAPICH2 RPMs are not installed"
+        return 1
+    fi    
+
+    return 0
+}
+
 # Open MPI RPM installation (the MPI_COMPILER_openmpi variable should contain the list of compilers)
 openmpi()
 {
@@ -1116,6 +1170,18 @@ uninstall()
                             let no_count++
                         fi        
                     done
+                elif [ "X${package}" == "Xmvapich2" ]; then
+                    MVAPICH2_LIST=$(rpm -qa |grep ${MVAPICH2_NAME})
+                    for mpi in ${MVAPICH2_LIST}
+                    do
+                        echo -n "Remove ${mpi} [y/N]?"
+                        if get_ans; then
+                            packs_to_remove="$packs_to_remove ${mpi}"
+                            let RC++
+                        else
+                            let no_count++
+                        fi
+                    done
                 elif [ "X${package}" == "Xopenmpi" ]; then
                     OPENMPI_LIST=$(rpm -qa | grep ${OPENMPI_NAME})
                     for mpi in $OPENMPI_LIST
@@ -1159,6 +1225,13 @@ uninstall()
                                  packs_to_remove="$packs_to_remove ${mpi}"
                                  let RC++
                             done
+                        elif [ "X${package}" == "Xmvapich2" ]; then
+                            MVAPICH2_LIST=$(rpm -qa |grep ${MVAPICH2_NAME})
+                            for mpi in ${MVAPICH2_LIST}
+                            do
+                                packs_to_remove="$packs_to_remove ${mpi}"
+                                let RC++
+                            done
                         elif [ "X${package}" == "Xopenmpi" ]; then
                             OPENMPI_LIST=$(rpm -qa | grep ${OPENMPI_NAME})
                             for mpi in $OPENMPI_LIST
diff --git a/ofed-scripts.spec b/ofed-scripts.spec
diff --git a/propel.sh b/propel.sh
diff --git a/uninstall.sh b/uninstall.sh
index 8ed48c3..12c3f33 100755
--- a/uninstall.sh
+++ b/uninstall.sh
@@ -54,12 +54,13 @@ IB_ALL_PACKAGES="$IB_ALL_PACKAGES libope
 IB_ALL_PACKAGES="$IB_ALL_PACKAGES librdmacm librdmacm-devel librdmacm-utils dapl dapl-devel"
 IB_ALL_PACKAGES="$IB_ALL_PACKAGES openib-diags"
 
-ALL_PACKAGES="${IB_ALL_PACKAGES} mpi_osu openmpi mpitests ibutils" #pdsh
+ALL_PACKAGES="${IB_ALL_PACKAGES} mpi_osu mvapich2 openmpi mpitests ibutils" #pdsh
 
 PREV_RELEASE_PACKAGES="ibtsal openib opensm opensm-devel mpi_ncsa thca ib-osm osm diags ibadm ib-diags ibgdiag ibdiag ib-management"
 PREV_RELEASE_PACKAGES="$PREV_RELEASE_PACKAGES ib-verbs ib-ipoib ib-cm ib-sdp ib-dapl udapl udapl-devel libdat libibat ib-kdapl ib-srp ib-srp_target oiscsi-iser-support ofed-docs ofed-scripts"
 
 OPENMPI_NAME="openmpi"
+MVAPICH2_NAME="mvapich2"
 MPI_OSU_NAME="mpi_osu"
 MPI_OSU_MPICH_NAME="mpich_mlx"
 PDSH_NAME="pdsh"
@@ -121,6 +122,17 @@ uninstall()
         done    
     fi
 
+    MVAPICH2_LIST=$(rpm -qa |grep ${MVAPICH2_NAME})
+
+    if [ -n "$MVAPICH2_LIST" ]; then
+        for mpi_name in $MVAPICH2_LIST
+        do
+            if ( $RPM -q ${mpi_name} > $NULL 2>&1 ); then
+                ex "$RPM -e ${mpi_name}"
+            fi
+        done
+    fi
+
     OPENMPI_LIST=$(rpm -qa | grep ${OPENMPI_NAME})
 
     if [ -n "$OPENMPI_LIST" ]; then
