From aba949e00459ccd85c91ebce53959fd107042bc0 Mon Sep 17 00:00:00 2001 From: Guilherme Pantoja Calandrini de Azevedo Junior <guilherme.calandrini@tu-dresden.de> Date: Wed, 7 Dec 2022 08:36:56 +0100 Subject: [PATCH] Update fem_software.md Added version of distributed mapdl --- .../docs/software/fem_software.md | 81 ++++++++++++++++++- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/doc.zih.tu-dresden.de/docs/software/fem_software.md b/doc.zih.tu-dresden.de/docs/software/fem_software.md index 3c4531948..eb4b1e507 100644 --- a/doc.zih.tu-dresden.de/docs/software/fem_software.md +++ b/doc.zih.tu-dresden.de/docs/software/fem_software.md @@ -188,13 +188,88 @@ that you can simply change to something like 16 or 24. For now, you should stay boundaries, because multi-node calculations require additional parameters. The number you choose should match your used `--cpus-per-task` parameter in your job file. -### Running MAPDL in Interactive Mode +### Running MAPDL ANSYS Mechanical APDL (sometimes called ANSYS Classic, the older MAPDL scripted environment). +### SMP (1 node only) + +#### Interactive mode + +```console +marie@login$ srun --partition=haswell --nodes 1 --ntasks-per-node=4 --time=0:20:00 --mem-per-cpu=1700 --pty bash -l +``` + +```console +marie@node$ module load ANSYS/2021R2 +marie@node$ mapdl -smp -np $SLURM_NTASKS +``` + +#### Batch mode + +```bash +#!/bin/bash +#SBATCH --nodes=1 +#SBATCH --ntasks-per-node=4 +#SBATCH --mem=2000 +#SBATCH --job-name=ansys_mapdl +#SBATCH --output=output_ansys_mapdl +#SBATCH --time=01:00:00 + +module load ANSYS/2021R2 + +# -smp use shared memory parallel version +# -b (batch mode) +# -np specify number of cpu's to use +# -j jobname + +mapdl -smp -b -np $SLURM_NTASKS -j solution -i <input-file> +``` + + +```console +marie@login$ sbatch mapdl_job.sh +``` + +### Distributed (n nodes) + +#### Interactive mode + +```console +marie@login$ srun --partition=haswell --nodes 4 --ntasks-per-node=4 --time=0:20:00 --mem-per-cpu=1700 --pty bash -l + +# generate node list +marie@node$ NODELIST=$(for node in $( scontrol show hostnames $SLURM_JOB_NODELIST | uniq ); do echo -n "${node}:${SLURM_NTASKS_PER_NODE}:"; done | sed 's/:$//') + +marie@node$ KMP_AFFINITY=none mapdl -machines $NODELIST +``` + +#### Batch mode + +```bash +#!/bin/bash +#SBATCH --nodes=4 +#SBATCH --ntasks-per-node=4 +#SBATCH --mem=2000 +#SBATCH --job-name=ansys_mapdl +#SBATCH --output=output_ansys_mapdl +#SBATCH --time=01:00:00 + +module load ANSYS/2021R2 + +# generate node list +NODELIST=$(for node in $( scontrol show hostnames $SLURM_JOB_NODELIST | uniq ); do echo -n "${node}:${SLURM_NTASKS_PER_NODE}:"; done | sed 's/:$//') + +# -b (batch mode) +# -machines xxx specify machines list for distributed Ansys +# -j jobname +setenv KMP_AFFINITY none + +mapdl -b -machines $NODELIST -j solution -i <input-file> +``` + ```console -marie@login$ srun --partition=haswell --ntasks=1 --cpus-per-task=4 --time=1:00:00 --mem-per-cpu=1700 --pty bash -marie@node$ mapdl -smp +marie@login$ sbatch mapdl_job.sh ``` ## COMSOL Multiphysics -- GitLab