Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ object SparkGPULR {
val R = 0.7 // Scaling factor
val ITERATIONS = if (args.length > 3) args(3).toInt else 5

val ptxURL = SparkGPUPi.getClass.getResource("/SparkGPUExamples.ptx")
val ptxURL = SparkGPULR.getClass.getResource("/SparkGPUExamples.ptx")
val mapFunction = sc.broadcast(
new CUDAFunction(
"_Z14SparkGPULR_mapPKlPKdS2_PlPdlS2_",
Expand Down
5 changes: 3 additions & 2 deletions gpudev/util/args.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
DIR=../..
DIR=$SCRIPT_DIR/../..
#ABSOLUTE_DIR=`realpath $DIR`
ABSOLUTE_DIR=`readlink -e $DIR`
# might need to use -Dos.arch=ppc64le on OpenJDK in MAVEN_OPTS and JAVA_OPTS because of a bug
export MAVEN_OPTS="$MAVEN_OPTS -Xmx32G -XX:MaxPermSize=8G -XX:ReservedCodeCacheSize=2G"
MVN_ARGS="-Pyarn -Phadoop-2.4 -Dhadoop.version=2.4.0 -Dscala-2.11 -Phive-thriftserver -Phive"
#MVN_ARGS="-Pyarn -Phadoop-2.4 -Dhadoop.version=2.4.0 -Dscala-2.11 -Phive-thriftserver -Phive"
MVN_ARGS="-Pyarn -Phadoop-2.4 -Dhadoop.version=2.4.0 -Dscala-2.11"
export JAVA_OPTS="-Xms2M -Xmx32G -XX:MaxPermSize=8G -XX:ReservedCodeCacheSize=2G"

#export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-ppc64el"
Expand Down
3 changes: 2 additions & 1 deletion gpudev/util/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# ./compile.sh full - package everything ("normal" compilation)
# ./compile.sh clean full install - package and install everything ("normal" clean install)

source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
echo $DIR
cd $DIR

Expand Down
3 changes: 2 additions & 1 deletion gpudev/util/debugtest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR

jdb -attach $DBG_PORT
60 changes: 34 additions & 26 deletions gpudev/util/embedjcudalib.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR

usage() {
Expand Down Expand Up @@ -41,19 +42,16 @@ do
done
shift $((OPTIND - 1))

DISTASM=dist/lib/spark-assembly-${VERSION}-hadoop${HADOOP}.jar
if [ ! -f $DISTASM ]; then
echo "file $DISTASM does not exist. Please check file name."
exit 1
fi


function addlib2jar {
libdir=$2/target
lib=lib/$4-${OS}-${ARCH}.${EXT}
if [ ! -f $libdir/$lib ]; then
echo "file $libdir/$lib does not exist. Please check file name."
exit 1
if [ ! -f "$libdir/$lib" ]; then
#echo "file $libdir/$lib does not exist. Please check file name." >&2
return 255
fi
if [ "$5" == "on" ]; then
echo "$1 is being processed" >& 2
fi
if [ $1 == "DIST" ]; then
jar=${DISTASM}
Expand All @@ -62,24 +60,34 @@ function addlib2jar {
fi
if [ -e $libdir/$lib ]; then
if [ -e $jar ]; then
jar uf $jar -C $libdir $lib
jar uf $jar -C $libdir $lib && echo " added $lib" >&2
fi
fi
fi
return 1
}

for dir in *; do
if [ -d $dir ] && [ -f $dir/target/lib/libJCudaDrive*.so ]; then
echo $dir is being processed
addlib2jar $dir $dir jcuda libJCudaDriver
addlib2jar $dir $dir jcuda libJCudaRuntime
for lib in ublas ufft urand usolver usparse; do
addlib2jar $dir $dir jc${lib} libJC${lib}
done
for dir in core unsafe; do
if [ -d $dir ] && [ $dir != "dist" ]; then
addlib2jar $dir $dir jcuda libJCudaDriver on
if [ $? == 1 ]; then
addlib2jar $dir $dir jcuda libJCudaRuntime
for lib in ublas ufft urand usolver usparse; do
addlib2jar $dir $dir jc${lib} libJC${lib}
done
fi
fi
done
echo $DISTASM is being processed
addlib2jar DIST core jcuda libJCudaDriver
addlib2jar DIST core jcuda libJCudaRuntime
for lib in ublas ufft urand usolver usparse; do
addlib2jar DIST core jc${lib} libJC${lib}
done

DISTASM=dist/lib/spark-assembly-${VERSION}-hadoop${HADOOP}.jar
if [ -f $DISTASM ]; then
addlib2jar DIST core jcuda libJCudaDriver on
if [ $? == 1 ]; then
addlib2jar DIST core jcuda libJCudaRuntime
for lib in ublas ufft urand usolver usparse; do
addlib2jar DIST core jc${lib} libJC${lib}
done
fi
else
echo "file $DISTASM does not exist. Please check file name." >&2
fi

Empty file added gpudev/util/md.log
Empty file.
3 changes: 2 additions & 1 deletion gpudev/util/sbttest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# should run a test, but doesn't work
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR

SCALA_TESTS=\
Expand Down
3 changes: 2 additions & 1 deletion gpudev/util/scala-cc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR

if [[ "$1" != "" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion gpudev/util/scala-console.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR/core
trap '' 2
export LD_LIBRARY_PATH="target/lib:$LD_LIBRARY_PATH"
Expand Down
3 changes: 2 additions & 1 deletion gpudev/util/testall.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR

$MVN_CMD $MVN_ARGS -DtagsToExclude=$EXCL_TAGS --fail-never test $@ 2>&1 | tee ~/testlog-all.txt
Expand Down
3 changes: 2 additions & 1 deletion gpudev/util/testcore.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR

$MVN_CMD $MVN_ARGS -DtagsToExclude=$EXCL_TAGS --fail-at-end test -pl core $@ 2>&1 | tee ~/testlog-core.txt
Expand Down
3 changes: 2 additions & 1 deletion gpudev/util/testdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# run only the tests being worked on
# ./testdev.sh compile also compiles the stuff before
# ./testdev.sh debug waits for attachment of a scala debugger
source args.sh
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
source $SCRIPT_DIR/args.sh
cd $DIR

SCALA_TESTS=\
Expand Down