1
1

Checkpoint before name changes

This commit was SVN r9740.
Этот коммит содержится в:
Jeff Squyres 2006-04-27 03:19:07 +00:00
родитель 524b99c5e7
Коммит e39a171871
3 изменённых файлов: 72 добавлений и 67 удалений

15
contrib/dist/linux/buildswitcherrpm.sh поставляемый
Просмотреть файл

@ -3,6 +3,7 @@
# Copyright (c) 2006 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
#
#
@ -10,8 +11,8 @@
#
target="noarch"
specfile="lam-switcher-modulefile.spec"
sourcefile="lam-switcher-modulefile.tcl"
specfile="openmpi-switcher-modulefile.spec"
sourcefile="openmpi-switcher-modulefile.tcl"
rpmbuild_options=
#########################################################################
@ -53,7 +54,7 @@ fi
first="`basename $tarball | cut -d- -f2`"
version="`echo $first | sed -e 's/\.tar\.gz//'`"
unset first
echo "--> Found LAM version: $version"
echo "--> Found Open MPI version: $version"
#
# do we have the spec files?
@ -146,9 +147,9 @@ fi
#
specdest="$rpmtopdir/SPECS/$specfile"
sed -e 's/LAMVERSION/'$version'/g' $specfile > "$specdest"
sed -e 's/OPENMPIVERSION/'$version'/g' $specfile > "$specdest"
echo "--> Building the OSCAR LAM modulefile RPM"
echo "--> Building the OSCAR Open MPI modulefile RPM"
cmd="$rpm_cmd -ba --target=$target $rpmbuild_options $specdest"
echo "--> $cmd"
@ -162,7 +163,7 @@ if test $? != 0; then
echo "Aborting"
exit 1
fi
echo "--> Done building the OSCAR LAM modulefile RPM"
echo "--> Done building the OSCAR Open MPI modulefile RPM"
#
# Done
@ -171,7 +172,7 @@ echo "--> Done building the OSCAR LAM modulefile RPM"
cat <<EOF
------------------------------------------------------------------------------
==== FINISHED BUILDING LAM RPMs ====
==== FINISHED BUILDING Open MPI switcher RPMs ====
------------------------------------------------------------------------------
A copy of the tarball is located in: $rpmtopdir/SOURCES/
The completed rpms are located in: $rpmtopdir/RPMS/noarch/

Просмотреть файл

