Rate This Document
Findability
Accuracy
Completeness
Readability

Running and Verification

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Go to the test directory.
    cd /path/to/OpenFOAM/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike
  3. Set the grid precision as required.
    sed -ri "s/\(20 8 8\)/\(2048 512 64\)/" ./system/blockMeshDict

    You are advised to increase the grid precision when multiple nodes are running.

  4. Set the number of running CPU cores.
    sed -ri "s/8/256/" system/{decomposeParDict,decomposeParDict.hierarchical,decomposeParDict.ptscotch}
    sed -ri "s/\(4 2 1\)/\(16 4 4\)/" system/{decomposeParDict,decomposeParDict.hierarchical,decomposeParDict.ptscotch}

    In this example, two nodes are configured and the number of CPU cores is 256 (16 x 4 x 4 = 256). You can change it based on your requirements.

  5. Start the running.
    • Single node
      ./Allrun

      The following figure shows the running result when a single node uses 6 CPU cores. The results of other configurations are similar.

      If you start the running as the root user, modify the RunFunctions file (refer to the steps for the multiple-node running). Add --allow-run-as-root to the end of the mpirun command.

    • Dual nodes
      1. Create a hostfile file.
        vi hostfile
      2. Press i to enter the insert mode.
        Node1
        Node2

        Node1 and Node2 are the names of the nodes where the code is executed. Change them based on your requirements and ensure that the nodes can ping each other. Enable SSH password-free login between the nodes.

      3. Press Esc, type :wq!, and press Enter to save the file and exit.
      4. Modify the RunFunctions file.
        vi  /path/to/OPENFOAM/bin/tools/RunFunctions
      5. Press i to enter the insert mode and modify the file as follows:
        $mpirun -x PATH=$PATH –x LD_LIBRARY_PATH=$LD_LIBRARY_PATH -x WM_PROJECT_DIR=$WM_PROJECT -n $nProcs $appRun $appArgs "$@" </dev/null >> $logFile 2>&1

        So far, the configuration required for multi-node running is complete.

      6. Press Esc, type :wq!, and press Enter to save the file and exit.
      7. Start the running.
        ./Allrun
  6. After the computing is complete and the software exits, a computing log file is generated. Run the vi log.simpleFoam command to open the log.simpleFoam file. Check the value of ExecutionTime (unit: second) in the log.simpleFoam file. A smaller value indicates better performance.