August 8, 2023 at 3:27 pm
Ansys Employee
Hi Jeff,
Please consider creating the following script. (job.sh for this example)
dos2unix ./job.sh
chmod +x ./job.sh
sbatch ./job.sh
Modify lines 2-3, 12-13, and 39 as needed.
note1: the value of line 39 "numcores=xx" must match the allocated resource core count.
job.sh
#!/bin/bash
#!/bin/bash
#SBATCH -N 2 # allocate 2 nodes
#SBATCH -n 32 # 32 tasks total
#SBATCH -J AnsysEMTest # sensible name for the job
#SBATCH -p default # partition name
##SBATCH --mem 0 #allocates all the memory on the node to the job
##SBATCH --time 0
##SBATCH --mail-user="user@company.com"
##SBATCH --mail-type=ALL
# Project Name and setup
JobName=OptimTee.aedt
AnalysisSetup=""
# Project location
JobFolder=$(pwd)
#### Do not modify any items below this line unless requested ####
InstFolder=/opt/AnsysEM/v222/Linux64
#SLURM
export ANSYSEM_GENERIC_MPI_WRAPPER=${InstFolder}/schedulers/scripts/utils/slurm_srun_wrapper.sh
export ANSYSEM_COMMON_PREFIX=${InstFolder}/common
srun_cmd="srun --overcommit --export=ALL -n 1 -N 1 --cpu-bind=none --mem-per-cpu=0 --overlap "
# note: srun '--overlap' option was introduced in SLURM VERSION 20.11. If running older SLURM version, remove the '--overlap' argument.
export ANSYSEM_TASKS_PER_NODE="${SLURM_TASKS_PER_NODE}"
# Setup Batchoptions
echo "\$begin 'Config'" > ${JobFolder}/${JobName}.options
echo "'Desktop/Settings/ProjectOptions/HPCLicenseType'='Pack'" >> ${JobFolder}/${JobName}.options
echo "'HFSS/RAMLimitPercent'=90" >> ${JobFolder}/${JobName}.options
echo "'HFSS 3D Layout Design/RAMLimitPercent'=90" >> ${JobFolder}/${JobName}.options
echo "'HFSS/RemoteSpawnCommand'='scheduler'" >> ${JobFolder}/${JobName}.options
echo "'HFSS 3D Layout Design/RemoteSpawnCommand'='scheduler'" >> ${JobFolder}/${JobName}.options
# If multiple networks on execution host, specify network CIDR
# echo "'Desktop/Settings/ProjectOptions/AnsysEMPreferredSubnetAddress'='192.168.1.0/24'" >> ${JobFolder}/${JobName}.options
echo "\$end 'Config'" >> ${JobFolder}/${JobName}.options
# Submit AEDT Job (SLURM requires 'srun' and tight integration change to the slurm_srun_wrapper.sh
${srun_cmd} ${InstFolder}/ansysedt -ng -monitor -waitforlicense -useelectronicsppe=1 -distributed -machinelist numcores=32 -auto -batchoptions ${JobFolder}/${JobName}.options -batchsolve ${AnalysisSetup} ${JobFolder}/${Project} > ${JobFolder}/${JobName}.progress