1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OCI - HPC Cluster: OpenFOAM v2312 のインストール

Last updated at Posted at 2024-03-09

本ページは OCI: HPC Cluster のサブページになります。

本手順の前提

  • HPC Clusterで構成された環境でのインストールを想定しています
  • OpenFOAMのコンパイルはヘッドノードで実施します
  • コンパイルには時間が掛かるので必要に応じてコア数を増やしてください(8core前後を推奨)

環境

  • HPC Cluster ver: v2.10.4.1
  • OS Image: HPC_OL8 (OracleLinux-8-OCA-RHCK-OFED-5.8-3.0.7.0-2024.01.02-1)
  • kernel: 4.18.0-477.27.1.el8_8.x86_64
  • shape: VM.Optimized3.Flex (8core, 16GB Memory)
  • インストール先: FSS

ドキュメント

doc/Build.md·master·Development/openfoam·GitLab

インストール

Requirement

Minimum recommended versions

  • gcc : 7.5.0 (minimum, not necessarily recommended)
  • cmake: 3.8 (required for ParaView and CGAL build)
  • boost: 1.48 (required for CGAL build and some functionality)
  • fftw: 3.3.7 (recommended - required for FFT-related functionality)
  • paraview: 5.6.3 (for visualization)

Additional utilities

  • flex : not 2.6.2, 2.6.3 (fails for building scotch)
  • m4 : no known minimum level
  • QT : 5.9 (optional - for ParaView build)

追加が必要なパッケージをインストール

sudo yum --enablerepo=ol8_appstream,ol8_developer_EPEL install -y cmake boost boost-devel fftw qt5-qtbase qt5-qtbase-devel

コンパイルの準備

ここからの作業はrootユーザーでの実行になるので、以下でrootなります。

sudo su -

ソースのダウンロード

本環境では /mnt/nfs配下がNFS領域であるためそこにインストールします。

mkdir -p /mnt/nfs/share/OpenFOAM
cd /mnt/nfs/share/OpenFOAM
wget https://dl.openfoam.com/source/v2312/OpenFOAM-v2312.tgz
wget https://dl.openfoam.com/source/v2312/ThirdParty-v2312.tgz

tar xf OpenFOAM-v2312.tgz
tar xf ThirdParty-v2312.tgz

MPI を読み込む

OSイメージのverによっては4.1.5a1の部分が変わりますのでご注意ください。

source /usr/mpi/gcc/openmpi-4.1.5a1/bin/mpivars.sh

OpenMPI の環境変数を読み込む

source OpenFOAM-v2312/etc/bashrc

チェック

foamSystemCheck
  • 実行結果

    # foamSystemCheck
    
    Checking basic system...
    -------------------------------------------------------------------------------
    Shell:       bash
    Host:        bastion
    OS:          Linux version 4.18.0-477.27.1.el8_8.x86_64
    
    System check: PASS
    ==================
    Can continue to OpenFOAM installation.
    

コンパイル

foam
export LC_ALL=C
./Allwmake -j -s -q -l

CPUとコア数によりますが、大体8コアで1時間ぐらいを目安かと思います。

  • 結果

    2024-02-01 07:52:56 +0000
    ========================================
    Finished compile of visualization with OpenFOAM-v2312
      Gcc system compiler
      linux64GccDPInt32Opt, with SYSTEMOPENMPI sys-openmpi
    
    2024-02-01 07:52:56 +0000
    ========================================
      OpenFOAM-v2312
      Gcc system compiler
      linux64GccDPInt32Opt, with SYSTEMOPENMPI sys-openmpi
    
      api = 2312
      patch = 0
      bin = 314 entries
      lib = 151 entries
    
    ========================================
    Done logging to 'log.linux64GccDPInt32Opt'
    

コンパイル結果の確認

