6

Next: Model setting without an Up: Alternative formulation Previous: Alternative formulation   Contents   Index

Running Simulation - Parallel Run - Start Simulation

To start simulation in parallel type the following command:

# mpirun -np 4 blueSolver -parallel > log $&$

For effective computing one can use bash script e.g. Allrun.sh:

 

#!/bin/bash

# number of CPUs to run on
numProcs=6

# check environment
if [[ $(echo $WM_PROJECT_VERSION |  cut -c1-3) != "2.3" ]]; then
    echo "You need OpenFOAM 2.3 to run the case."
    exit 0
fi

echo

sed -i "s/\(.*numberOfSubdomains[ \t]*\)[0-9].*;/numberOfSubdomains $numProcs;/g" system/decomposeParDict


# setup the initial conditions
rm -rf 0
cp -R 0.org 0

# decompose
rm -rf processor* postProcessing*
echo "1. Parallel decomposition."
for region in spiral stay rotor drafttube guide; do
    decomposePar -region $region | tee -a log > log.decomposePar-$region  2>&1 
done

bash tasksetScript &

# run the solver
echo "2. Computing (blueSolver)"
mpirun -np ${numProcs} blueSolver -parallel | tee -a log > log.blueSolver  2>&1 

# reconstruct the latest time
echo "3. Parallel reconstruction"
for region in spiral stay rotor drafttube guide; do
    reconstructPar -region $region -latestTime | tee -a log > log.reconstructPar-$region  2>&1 
done

echo