Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
logiciels:gromacs [2015/11/05 16:03] fabrep03 [Sur CPU] |
logiciels:gromacs [2019/01/28 11:27] (Version actuelle) fabrep03 [Performance] |
||
---|---|---|---|
Ligne 10: | Ligne 10: | ||
* 5.0.2 avec support OpenMP et GPU NVidia (:!: compilé avec Intel composer 2013) | * 5.0.2 avec support OpenMP et GPU NVidia (:!: compilé avec Intel composer 2013) | ||
* 5.0.4, en simple et double précision, avec MPI ou sans | * 5.0.4, en simple et double précision, avec MPI ou sans | ||
+ | * 2016 avec support OpenMP et MPI | ||
+ | * 2018.4 avec support OpenMP et MPI | ||
+ | * 2019 avec support OpenMP, MPI, nouvelles SIMD et GPU avec CUDA 10.0 | ||
===== Utilisation ===== | ===== Utilisation ===== | ||
- | Voir les manuels d' | + | Voir les manuels d' |
- | Pour une discussion sur la parallélisation : http:// | ||
==== Sélection de la version ==== | ==== Sélection de la version ==== | ||
Pour sélectionner la version voulue : utiliser les [[..: | Pour sélectionner la version voulue : utiliser les [[..: | ||
Par exemple : | Par exemple : | ||
- | module load gromacs/5.0.2-mpi | + | module load gromacs/2019 |
- | :!: Si vous utilisez la version GPU, vous devez faire | + | Un seul fichier module existe. Le nom de l' |
- | module unload intel/ | + | * '' |
- | module load intel/ | + | * '' |
- | module load gromacs/ | + | * '' |
- | + | * '' | |
- | Pour la version 5.0.4, un seul fichier module existe. Le nom de l' | + | * '' |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
===== Performance ===== | ===== Performance ===== | ||
- | Les benchmarks suivants ont été réalisés sur une simulation de DHFR (une petite protéine), qui est couramment utilisée pour des benchmarks. Le système contient environ 23000 atomes. | + | La dernière version |
- | Il est possible de paralléliser de deux manières différentes : | + | |
- | * avec MPI, qui est performant pour partager un job au sein d'un ou plusieurs noeuds | + | |
- | * avec openMP, qui peut être performant pour partager des coeurs au sein d'un processus MPI sur un même noeud. | + | |
- | Voici un tableau des performances relevées avec Gromacs 5.0.2 compilé avec les compilateurs intel : | + | |
- | nb_coeurs | + | J'ai effectué de nombreux benchmarks et on en tire des enseignements intéressants. Le mieux est de consulter la présentation |
- | 2 | + | |
- | 4 | + | |
- | 8 | + | |
- | | + | |
- | | + | |
- | | + | |
- | 128 | + | |
- | 256 | + | |
- | 256 | + | |
- | 8 | + | |
- | 8 | + | |
- | | + | |
- | | + | |
- | + | ||
- | Ne sont présentées ici que les configurations les plus rapides. En effet, sur CPU uniquement, openMP n'est efficace que pour des gros systèmes sur un grand nombre de coeurs. Avec moins de 256 coeurs, on constate une dégradation de performance quel que soit le nombre de threads openMP par processus MPI. | + | |
- | Avec des GPU, c'est différent. Il faut utiliser au moins un processus thread-MPI par GPU. Ensuite, on ajuste le nombre de threads openMP pour obtenir le nombre de coeurs voulu. En pratique, utiliser plus d'un thread-MPI par GPU dégrade la performance. | + | {{: |
- | On constate qu' | ||
===== Exemples de fichiers batch slurm ===== | ===== Exemples de fichiers batch slurm ===== | ||
==== Sur CPU ==== | ==== Sur CPU ==== | ||
- | < | + | |
- | #SBATCH --partition=normal | + | #SBATCH --partition=normal |
- | #SBATCH --ntasks=16 | + | #SBATCH --ntasks=16 |
- | #SBATCH --cpus-per-task=1 | + | #SBATCH --cpus-per-task=1 |
- | #SBATCH --threads-per-core=1 | + | #SBATCH --threads-per-core=1 |
- | #SBATCH --mem-per-cpu=1000 | + | #SBATCH --mem-per-cpu=1000 |
- | #SBATCH --time=2-00: | + | #SBATCH --time=2-00: |
- | #SBATCH --nodes=1-4 | + | #SBATCH --nodes=1-4 |
- | + | ||
- | # the --nodes option sets the minimum and maximum number of cores. It is good to set the maximum to ntasks/16 to limit jobs spread on many many nodes. | + | # the --nodes option sets the minimum and maximum number of cores. It is good to set the maximum to ntasks/16 to limit jobs spread on many many nodes. |
- | + | ||
- | module load gromacs | + | module load gromacs |
- | export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK | + | export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK |
- | mdrun=" | + | mdrun=" |
- | grompp=" | + | grompp=" |
- | + | ||
- | if [ -r " | + | if [ -r " |
- | # if state.cpt exists in the current directory, that means we are in scratch and the calculation has run already | + | # if state.cpt exists in the current directory, that means we are in scratch and the calculation has run already |
- | restart=" | + | restart=" |
- | else | + | else |
- | restart=" | + | restart=" |
- | fi | + | fi |
- | # restart=" | + | # restart=" |
- | + | ||
- | if [ " | + | if [ " |
- | MIN=false # we assume min step is done the first day | + | MIN=false # we assume min step is done the first day |
- | #WORKDIR has to be where the data is, i.e. in scratch / inside the results.* folder. So submit this batch file from there. | + | #WORKDIR has to be where the data is, i.e. in scratch / inside the results.* folder. So submit this batch file from there. |
- | WORKDIR=" | + | WORKDIR=" |
- | sleep 30 # to make sure all processes from the previous job are killed | + | sleep 30 # to make sure all processes from the previous job are killed |
- | restartoptions=" | + | restartoptions=" |
- | else # options for the beginning of the run | + | else # options for the beginning of the run |
- | MIN=true | + | MIN=true |
- | simname=`basename $PWD` | + | simname=`basename $PWD` |
- | WORKDIR=" | + | WORKDIR=" |
- | # | + | # |
- | # Directory used to store the results | + | # Directory used to store the results |
- | # | + | # |
- | mkdir -p $WORKDIR || { | + | mkdir -p $WORKDIR || { |
- | echo "ERROR Creating the working directory" | + | echo "ERROR Creating the working directory" |
- | exit 1 | + | exit 1 |
- | } | + | } |
- | cp * $WORKDIR | + | cp * $WORKDIR |
- | ln -sfn $WORKDIR " | + | ln -sfn $WORKDIR " |
- | cd $WORKDIR | + | cd $WORKDIR |
- | restartoptions="" | + | restartoptions="" |
- | fi | + | fi |
- | + | ||
- | cd $WORKDIR | + | cd $WORKDIR |
- | + | ||
- | if [ $MIN = " | + | if [ $MIN = " |
+ | |||
$grompp -f em.mdp -c md.gro -n md.ndx -p md.top -o em.tpr | $grompp -f em.mdp -c md.gro -n md.ndx -p md.top -o em.tpr | ||
$mdrun -s em.tpr -o em.trr -c em.gro -e em.edr -g em.log | $mdrun -s em.tpr -o em.trr -c em.gro -e em.edr -g em.log | ||
+ | | ||
$grompp -f pr.mdp -c em.gro -n md.ndx -p md.top -r em.gro -o pr.tpr | $grompp -f pr.mdp -c em.gro -n md.ndx -p md.top -r em.gro -o pr.tpr | ||
$mdrun -s pr.tpr -o pr.trr -c pr.gro -e pr.edr -g pr.log | $mdrun -s pr.tpr -o pr.trr -c pr.gro -e pr.edr -g pr.log | ||
+ | | ||
mv pr.gro 0.gro | mv pr.gro 0.gro | ||
+ | | ||
+ | fi | ||
+ | | ||
+ | #use the following line if you want to prolong a simulation that crashed or terminated normally. | ||
+ | #if you just want to finish it after a crash, comment it. | ||
+ | #adjust the -until option to the total amount of ps you want to have. | ||
+ | #gmx convert-tpr -s md.tpr -o md.tpr -until 1000000 | ||
+ | | ||
+ | # tricky part: submit the same job, that will only be run after the current one crashes. | ||
+ | sbatch -d afternotok: | ||
+ | | ||
+ | if [ " | ||
+ | $grompp -f md.mdp -c 0.gro -n md.ndx -p md.top -o md.tpr | ||
+ | fi | ||
+ | | ||
+ | #the -cpi option will use your checkpoint to restart the calculation and continue writing to your files. | ||
+ | $mdrun -s md.tpr -o md.trr -x md.xtc -c md_out.gro -e md.edr -g md.log $restartoptions | ||
+ | | ||
+ | rm -f md.trr # remove the big file (>1GB) after the calculation | ||
+ | rm -f #* # remove the backup files | ||
- | fi | ||
- | |||
- | #use the following line if you want to prolong a simulation that crashed or terminated normally. | ||
- | #if you just want to finish it after a crash, comment it. | ||
- | #adjust the -until option to the total amount of ps you want to have. | ||
- | #gmx convert-tpr -s md.tpr -o md.tpr -until 1000000 | ||
- | |||
- | # tricky part: submit the same job, that will only be run after the current one crashes. | ||
- | sbatch -d afternotok: | ||
- | |||
- | if [ " | ||
- | $grompp -f md.mdp -c 0.gro -n md.ndx -p md.top -o md.tpr | ||
- | fi | ||
- | |||
- | #the -cpi option will use your checkpoint to restart the calculation and continue writing to your files. | ||
- | $mdrun -s md.tpr -o md.trr -x md.xtc -c md_out.gro -e md.edr -g md.log $restartoptions | ||
- | |||
- | rm -f md.trr # remove the big file (>1GB) after the calculation | ||
- | rm -f \#* # remove the backup files | ||
- | </ | ||
===== Exemple de fichier batch slurm sur GPU ===== | ===== Exemple de fichier batch slurm sur GPU ===== | ||
==== Sur 1 GPU ==== | ==== Sur 1 GPU ==== |