@ -2,6 +2,7 @@
# Copyright (c) 2006 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -14,10 +15,12 @@
#
#############################################################################
# This is an OSCAR-specific RPM specfile. It is only for installing a
# LAM-installation-agnostic modulefile that will automatically pick
# which of multiple LAM installations to use if a specific one is not
# asked for by the user.
# This is an OSCAR-specific RPM specfile. It exists for two reasons:
# 1. Installing an Open MPI-installation-agnostic modulefile that will
# automatically pick which of multiple Open MPI installations to use
# if a specific one is not asked for by the user.
# 2. Make the main Open MPI spec file cleaner (don't need any of this
# switcher gorp).
# Values specified here are what are used if the user does not pass in
# any defaults.
@ -25,7 +28,7 @@
%{!?oscar_prefix: %define oscar_prefix /opt/%{name}}
%define _prefix %{oscar_prefix}-%{version}
%define _pkgdatadir %{oscar_prefix}-%{version}/share/lam
%define _pkgdatadir %{oscar_prefix}-%{version}/share/openmpi
# Defining these to nothing overrides the stupid automatic RH9
# functionality of making "debuginfo" RPMs.
@ -40,38 +43,37 @@
#
#############################################################################
Summary: OSCAR-specific modulefile for run-time picking of a LAM/MPI installation to use
Name: lam-switcher-modulefile
Version: LAMVERSION
Summary: OSCAR-specific modulefile for run-time picking of an Open MPI installation to use
Name: openmpi-switcher-modulefile
Version: OPENMPIVERSION
Release: 1
Vendor: LAM/MPI Team
Vendor: Open MPI Team
License: BSD
Group: Development/Libraries
Source: lam-switcher-modulefile.tcl
URL: http://www.lam-mpi.org/
Source: openmpi-switcher-modulefile.tcl
URL: http://www.open-mpi.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: %__rm %__mkdir %__sed %__mv %__chmod %__chown
Requires: modules-oscar
Requires: env-switcher
%description
This RPM is used to install a LAM/MPI-installation-agnostic modulefile
that is used to automatically select which LAM/MPI installation to use
on a per-shell basis. That is, if there are multiple LAM
installations on a single node (due to limitations in both OSCAR 3.0
and LAM/MPI 7.0.x design), it will attempt to pick the "right" one and
load the appropriate modulefile for that installation.
This RPM is used to install a Open MPI-installation-agnostic
modulefile that is used to automatically select which Open MPI
installation to use on a per-shell basis. That is, if there are
multiple Open MPI installations on a single node (due to limitations
in the OSCAR design, aimed at difficulties in knowing exactly which
version of various support libraries to compile Open MPI against), it
will attempt to pick the "right" one and load the appropriate
modulefile for that installation.
Current possibilities include:
- plain vanilla LAM/MPI
- LAM/MPI with gm
- LAM/MPI with blcr
- LAM/MPI with blcr and gm
- plain vanilla Open MPI
- Open MPI with gm
- Open MPI with blcr
- Open MPI with blcr and gm
This RPM will be unnecessary when LAM/MPI 7.1 is released, and LAM's
support for external systems will not be hard-coded in libmpi and
liblam; they will be dynamically loaded at run-time via loadable
modules.
#############################################################################
#
@ -95,9 +97,9 @@ cd "$RPM_BUILD_DIR"
%__chmod -R a+rX,g-w,o-w %{name}-%{version}
cd %{name}-%{version}
%__cp "$RPM_SOURCE_DIR/lam-switcher-modulefile.tcl" \
"$RPM_BUILD_DIR/%{name}-%{version}/lam-%{version}"
%__chmod 644 "$RPM_BUILD_DIR/%{name}-%{version}/lam-%{version}"
%__cp "$RPM_SOURCE_DIR/openmpi-switcher-modulefile.tcl" \
"$RPM_BUILD_DIR/%{name}-%{version}/openmpi-%{version}"
%__chmod 644 "$RPM_BUILD_DIR/%{name}-%{version}/openmpi-%{version}"
#############################################################################
@ -112,9 +114,9 @@ rm -rf "$RPM_BUILD_ROOT"
pkgdatadir="$RPM_BUILD_ROOT/%{_pkgdatadir}"
%__mkdir -p "$pkgdatadir"
%__cp "$RPM_BUILD_DIR/%{name}-%{version}/lam-%{version}" \
"$pkgdatadir/lam-%{version}"
%__chmod 644 "$pkgdatadir/lam-%{version}"
%__cp "$RPM_BUILD_DIR/%{name}-%{version}/openmpi-%{version}" \
"$pkgdatadir/openmpi-%{version}"
%__chmod 644 "$pkgdatadir/openmpi-%{version}"
#############################################################################
@ -139,16 +141,16 @@ pkgdatadir="$RPM_BUILD_ROOT/%{_pkgdatadir}"
# themselves -- in which case, the environment for those packages will
# not yet have been setup.
# In an ungrade situation, there will already be a lam-%{version}
# In an ungrade situation, there will already be a openmpi-%{version}
# modulefile resigtered, so we have to unregister it first, and then
# do the registration.
if test "$1" \> 1; then
switcher mpi --rm-name lam-%{version} --force --silent
switcher mpi --rm-name openmpi-%{version} --force --silent
fi
. /etc/profile.d/00-modules.sh
switcher mpi --add-name lam-%{version} %{_pkgdatadir} --force --silent
switcher mpi --add-name openmpi-%{version} %{_pkgdatadir} --force --silent
#############################################################################
@ -163,17 +165,17 @@ switcher mpi --add-name lam-%{version} %{_pkgdatadir} --force --silent
# same shell that "rpm -ivh ..." the switcher/modules RPM's, in which
# case, the environment for those packages will not yet have been
# setup. This is important to do *before* we are uninstalled because
# of the case where "rpm -Uvh lam-module..." is used; the current RPM
# will be uninstalled and then the new one will be installed. If we
# are %postun here, then the new RPM will be installed, and then this
# will run, which will remove the [new] tag from switcher, which is
# obviously not what we want.
# of the case where "rpm -Uvh openmpi-module..." is used; the current
# RPM will be uninstalled and then the new one will be installed. If
# we are %postun here, then the new RPM will be installed, and then
# this will run, which will remove the [new] tag from switcher, which
# is obviously not what we want.
# Grrr... It seems that "rpm -ivh a.rpm b.rpm c.rpm" is smart enough
# to re-order the order of installation to ensure that dependencies
# are met. However, "rpm -e a b c" does *not* order the
# uninstallations to ensure that dependencies are still met. So if
# someone does "rpm -e switcher modules lam-module", it is quite
# someone does "rpm -e switcher modules openmpi-module", it is quite
# possible that rpm will uninstall switcher and/or modules *before*
# this RPM is uninstalled. As such, the following lines will fail,
# which will cause all kinds of Badness. Arrggh!! So we have to test
@ -193,7 +195,7 @@ if test "$1" == 0; then
# If this RPM was the system default switcher module, then
# both print a warning and remove the system default.
if test "$default" = "lam-%{version}"; then
if test "$default" = "openmpi-%{version}"; then
echo "WARNING: This RPM was the default MPI implementation!"
echo "WARNING: There is no NO DEFAULT MPI implementation!"
switcher mpi = none --system --force --silent
@ -201,7 +203,7 @@ if test "$1" == 0; then
# Remove this module's name from the switcher repository
switcher mpi --rm-name lam-%{version} --force --silent
switcher mpi --rm-name openmpi-%{version} --force --silent
fi
fi
@ -213,7 +215,7 @@ fi
#############################################################################
%files
%defattr(-,root,root)
%{_pkgdatadir}/lam-%{version}
%{_pkgdatadir}/openmpi-%{version}
#############################################################################

