Now that the job is already running, changing the configuration by hard-code is not advisable. It is good that you have decided to dynamically change it. To do this, refer the below code:
val sc = new SparkContext(new SparkConf())
./bin/spark-submit <all your existing options> --conf spark.driver.cores=1