Ansys: Difference between revisions

2,142 bytes removed ,  8 months ago
m
no edit summary
mNo edit summary
mNo edit summary
Line 151: Line 151:
<!--T:4733-->
<!--T:4733-->
rm -f cleanup* core*
rm -f cleanup* core*
<!--T:2304-->
#module load StdEnv/2016      # Applies to cedar, beluga, graham
#module load ansys/2020R2    # or older module versions


<!--T:2305-->
<!--T:2305-->
Line 204: Line 200:
<!--T:4736-->
<!--T:4736-->
rm -f cleanup* core*
rm -f cleanup* core*
<!--T:2204-->
#module load StdEnv/2016      # Applies to cedar, beluga, graham
#module load ansys/2020R2    # or older module versions


<!--T:2205-->
<!--T:2205-->
Line 265: Line 257:
<!--T:4739-->
<!--T:4739-->
rm -f cleanup* core*
rm -f cleanup* core*
<!--T:2404-->
#module load StdEnv/2016      # Applies to cedar, beluga, graham
#module load ansys/2020R2    # or older module versions


<!--T:2405-->
<!--T:2405-->
Line 330: Line 318:
<!--T:4742-->
<!--T:4742-->
rm -f cleanup* core*
rm -f cleanup* core*
<!--T:2904-->
#module load StdEnv/2016      # Applies to cedar, beluga, graham
#module load ansys/2020R2    # or older module versions


<!--T:2905-->
<!--T:2905-->
Line 402: Line 386:
<!--T:3403-->
<!--T:3403-->
rm -f cleanup* core*
rm -f cleanup* core*
<!--T:3404-->
#module load StdEnv/2016      # Applies to cedar, beluga, graham
#module load ansys/2020R2    # or older module versions


<!--T:3405-->
<!--T:3405-->
Line 481: Line 461:
<!--T:4747-->
<!--T:4747-->
rm -f cleanup* core*
rm -f cleanup* core*
<!--T:3904-->
#module load StdEnv/2016      # Applies to cedar, beluga, graham
#module load ansys/2020R2    # or older module versions


<!--T:3905-->
<!--T:3905-->
Line 794: Line 770:


<!--T:2845-->
<!--T:2845-->
To avoid writing the solution when a running job successfully completes \remove <code>;Save(Overwrite=True)</code> from the last line of your script.  Doing this will make it easier to run multiple test jobs (for scaling purposes when changing ntasks), since the initialized solution will not be overwritten each time.  Alternatively, keep a copy of the initialized YOURPROJECT.wbpj file and YOURPROJECT_files subdirectory and restore them after the solution is written.  For APDL-based simulations submitted under the legacy StdEnv/2016 environment, nodes=1 may be either removed from the script or changed to be greater than 1 to permit computations across multiple nodes.
To avoid writing the solution when a running job successfully completes \remove <code>;Save(Overwrite=True)</code> from the last line of your script.  Doing this will make it easier to run multiple test jobs (for scaling purposes when changing ntasks), since the initialized solution will not be overwritten each time.  Alternatively, keep a copy of the initialized YOURPROJECT.wbpj file and YOURPROJECT_files subdirectory and restore them after the solution is written.


=== Slurm scripts === <!--T:2814-->
=== Slurm scripts === <!--T:2814-->
Line 841: Line 817:


<!--T:2835-->
<!--T:2835-->
runwb2 -B -E "Update();Save(Overwrite=True)" -F YOURPROJECT.wbpj
}}
</tab>
<tab name="Single node (StdEnv/2016)">
{{File
|name=script-wbpj-2016.sh
|lang="bash"
|contents=
#!/bin/bash
<!--T:2806-->
#SBATCH --account=def-account
#SBATCH --time=00-03:00                # Time (DD-HH:MM)
#SBATCH --mem=16G                      # Total Memory (set to 0 for all node memory)
#SBATCH --ntasks=4                    # Number of cores
#SBATCH --nodes=1                      # Do not change
<!--T:2807-->
module load StdEnv/2016 ansys/2019R3  # Do not change
<!--T:2808-->
MEMPAR=1                              # Do not change
<!--T:2850-->
rm -fv *_files/.lock
MWFILE=~/.mw/Application\ Data/Ansys/`basename $(find $EBROOTANSYS/v* -maxdepth 0 -type d)`/SolveHandlers.xml
sed -re "s/(.AnsysSolution>+)[a-zA-Z0-9]*(<\/Distribute.)/\1$MEMPAR\2/" -i "$MWFILE"
sed -re "s/(.Processors>+)[a-zA-Z0-9]*(<\/MaxNumber.)/\1$((SLURM_NTASKS-1))\2/" -i "$MWFILE"
<!--T:2924-->
export KMP_AFFINITY=balanced
export I_MPI_HYDRA_BOOTSTRAP=ssh
export PATH=/cvmfs/soft.computecanada.ca/nix/var/nix/profiles/16.09/bin:$PATH
<!--T:2838-->
runwb2 -B -E "Update();Save(Overwrite=True)" -F YOURPROJECT.wbpj
runwb2 -B -E "Update();Save(Overwrite=True)" -F YOURPROJECT.wbpj
}}
}}
cc_staff
1,863

edits