Просмотреть файл

@ -3,30 +3,32 @@
# Copyright (c) 2006 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
# This modulefile is a dispatcher for other LAM modulefiles. It looks
# around the environment of the machine and determines which LAM
# modulefile to load (i.e., which LAM installation to use).
# This modulefile is a dispatcher for other Open MPI modulefiles. It
# looks around the environment of the machine and determines which
# Open MPI modulefile to load (i.e., which Open MPI installation to
# use).
proc ModulesHelp { } {
puts stderr "\tThis module acts as a dispatcher to automatically"
puts stderr "\tload the 'right' LAM/MPI installation into your"
puts stderr "\tenvironment based on what LAM/MPI installations are"
puts stderr "\tload the 'right' Open MPI installation into your"
puts stderr "\tenvironment based on what Open MPI installations are"
puts stderr "\tavailable and the environment available on this machine."
}
module-whatis "Automatically select an appropriate LAM/MPI modulefile to load."
module-whatis "Automatically select an appropriate Open MPI modulefile to load."
# Don't let any other MPI module be loaded while this one is loaded
conflict mpi
# Directory where we'll find the LAM modulefiles.
# Directory where we'll find the Open MPI modulefiles.
set modulefiledir /opt/modules/modulefiles
@ -35,7 +37,7 @@ set modulefiledir /opt/modules/modulefiles
set have_blcr [file exists /usr/lib/libcr.so]
set have_gm [file exists /usr/lib/libgm.so]
# Get the version number of the LAM represented by this modulefile
# Get the version number of the Open MPI represented by this modulefile
set version [lindex [split [module-info name] "-"] 1]
@ -45,18 +47,18 @@ set version [lindex [split [module-info name] "-"] 1]
# statement in the final else clause will ensure that this module is
# actually not loaded. So fail silently, but under protest. ;-)
set dir "$modulefiledir/lam"
set dir "$modulefiledir/openmpi"
if { $have_blcr == 1 && $have_gm == 1 &&
[file exists $dir/lam-with-blcr-and-gm-oscar-$version] } {
module load $dir/lam-with-blcr-and-gm-oscar-$version
[file exists $dir/openmpi-with-blcr-and-gm-$version] } {
module load $dir/openmpi-with-blcr-and-gm-$version
} elseif { $have_blcr == 0 && $have_gm == 1 &&
[file exists $dir/lam-with-gm-oscar-$version] } {
module load $dir/lam-with-gm-oscar-$version
[file exists $dir/openmpi-with-gm-$version] } {
module load $dir/openmpi-with-gm-$version
} elseif { $have_blcr == 1 && $have_gm == 0 &&
[file exists $dir/lam-with-blcr-oscar-$version] } {
module load $dir/lam-with-blcr-oscar-$version
} elseif { [file exists $dir/lam-oscar-$version] } {
module load $dir/lam-oscar-$version
[file exists $dir/openmpi-with-blcr-$version] } {
module load $dir/openmpi-with-blcr-$version
} elseif { [file exists $dir/openmpi-$version] } {
module load $dir/openmpi-$version
} else {
break
}