Apache Spark: Difference between revisions
No edit summary |
|||
Line 12: | Line 12: | ||
= Utilisation = | = Utilisation = | ||
{{File | |||
|name=pyspark_submit.sh | |||
|lang="sh" | |||
|contents= | |||
#!/bin/bash | |||
#SBATCH --account=def-someuser | |||
#SBATCH --time=00:01:00 | |||
#SBATCH --job-name=test | |||
#SBATCH --output=%x-%j.out | |||
module load spark/2.2.0 | |||
module load python/2.7.13 | |||
export SPARK_IDENT_STRING=$SLURM_JOBID | |||
export SPARK_WORKER_DIR=$SLURM_TMPDIR | |||
start-master.sh | |||
( | |||
export SPARK_NO_DAEMONIZE=1; | |||
export -n HOSTNAME; | |||
srun -x $(hostname) -n $((SLURM_NTASKS -1)) --label --output=$SPARK_LOG_DIR/spark-$SPARK_IDENT_STRING-workers.out | |||
start-slave.sh -m ${SLURM_MEM_PER_NODE}M -c ${SLURM_CPUS_PER_TASK} spark://$(hostname -f):7077 | |||
) & | |||
spark-submit --executor-memory ${SPARK_MEM_PER_NODE}M $SPARK_HOME/examples/src/main/python/pi.py 100000 | |||
srun stop-slave.sh | |||
stop-master.sh | |||
}} |
Revision as of 19:39, 7 September 2017
This is not a complete article: This is a draft, a work in progress that is intended to be published into an article, which may or may not be ready for inclusion in the main wiki. It should not necessarily be considered factual or authoritative.
Introduction[edit]
Apache Spark est une framework de calcul distribuée open source initialement développé par l'AMPLab de l'Université Berkeley, et maintenant un projet de la fondation Apache. Contrairement à l'algorithme MapReduce implémenté par Hadoop qui utilise le stockage sur disque, Spark utilise des primitives conservées en mémoire lui permettant d'atteindre des performances jusqu'à 100 fois plus rapide pour certaines applications. Le chargement des données en mémoire permet de les interroger fréquemment ce qui fait de Spark une framework particulièrement approprié pour l'apprentissage automatique et l'analyse de données interactive.
Configuration[edit]
$HOME/.spark/<version>/conf
export MKL_NUM_THREADS=1
Utilisation[edit]
#!/bin/bash
#SBATCH --account=def-someuser
#SBATCH --time=00:01:00
#SBATCH --job-name=test
#SBATCH --output=%x-%j.out
module load spark/2.2.0
module load python/2.7.13
export SPARK_IDENT_STRING=$SLURM_JOBID
export SPARK_WORKER_DIR=$SLURM_TMPDIR
start-master.sh
(
export SPARK_NO_DAEMONIZE=1;
export -n HOSTNAME;
srun -x $(hostname) -n $((SLURM_NTASKS -1)) --label --output=$SPARK_LOG_DIR/spark-$SPARK_IDENT_STRING-workers.out
start-slave.sh -m ${SLURM_MEM_PER_NODE}M -c ${SLURM_CPUS_PER_TASK} spark://$(hostname -f):7077
) &
spark-submit --executor-memory ${SPARK_MEM_PER_NODE}M $SPARK_HOME/examples/src/main/python/pi.py 100000
srun stop-slave.sh
stop-master.sh