foamInstallationTest
  • 結果

    # foamInstallationTest
    Executing foamInstallationTest
    
    Basic setup :
    -------------------------------------------------------------------------------
    OpenFOAM:            OpenFOAM-v2312
    ThirdParty:          ThirdParty-v2312
    Shell:               bash
    Host:                bastion
    OS:                  Linux version 4.18.0-477.27.1.el8_8.x86_64
    -------------------------------------------------------------------------------
    
    Main OpenFOAM env variables :
    -------------------------------------------------------------------------------
    Environment           FileOrDirectory                          Valid      Crit
    -------------------------------------------------------------------------------
    $WM_PROJECT_USER_DIR  /home/opc/OpenFOAM/opc-v2312              no        no
    $WM_THIRD_PARTY_DIR   /mnt/nfs/share/OpenFOAM/ThirdParty-v2312  yes       maybe
    $WM_PROJECT_SITE      [env variable unset]                                no
    -------------------------------------------------------------------------------
    
    OpenFOAM env variables in PATH :
    -------------------------------------------------------------------------------
    Environment           FileOrDirectory                          Valid Path Crit
    -------------------------------------------------------------------------------
    $WM_PROJECT_DIR       /mnt/nfs/share/OpenFOAM/OpenFOAM-v2312    yes  yes  yes
    
    $FOAM_APPBIN          ...12/platforms/linux64GccDPInt32Opt/bin  yes  yes  yes
    $FOAM_SITE_APPBIN     ...12/platforms/linux64GccDPInt32Opt/bin  no        no
    $FOAM_USER_APPBIN     ...12/platforms/linux64GccDPInt32Opt/bin  no        no
    $WM_DIR               ...s/share/OpenFOAM/OpenFOAM-v2312/wmake  yes  yes  often
    -------------------------------------------------------------------------------
    
    OpenFOAM env variables in LD_LIBRARY_PATH :
    -------------------------------------------------------------------------------
    Environment           FileOrDirectory                          Valid Path Crit
    -------------------------------------------------------------------------------
    $FOAM_LIBBIN          ...12/platforms/linux64GccDPInt32Opt/lib  yes  yes  yes
    $FOAM_SITE_LIBBIN     ...12/platforms/linux64GccDPInt32Opt/lib  no        no
    $FOAM_USER_LIBBIN     ...12/platforms/linux64GccDPInt32Opt/lib  no        no
    $FOAM_EXT_LIBBIN      ...v2312/platforms/linux64GccDPInt32/lib  yes  yes  maybe
    $MPI_ARCH_PATH        /usr/mpi/gcc/openmpi-4.1.5a1              yes   no  yes
    -------------------------------------------------------------------------------
    
    Software Components
    -------------------------------------------------------------------------------
    Software     Version    Location
    -------------------------------------------------------------------------------
    flex         2.6.1      /usr/bin/flex
    make         4.2.1      /usr/bin/make
    wmake        2312       /mnt/nfs/share/OpenFOAM/OpenFOAM-v2312/wmake/wmake
    gcc          8.5.0      /usr/bin/gcc
    g++          8.5.0      /usr/bin/g++
    -------------------------------------------------------------------------------
    icoFoam      exists     ...OAM-v2312/platforms/linux64GccDPInt32Opt/bin/icoFoam
    
    Summary
    -------------------------------------------------------------------------------
    Base configuration ok.
    Critical systems ok.
    
    Done
    

動作確認

動作確認として1ノードで計算が流れることを確認します。
ここではジョブスクリプトではなく、srunでインタラクティブに操作をしていきます。
※--constraintや実行するpartitionについては適宜変更してください

srun --nodes=1 -n 36  --constraint=hpc-default --pty /usr/bin/bash -i
source /usr/mpi/gcc/openmpi-4.1.5a1/bin/mpivars.sh
source /mnt/nfs/share/OpenFOAM/OpenFOAM-v2312/etc/bashrc
cd /mnt/nfs/share/OpenFOAM/OpenFOAM-v2312/tutorials/incompressible/simpleFoam/motorBike

BM.Optimized3.36で動作させる上で以下の必須オプションを設定します。

export UCX_NET_DEVICES=mlx5_2:1
export UCX_IB_TRAFFIC_CLASS=105
export UCX_IB_GID_INDEX=3
export HCOLL_ENABLE_MCAST_ALL=0
export OMPI_MCA_pml=ucx
export OMPI_MCA_coll_hcoll_enable=0
export OMPI_MCA_hwloc_base_report_bindings=1
./Allrun

出力された各種ログファイルを確認して正常に計算が行われたことを確認してください。

以上

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?