Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bmhan12 committed Jan 18, 2024
1 parent e716d16 commit a7dbd0b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 40 deletions.
30 changes: 6 additions & 24 deletions scripts/setupLC-TPL-uberenv-helper.bash
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/bin/bash

## Builds the TPLs for a specific system and host config.
## Usage ./setupLC-TPL-uberenv-helper.bash pathToGeosxDirectory pathToInstallDirectory machine compiler commandToGetANode
#GEOSX_DIR=$1
GEOS_BRANCH=$1
INSTALL_DIR=$2
MACHINE=$3
COMPILER=$4
SPEC=\"${5}\"
GET_A_NODE=$6
## Usage ./setupLC-TPL-uberenv-helper.bash pathToInstallDirectory machine compiler spackSpecToBuild commandToGetANode
INSTALL_DIR=$1
MACHINE=$2
COMPILER=$3
SPEC=\"${4}\"
GET_A_NODE=$5

## Eat up the command line arguments so the rest can be forwarded to config-build.
shift
Expand All @@ -19,31 +17,15 @@ shift

CONFIG=$MACHINE-$COMPILER
LOG_FILE=$CONFIG.log
# HOST_CONFIG=$GEOSX_DIR/host-configs/LLNL/$CONFIG.cmake
#INSTALL_DIR=$INSTALL_DIR/install-$CONFIG-release

#echo "Building the TPLs on $MACHINE for $HOST_CONFIG to be installed at $INSTALL_DIR. Progress will be written to $LOG_FILE."
echo "Building the TPLs on $MACHINE for $COMPILER to be installed at $INSTALL_DIR. Progress will be written to $LOG_FILE."

ssh $MACHINE -t "
. /etc/profile &&
cd $PWD/tempGEOS &&
echo $SPEC &&
echo $GET_A_NODE &&
$GET_A_NODE ./scripts/uberenv/uberenv.py --spec ${SPEC} --prefix ${INSTALL_DIR}/${CONFIG}_tpls --spack-env-name ${CONFIG}_env &&
exit" > $LOG_FILE 2>&1

# $GET_A_NODE ./scripts/uberenv/uberenv.py --spec ${SPEC} --prefix $INSTALL_DIR --spack-env-name ${CONFIG}_env --skip-setup &&

# ssh $MACHINE -t "
# . /etc/profile &&
# cd $PWD &&
# module load cmake/3.23.1 &&
# python3 scripts/config-build.py -hc $HOST_CONFIG -bt Release -ip $INSTALL_DIR $@ &&
# cd build-$CONFIG-release &&
# $GET_A_NODE make &&
# exit" > $LOG_FILE 2>&1

## Check the last ten lines of the log file.
## A successful install should show up on one of the final lines.
tail -10 $LOG_FILE | grep -E "Successfully installed geos" > /dev/null
Expand Down
33 changes: 17 additions & 16 deletions scripts/setupLC-TPL-uberenv.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

## Builds the TPLs on all LC systems. Must be run from the top level TPL directory.
## Usage ./setupLC-TPL.bash branchToBuild pathToInstallDirectory [extra arguments to config-build ]
## Usage ./setupLC-TPL.bash branchToBuild pathToInstallDirectory
GEOS_BRANCH=$1
INSTALL_DIR=$2

Expand All @@ -24,13 +24,13 @@ killall() {
branch_exists=$(git ls-remote https://github.com/GEOS-DEV/GEOS.git $GEOS_BRANCH | wc -l)

if [[ $branch_exists != 1 ]] ; then
echo "Branch $GEOS_BRANCH does not exist in GEOS repository"
exit
echo "Branch $GEOS_BRANCH does not exist in GEOS repository"
exit
fi

if [[ -z $INSTALL_DIR ]]; then
echo "No installation directory path was provided"
exit
echo "No installation directory path was provided"
exit
fi

if [[ ! -d $INSTALL_DIR ]]; then
Expand All @@ -51,25 +51,26 @@ git clone -b $GEOS_BRANCH https://github.com/GEOS-DEV/GEOS.git tempGEOS
cd tempGEOS
git submodule init scripts/uberenv
git submodule update
# ./scripts/uberenv/uberenv.py --prefix $INSTALL_DIR --setup-only --spack-env-file scripts/spack_configs/toss_4_x86_64_ib/spack.yaml
cd ..

echo "Building all LC TPLs from $GEOS_BRANCH to be installed at $INSTALL_DIR"
echo "Building all LC TPLs from $GEOS_BRANCH to be installed at $INSTALL_DIR..."
chmod -R g+rx $INSTALL_DIR
chgrp -R GEOS $INSTALL_DIR
./scripts/setupLC-TPL-uberenv-helper.bash $GEOS_BRANCH $INSTALL_DIR quartz clang-14 "%[email protected] +docs" "salloc -N 1 -t 150 " $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $GEOS_BRANCH $INSTALL_DIR quartz gcc-12 "%[email protected] +docs" "salloc -N 1 -t 150 " $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $GEOS_BRANCH $INSTALL_DIR lassen gcc-8-cuda-11 "%[email protected]+cuda~uncrustify cuda_arch=70 ^[email protected]+allow-unsupported-compilers" "lalloc 1 -W 150" $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $GEOS_BRANCH $INSTALL_DIR lassen clang-13-cuda-11 "%[email protected]+cuda~uncrustify cuda_arch=70 ^[email protected]+allow-unsupported-compilers" "lalloc 1 -W 150" $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $GEOS_BRANCH $INSTALL_DIR lassen clang-10-cuda-11 "%[email protected]+cuda~uncrustify cuda_arch=70 ^[email protected]+allow-unsupported-compilers" "lalloc 1 -W 150" $@ &

./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR quartz clang-14 "%[email protected] +docs" "salloc -N 1 -t 150 " $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR quartz gcc-12 "%[email protected] +docs" "salloc -N 1 -t 150 " $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen gcc-8-cuda-11 "%[email protected]+cuda~uncrustify cuda_arch=70 ^[email protected]+allow-unsupported-compilers" "lalloc 1 -W 150" $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-13-cuda-11 "%[email protected]+cuda~uncrustify cuda_arch=70 ^[email protected]+allow-unsupported-compilers" "lalloc 1 -W 150" $@ &
./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-10-cuda-11 "%[email protected]+cuda~uncrustify cuda_arch=70 ^[email protected]+allow-unsupported-compilers" "lalloc 1 -W 150" $@ &

# Note: Estimated completion time is ~90 minutes.
# Check log files for unreported completion of jobs.
wait

echo "Copying generated host-configs..."
echo "Copying generated host-configs from tempGEOS directory..."
cd tempGEOS && cp *.cmake ..

#echo "Removing temporary GEOS repo tempGEOS..."
#rm -rf tempGEOS
echo "Removing temporary GEOS repo tempGEOS..."
rm -rf tempGEOS

echo "Complete"

0 comments on commit a7dbd0b

Please sign in to comment.