Skip to content

Commit

Permalink
fix for mem and threads
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Sep 24, 2024
1 parent 58c13f5 commit ac260a4
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions spark_custom_install
Original file line number Diff line number Diff line change
Expand Up @@ -94,27 +94,30 @@ sleep 2

#mvn clean install
#echo 'Building a farjar, which can also be used for cluster/cloud execution'
mvn clean install -P fatjar -gs /opt/BigStitcher-Spark/settings.xml
mvn -Dmdep.outputFile=cp.txt -Dmdep.includeScope=runtime dependency:build-classpath
mvn clean install -P fatjar -Dmaven.repo.local=/opt/BigStitcher-Spark/repo
mvn -Dmdep.outputFile=cp.txt -Dmdep.includeScope=runtime dependency:build-classpath -Dmaven.repo.local=/opt/BigStitcher-Spark/repo

# function that installs one command
# $1 - command name
# $2 - java class containing the functionality
install_command () {
echo "Installing '$1' command into" $INSTALL_DIR

echo '#!/bin/bash' > $1
echo '' >> $1
echo "JAR=/opt/BigStitcher-Spark/repo/net/preibisch/BigStitcher-Spark/${VERSION}/BigStitcher-Spark-${VERSION}.jar" >> $1
echo 'java \' >> $1
echo " -Xmx${MEM}g -Dspark.master=local[${THREADS}] \\" >> $1
# echo ' -XX:+UseConcMarkSweepGC \' >> $1
echo -n ' -cp $JAR:' >> $1
echo -n $(cat cp.txt) >> $1
echo ' \' >> $1
echo ' '$2' "$@"' >> $1

chmod a+x $1
echo "Installing '$1' command into" $INSTALL_DIR

echo '#!/bin/bash' > $1
echo '' >> $1
echo 'MEM=$1' >> $1
echo 'THREADS=$2' >> $1
echo 'shift 2' >> $1
echo "JAR=/opt/BigStitcher-Spark/repo/net/preibisch/BigStitcher-Spark/${VERSION}/BigStitcher-Spark-${VERSION}.jar" >> $1
echo 'java \' >> $1
echo " -Xmx${MEM}g -Dspark.master=local[${THREADS}] \\" >> $1
# echo ' -XX:+UseConcMarkSweepGC \' >> $1
echo -n ' -cp $JAR:' >> $1
echo -n $(cat cp.txt) >> $1
echo ' \' >> $1
echo ' '$2' "$@"' >> $1

chmod a+x $1
}

echo 'Installing workflow tools ...'
Expand Down

0 comments on commit ac260a4

Please sign in to comment.