Skip to content

MCFC OP2 Fluidity tool chain

kynan edited this page Jun 1, 2012 · 7 revisions

This page gives a rough overview of how to run OP2 Fluidity tests.

Building

Prerequisites

MCFC

Nothing to build, we'll use the generated code from tests/expected/op2

OP2-Common

On a recent Ubuntu system cd op2/c && ./cmake.local should "just work". Since currently only the OP2 sequential and CUDA backends are supported, only these are built, the MPI, OpenMP and HDF5 backends are disabled. For more detailed build instructions, refer to op2/c/README.

OP2_ROSE_Fortran

  1. Build the bundled version of the ROSE compiler: make sure the Boost libraries and libjvm are in your LD_LIBRARY_PATH and cd ROSE && python build.py -b. For more detailed build instructions, refer to ROSE/README.
  2. Build the OP2 source-to-source translator (translator subdirectory): Set ROSE_HOME to the base directory of your ROSE installation (normally ../ROSE/rose-0.9.5a-15165_inst) and BOOST_HOME to the base directory of your Boost installtion. Then run scons. For more detailed build instructions, refer to translator/README.

Fluidity

The following environment variables need to be set:

  • IMPERIAL_TRANSLATOR_HOME to the base directory of the OP2_ROSE_Fortran checkout
  • OP2_DIR to the op2 subdirectory of the OP2-Common checkout
  • MCFC_DIR to the base directory of the MCFC checkout
  • CUDA_TOOLKIT_DIR to the base directory of the CUDA toolkit (if other than /usr/local/cuda)
  • LD_LIBRARY_PATH to contain the paths to the Boost libraries, libjvm.so, librose.so and the OP2 libraries (normally the op2/c/lib subdirectory of the OP2-Common checkout)

Configure and build using the following script (save as build.sh and call with ./build.sh -c to configure and build and ./build.sh to build without configuring):

if [[ $1 == '-c' ]]; then
  ./configure --enable-debugging --with-op2=${OP2_DIR} --enable-shared
  make clean
fi
make -j4 && \\
make -j4 libfemtools && \\
make -j4 fluidity_library && \\
make -C op2

Running tests

The following OP2 tests are available (subdirectories of tests):

  • op2_advection
  • op2_advection_diffusion
  • op2_diffusion
  • op2_helmholtz_mms
  • op2_identity
  • op2_noop

op2_common contains resources shared among all the tests.

Automatic via test harness

Run tools/testharness.py -f <test>.xml, where <test> is the name of the test you want to run (test names follow folder names).

By hand

  1. Navigate to the test folder
  2. Run make clean (optional)
  3. Run make input or make input SCALE=<float> with <float> a scaling factor if you want to run on a larger/smaller mesh. Note: For tests using cdisk scale < 1 means a larger mesh, whereas for tests using unitsquare scale > 1 means a larger mesh. MMS tests produce 4 meshes and input files (MMS_A is the coarsest and MMS_D the finest).
  4. Run the test as ../../bin/op2_<bin> <test>.flml, where op2_<bin> is the OP2 test binary and <test>.flml the generated input file.
  5. Evaluate the .stat or .vtu files the test run produced