Elmer

Elmer是用于偏微分方程数值解的有限元软件。Elmer能够处理任何数量的方程式,因此非常适合模拟多物理场问题。它包括例如结构力学,流体动力学,传热和电磁学的模型。用户还可以编写自己的方程式,这些方程式可以与主程序动态链接。

关于Elmer的更多信息请访问Elmer官网

一、作业提交参数说明

用户可通过公共模板提交Elmer作业,与Elmer相关的作业参数如下:

参数 描述
elmer file 实例的运行文件
elmer grid cmd 网格处理命令
depend file 实例运行的相关依赖参数文件

二、Elmer作业运行参考

1.elmer.slurm

#!/bin/bash
#SBATCH --job-name=elmer
#SBATCH --partition=dell_intel
#SBATCH --output=%j.out
#SBATCH --error=%j.err
#SBATCH -N 3
#SBATCH --ntasks-per-node=2
ulimit -s unlimited
ulimit -l unlimited


# 导入运行环境
module purge
module use /opt/ohpc/pub/modulefiles
source /opt/ohpc/pub/apps/intel/setvars.sh
module load gnu8/8.3.0
module load intel/mpi-2021.1.1
module load elmer/8.4
# 生成 machinefile
#srun hostname -s | sort -n > lammps.slurm.hosts
#export OMP_NUM_THREADS=20
#export I_MPI_OFI_PROVIDER=mlx
#export FI_PROVIDER=verbs
export I_MPI_OFI_PROVIDER=Verbs
export FI_VERBS_IFACE=team1.282
cd /home/wushiming/elmer/ThermalActuator
#网格处理
ElmerGrid 4 2 ExportMesh -order 1.0 0.1 0.001 -o thermal -metis 6
#执行分析
mpirun -genv I_MPI_FABRICS ofi ElmerSolver thermal_actuator.sif

2.input文件

job_name=elmer
run_time=24:00:00
partition=dell_intel
node_num=3
task_per_node=2
tmp_dir=/home/wushiming/elmer/ThermalActuator
elmer_file=thermal_actuator.sif
elmer_grid_cmd='4 2 ExportMesh -order 1.0 0.1 0.001 -o thermal -metis 6'
depend_file=(ExportMesh.boundary ExportMesh.elem ExportMesh.header ExportMesh.node SOLVER.KEYWORDS)
#work_dir=/home/wushiming/elmer/ThermalActuator

3.执行脚本

#!/bin/sh
source /home/wushiming/elmer/elmer_input
##check input var
time=`date +%m%d_%H%M%S`


if [ "x$job_name" == "x" ];then
sbatch_job_name="YHPC_$time "
else
sbatch_job_name=$job_name
fi
if [ "x$partition" == "x" ];then
sbatch_partition=""
else
sbatch_partition=$partition
fi
if [ "x$work_dir" == "x" ];then
mkdir -p /home/yhpc/YHPC_$time
sbatch_work_dir=/home/yhpc/YHPC_$time
else
sbatch_work_dir=$work_dir
fi
if [ "x$run_time" == "x" ];then
sbatch_run_time=03:00:00
else
sbatch_run_time=$run_time
fi
if [ "x$elmer_file" == "x" ];then
echo "The analysis_file cannot be empty."
exit 1
else
sbatch_elmer_file=$elmer_file
cp $tmp_dir/$elmer_file $sbatch_work_dir
fi
if [ "x$depend_file" == "x" ];then
continue
else
for i in ${depend_file[*]};do cp $tmp_dir/$i $sbatch_work_dir;done
fi
sbatch_node_num=$node_num
sbatch_task_per_node=$task_per_node
sbatch_err_log=$sbatch_work_dir/%j.err
sbatch_out_log=$sbatch_work_dir/%j.out
### Write basic job infomations
#echo -e "The start time is: `date +"%Y-%m-%d %H:%M:%S"` \n"
#echo -e "My job ID is: $SLURM_JOB_ID \n"
#echo -e "The total cores is: $total_cores \n"
#echo -e "The hosts is: \n"
#srun -np $node_num -nnp 1 hostname
cat > $sbatch_work_dir/elmer.slurm <<EOF
#!/bin/bash
#SBATCH --ntasks-per-node=$sbatch_task_per_node
#SBATCH --job-name $sbatch_job_name
#SBATCH --nodes=$sbatch_node_num
#SBATCH --mail-type=ALL
#SBATCH --partition $sbatch_partition
#SBATCH --chdir=$sbatch_work_dir
#SBATCH -e $sbatch_err_log
#SBATCH -o $sbatch_out_log
ulimit -s unlimited
ulimit -l unlimited
# 导入运行环境
module purge
module use /opt/ohpc/pub/modulefiles
source /opt/ohpc/pub/apps/intel/setvars.sh
module load intel/mpi-2021.1.1
module load gnu8/8.3.0
module load elmer/8.4
export I_MPI_OFI_PROVIDER=Verbs
export FI_VERBS_IFACE=team1.282
echo -e "The start time is: `date +"%Y-%m-%d %H:%M:%S"`"
echo -e "My job ID is: SLURM_JOB_ID"
echo -e "The total cores is: SLURM_NPROCS"
echo -e "The SLURM_JOB_ID Job info:"
scontrol show job SLURM_JOB_ID
cd $sbatch_work_dir
ElmerGrid $elmer_grid_cmd
mpirun -genv I_MPI_FABRICS ofi ElmerSolver thermal_actuator.sif
echo -e "The end time is: `date +"%Y-%m-%d %H:%M:%S"` \n"
EOF
sed -i 's/SLURM*/\$SLURM/g' $sbatch_work_dir/elmer.slurm
/usr/bin/sbatch $sbatch_work_dir/elmer.slurm

results matching ""

    No results matching ""