|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -# Runs the MovieLensALS application with netflix data, this script |
4 |
| -# allows us to easily modify GPU usage |
| 3 | +# Runs the MovieLensALS application using a given file, this script |
| 4 | +# allows us to easily control GPU usage |
5 | 5 |
|
6 |
| -# Check input arguments, we want five and cpu or gpu specified |
7 |
| -# the input format is the same as it is for the MovieLens example |
8 |
| -# except with the addition of the cpu/gpu parameter and the file name to use |
9 |
| -# arg 1 = execution method e.g. cpu or gpu |
| 6 | +# Note that you should change the spark-submit command if you're working with a prebuilt distribution of Spark |
| 7 | +# e.g. use $SPARK_HOME/examples/jars/spark-examples*.jar and $SPARK_HOME/examples/jars/scopt*.jar |
| 8 | + |
| 9 | +# The input format is the same as it is for the MovieLens example |
| 10 | +# except with the addition of the CPU/GPU parameter and the file name to use |
| 11 | +# arg 1 = execution method e.g. CPU or GPU |
10 | 12 | # arg 2 = master e.g. local[*] or spark://foo.com:7077
|
11 | 13 | # arg 3 = rank e.g. 100
|
12 | 14 | # arg 4 = numIterations e.g. 10
|
|
22 | 24 | gpu=""
|
23 | 25 | if [ "$1" = "gpu" ]; then
|
24 | 26 | gpu="--conf spark.mllib.ALS.useGPU=$SPARK_HOME/../CUDA-MLlib/als/libGPUALS.so"
|
25 |
| - echo "Using gpu library: $gpu" |
| 27 | + echo "Using GPU library: $gpu" |
26 | 28 | fi
|
27 | 29 |
|
28 | 30 | # For the netflix sample data we know ideal parameters are
|
29 | 31 | # rank 100, numIterations 10, lambda 0.058
|
| 32 | + |
30 | 33 | $SPARK_HOME/bin/spark-submit --class org.apache.spark.examples.mllib.MovieLensALS $gpu \
|
31 | 34 | --master $2 \
|
32 | 35 | --jars $SPARK_HOME/examples/target/scala-2.11/jars/spark-examples*.jar \
|
|
0 commit comments