added ANSYS/MAPDL
This commit is contained in:
119
pages/merlin6/05 Software Support/ansys-mapdl.md
Normal file
119
pages/merlin6/05 Software Support/ansys-mapdl.md
Normal file
@ -0,0 +1,119 @@
|
||||
---
|
||||
title: ANSYS / MAPDL
|
||||
#tags:
|
||||
last_updated: 30 June 2020
|
||||
keywords: software, ansys, mapdl, slurm, apdl
|
||||
summary: "This document describes how to run ANSYS/Mechanical APDL in the Merlin6 cluster"
|
||||
sidebar: merlin6_sidebar
|
||||
permalink: /merlin6/ansys-mapdl.html
|
||||
---
|
||||
|
||||
This document describes the different ways for running **ANSYS/Mechanical APDL**
|
||||
|
||||
## ANSYS/Mechanical APDL
|
||||
|
||||
Is always recommended to check which parameters are available in Mechanical APDL and adapt the below examples according to your needs.
|
||||
For that, please refer to the official Mechanical APDL documentation.
|
||||
|
||||
## Running Mechanical APDL jobs
|
||||
|
||||
### PModules
|
||||
|
||||
Is strongly recommended the use of the latest ANSYS software **ANSYS/2020R1-1** available in PModules.
|
||||
|
||||
```bash
|
||||
module use unstable
|
||||
module load ANSYS/2020R1-1
|
||||
```
|
||||
|
||||
### Non-interactive: sbatch
|
||||
|
||||
Running jobs with `sbatch` is always the recommended method. This makes the use of the resources more efficient. Notice that for
|
||||
running non interactive Mechanical APDL jobs one must specify the `-b` option.
|
||||
|
||||
#### Serial example
|
||||
|
||||
This example shows a very basic serial job.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
#SBATCH --job-name=MAPDL # Job Name
|
||||
#SBATCH --partition=hourly # Using 'daily' will grant higher priority than 'general'
|
||||
#SBATCH --time=0-01:00:00 # Time needed for running the job. Must match with 'partition' limits.
|
||||
#SBATCH --cpus-per-task=1 # Double if hyperthreading enabled
|
||||
#SBATCH --ntasks-per-core=1 # Double if hyperthreading enabled
|
||||
#SBATCH --hint=nomultithread # Disable Hyperthreading
|
||||
#SBATCH --error=slurm-%j.err # Define your error file
|
||||
|
||||
module use unstable
|
||||
module load ANSYS/2020R1-1
|
||||
|
||||
SOLVER_FILE=/data/user/caubet_m/MAPDL/mysolver.in
|
||||
mapdl -b -i "$SOLVER_FILE"
|
||||
```
|
||||
|
||||
One can enable hypertheading by defining `--hint=multithread`, `--cpus-per-task=2` and `--ntasks-per-core=2`.
|
||||
However, this is in general not recommended, unless one can ensure that can be beneficial.
|
||||
|
||||
#### SMP-based example
|
||||
|
||||
This example shows how to running Mechanical APDL in Shared-Memory Parallelism mode. It limits the use
|
||||
to 1 single node, but by using many cores. In the example below, we use a node by using all his cores
|
||||
and the whole memory.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
#SBATCH --job-name=MAPDL # Job Name
|
||||
#SBATCH --partition=hourly # Using 'daily' will grant higher priority than 'general'
|
||||
#SBATCH --time=0-01:00:00 # Time needed for running the job. Must match with 'partition' limits.
|
||||
#SBATCH --nodes=1 # Number of nodes
|
||||
#SBATCH --ntasks=1 # Number of tasks
|
||||
#SBATCH --cpus-per-task=44 # Double if hyperthreading enabled
|
||||
#SBATCH --hint=nomultithread # Disable Hyperthreading
|
||||
#SBATCH --error=slurm-%j.err # Define a file for standard error messages
|
||||
#SBATCH --exclusive # Uncomment if you want exclusive usage of the nodes
|
||||
|
||||
module use unstable
|
||||
module load ANSYS/2020R1-1
|
||||
|
||||
SOLVER_FILE=/data/user/caubet_m/MAPDL/mysolver.in
|
||||
mapdl -b -np ${SLURM_CPUS_PER_TASK} -i "$SOLVER_FILE"
|
||||
```
|
||||
|
||||
In the above example, one can reduce the number of **cpus per task**. Here usually `--exclusive`
|
||||
is recommended if one needs to use the whole memory.
|
||||
|
||||
For **SMP** runs, one might try the hyperthreading mode by doubling the proper settings
|
||||
(`--cpus-per-task`), in some cases it might be beneficial.
|
||||
|
||||
Please notice that `--ntasks-per-core=1` is not defined here, this is because we want to run 1
|
||||
task on many cores! As an alternative, one can explore `--ntasks-per-socket` or `--ntasks-per-node`
|
||||
for fine grained configurations.
|
||||
|
||||
#### MPI-based example
|
||||
|
||||
This example enables Distributed ANSYS for running Mechanical APDL using a Slurm batch script.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
#SBATCH --job-name=MAPDL # Job Name
|
||||
#SBATCH --partition=hourly # Using 'daily' will grant higher priority than 'general'
|
||||
#SBATCH --time=0-01:00:00 # Time needed for running the job. Must match with 'partition' limits.
|
||||
#SBATCH --nodes=1 # Number of nodes
|
||||
#SBATCH --ntasks=44 # Number of tasks
|
||||
#SBATCH --cpus-per-task=1 # Double if hyperthreading enabled
|
||||
#SBATCH --ntasks-per-core=1 # Run one task per core
|
||||
#SBATCH --hint=nomultithread # Disable Hyperthreading
|
||||
#SBATCH --error=slurm-%j.err # Define a file for standard error messages
|
||||
##SBATCH --exclusive # Uncomment if you want exclusive usage of the nodes
|
||||
|
||||
module use unstable
|
||||
module load ANSYS/2020R1-1
|
||||
|
||||
SOLVER_FILE=/data/user/caubet_m/MAPDL/mysolver.in
|
||||
mapdl -b -dis -np ${SLURM_NTASKS} -i "$SOLVER_FILE"
|
||||
```
|
||||
|
||||
In the above example, one can increase the number of *nodes* and/or *ntasks* if needed and combine it
|
||||
with `--exclusive` when necessary. In general, **no hypertheading** is recommended for MPI based jobs.
|
||||
Also, one can combine it with `--exclusive` when necessary.
|
Reference in New Issue
Block a user