Skip to content

Commit 017188c

Browse files
authored
updated launch script for Optistruct 2024.1
1 parent 2adbe5f commit 017188c

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
#SBATCH --exclusive
3+
#SBATCH -t 99:00:00
4+
#SBATCH --nodes=2
5+
#SBATCH --ntasks=128
6+
#SBATCH --constraint=hpc6id.32xlarge
7+
#SBATCH --partition=hpc6id
8+
9+
10+
export I_MPI_OFI_LIBRARY_INTERNAL=0
11+
#module load intelmpi
12+
export I_MPI_FABRICS=shm:ofi
13+
export I_MPI_OFI_PROVIDER=efa
14+
export FI_EFA_FORK_SAFE=1
15+
#export I_MPI_MULTIRAIL=1
16+
module load libfabric-aws
17+
export I_MPI_DEBUG=5
18+
19+
OPTISTRUCT_VER="2024.1"
20+
INPUT_FILE=${2:-"/path/to/Engine_Assy.fem"}
21+
export ALTAIR_HOME="/fsx/Altair"
22+
export RADFLEX_PATH="${ALTAIR_HOME}/${OPTISTRUCT_VER}/altair/hwsolvers/common/bin/linux64"
23+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${RADFLEX_PATH}
24+
25+
export TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
26+
instanceType=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-type)
27+
28+
export ALM_HHWU=T
29+
export ALM_HHWU_TOKEN=$(aws secretsmanager get-secret-value --secret-id arn:xxx --query SecretString --output text --region xxx)
30+
export ALM_HHWU_USE_WININET=1
31+
32+
basedir="/fsx/${SLURM_JOB_NAME%.*}"
33+
INPUT_DIR="${basedir}/Model"
34+
export workdir="${basedir}/Run/${INPUT_FILE%.*}/${SLURM_JOB_ID}-${SLURM_JOB_NUM_NODES}x${instanceType}-${SLURM_NPROCS}-$(date '+%d-%m-%Y-%H-%M')"
35+
36+
export NTHREADS=${1:-"8"}
37+
export MPI_PROC=$((SLURM_NPROCS / NTHREADS))
38+
39+
mkdir -p "${workdir}" && cd "${workdir}"
40+
41+
cp $0 .
42+
ln -s ${INPUT_DIR}/* .
43+
44+
## USE INTERNAL NVME DISK ONLY IF IT EXISTS, OTHERWISE USE THE SHARED DIR (FSx)
45+
SCRATCH_BASE=$(mount | grep ephemeral | awk '{print $3}')
46+
if [[ $? != 0 ]]; then
47+
echo "Scratch failed."
48+
exit 1
49+
elif [[ $SCRATCH_BASE ]]; then
50+
export SCRATCH_DIR="${SCRATCH_BASE}/scratch-$SLURM_JOB_ID"
51+
mkdir -p "${SCRATCH_DIR}"
52+
export TMPDIR="${SCRATCH_DIR}"
53+
else
54+
export SCRATCH_DIR="${workdir}/scratch/scratch-$SLURM_JOB_ID"
55+
mkdir -p "${SCRATCH_DIR}"
56+
export TMPDIR="${SCRATCH_DIR}"
57+
fi
58+
59+
scontrol show nodes $SLURM_NODELIST | grep NodeHostName= | awk '{print $2}' | sed 's/NodeHostName=//' >hostfile
60+
61+
mpirun -n $SLURM_JOB_NUM_NODES --map-by ppr:1:node /bin/bash -c "sync && echo 3 | sudo tee /proc/sys/vm/drop_caches"
62+
mpirun -n $SLURM_JOB_NUM_NODES --map-by ppr:1:node /bin/bash -c "echo always | sudo tee /sys/kernel/mm/transparent_hugepage/enabled"
63+
64+
"${ALTAIR_HOME}/${OPTISTRUCT_VER}/altair/scripts/optistruct" ${INPUT_FILE} -mpipath /opt/intel/mpi/2021.13/bin -mpi i -ddm -np $MPI_PROC -nt ${NTHREADS} -hostfile hostfile -core in -tmpdir "${SCRATCH_DIR}" -out -outfile output.txt

0 commit comments

Comments
 (0)