diff --git a/examples/src/main/scala/org/apache/spark/examples/SparkGPULR.scala b/examples/src/main/scala/org/apache/spark/examples/SparkGPULR.scala index d193abd086..e9d1c66b03 100644 --- a/examples/src/main/scala/org/apache/spark/examples/SparkGPULR.scala +++ b/examples/src/main/scala/org/apache/spark/examples/SparkGPULR.scala @@ -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_", diff --git a/gpudev/util/args.sh b/gpudev/util/args.sh index a60cb9e0eb..2ccf4b0c85 100644 --- a/gpudev/util/args.sh +++ b/gpudev/util/args.sh @@ -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" diff --git a/gpudev/util/compile.sh b/gpudev/util/compile.sh index 1da58f40db..5749f230bc 100755 --- a/gpudev/util/compile.sh +++ b/gpudev/util/compile.sh @@ -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 diff --git a/gpudev/util/debugtest.sh b/gpudev/util/debugtest.sh index d721e4e7fa..f66cabae66 100755 --- a/gpudev/util/debugtest.sh +++ b/gpudev/util/debugtest.sh @@ -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 diff --git a/gpudev/util/embedjcudalib.sh b/gpudev/util/embedjcudalib.sh index 7b3c5974a7..c1a3d981e6 100755 --- a/gpudev/util/embedjcudalib.sh +++ b/gpudev/util/embedjcudalib.sh @@ -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() { @@ -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} @@ -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 + diff --git a/gpudev/util/md.log b/gpudev/util/md.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/gpudev/util/sbttest.sh b/gpudev/util/sbttest.sh index 148989a501..5fe40da7b1 100755 --- a/gpudev/util/sbttest.sh +++ b/gpudev/util/sbttest.sh @@ -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=\ diff --git a/gpudev/util/scala-cc.sh b/gpudev/util/scala-cc.sh index 2e6f20c97a..a393708ccd 100755 --- a/gpudev/util/scala-cc.sh +++ b/gpudev/util/scala-cc.sh @@ -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 diff --git a/gpudev/util/scala-console.sh b/gpudev/util/scala-console.sh index 153706b3e7..979926a26f 100755 --- a/gpudev/util/scala-console.sh +++ b/gpudev/util/scala-console.sh @@ -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" diff --git a/gpudev/util/testall.sh b/gpudev/util/testall.sh index 22f5f466e5..b98a50e47f 100755 --- a/gpudev/util/testall.sh +++ b/gpudev/util/testall.sh @@ -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 diff --git a/gpudev/util/testcore.sh b/gpudev/util/testcore.sh index 391c90505e..bb8116520e 100755 --- a/gpudev/util/testcore.sh +++ b/gpudev/util/testcore.sh @@ -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 diff --git a/gpudev/util/testdev.sh b/gpudev/util/testdev.sh index 50e9a41e4f..c4a163e7c0 100755 --- a/gpudev/util/testdev.sh +++ b/gpudev/util/testdev.sh @@ -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=\