You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ad...@apache.org on 2014/05/12 03:17:42 UTC

git commit: SPARK-1652: Set driver memory correctly in spark-submit.

Repository: spark
Updated Branches:
  refs/heads/master 7d9cc9214 -> 05c9aa9eb


SPARK-1652: Set driver memory correctly in spark-submit.

The previous check didn't account for the fact that the default
deploy mode is "client" unless otherwise specified. Also, this
sets the more narrowly defined SPARK_DRIVER_MEMORY instead of setting
SPARK_MEM.

Author: Patrick Wendell <pw...@gmail.com>

Closes #730 from pwendell/spark-submit and squashes the following commits:

430b98f [Patrick Wendell] Feedback from Aaron
e788edf [Patrick Wendell] Changes based on Aaron's feedback
f508146 [Patrick Wendell] SPARK-1652: Set driver memory correctly in spark-submit.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/05c9aa9e
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/05c9aa9e
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/05c9aa9e

Branch: refs/heads/master
Commit: 05c9aa9eb1b7f13cd40bbca23e6bc7e1d20e91cd
Parents: 7d9cc92
Author: Patrick Wendell <pw...@gmail.com>
Authored: Sun May 11 18:17:34 2014 -0700
Committer: Aaron Davidson <aa...@databricks.com>
Committed: Sun May 11 18:17:34 2014 -0700

----------------------------------------------------------------------
 bin/spark-submit | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/05c9aa9e/bin/spark-submit
----------------------------------------------------------------------
diff --git a/bin/spark-submit b/bin/spark-submit
index 49bc262..63903b1 100755
--- a/bin/spark-submit
+++ b/bin/spark-submit
@@ -35,8 +35,10 @@ while (($#)); do
   shift
 done
 
-if [ ! -z $DRIVER_MEMORY ] && [ ! -z $DEPLOY_MODE ] && [ $DEPLOY_MODE = "client" ]; then
-  export SPARK_MEM=$DRIVER_MEMORY
+DEPLOY_MODE=${DEPLOY_MODE:-"client"}
+
+if [ -n "$DRIVER_MEMORY" ] && [ $DEPLOY_MODE == "client" ]; then
+  export SPARK_DRIVER_MEMORY=$DRIVER_MEMORY
 fi
 
 $SPARK_HOME/bin/spark-class org.apache.spark.deploy.SparkSubmit "${ORIG_ARGS[@]}"