Skip to content
/ OPS Public
forked from OP-DSL/OPS

OPS is an API with associated libraries and preprocessors to generate parallel executables for applications on mulit-block structured meshes.

Notifications You must be signed in to change notification settings

jpmeng/OPS

 
 

Repository files navigation

OPS

OPS is an API with associated libraries and pre-processors to generate parallel executables for applications on multi-block structured grids.

This repository contains the implementation of the run-time library and the pre-processor, and is structured as follows:

  • ops: Implementation of the user and run-time OPS C/C++ APIs

  • apps: Application examples in C. These are examples of user application code and also include the target code an OPS pre-processor should produce to correctly use the OPS run-time library. Currently the main application developed with OPS is a single block structured mesh application - Cloverleaf originally developed at https://github.com/Warwick-PCAV/CloverLeaf

  • translator: Python OPS pre-processor for C/C++ API

  • doc: Documentation

Installation

Note: The current CMakefile and relevant instructions are mainly tested on linux-based systems including Windows Subsystem for Linux

Dependencies
  • CMake

CMake 3.18 or newer is required for using the CMake building system. If the latest version is not installed/shipped by default, it can be downloaded from https://cmake.org/download/, e.g., using the following script.

version=3.19.0
wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-Linux-x86_64.sh
# Assume that CMake is going to be installed at /usr/local/cmake
cmake_dir=/usr/local/cmake
# sudo is not necessary for directories in user space.
sudo mkdir $cmake_dir
sudo sh ./cmake-$version-Linux-x86_64.sh --prefix=$cmake_dir  --skip-license
sudo ln -s $cmake_dir/bin/cmake /usr/local/bin/cmake
  • Python2

Python2 is required by the OPS Python translator. The CMake build system will try to identify it automatically. However, the process can fail sometime (e.g., if there are both Python2 and Python3 installed). If this happens, the path to Python2 can be specified manually by using -DPython2_EXECUTABLE when invoking CMake

  • HDF5

HDF5 is required for parts of IO functionalities. The CMake build system uses the parallel version by default even for sequential codes, and automatically identify the library. If the automatic process fails, the path to the parallel HDF5 library can be specified by using -DHDF5_ROOT.

  • CUDA

The CMake build system will detect the tookit automatically. If the automatic process fails, the build system will compile the library without the CUDA support. please use -DCUDA_TOOLKIT_ROOT_DIR to manually specify the path.

Build OPS back-end libraries example applications
Build the library and example applications together

Create a build directory, and run CMake (version 3.18 or newer)

mkdir build
cd build
# Please see below for CMake options
cmake ${PATH_TO_OPS} -DBUILD_OPS_APPS=ON -DOPS_TEST=ON -DAPP_INSTALL_DIR=$HOME/OPS-APP -DCMAKE_INSTALL_PREFIX=$HOME/OPS-INSTALL -DGPU_NUMBER=1
make # IEEE=1 this option is important for applications to get accurate results
make install # sudo is needed if a directory like /usr/local/ is chosen.

After installation, the library and the python translator can be found at the direcory specified by CMAKE_INSTALL_PREFIX, together with the executable files for applications at APP_INSTALL_DIR.

Build the library and example applications separately

In this mode, the library can be firstly built and installed as

  mkdir build
  cd build
  # Please see below for CMake options
  cmake ${PATH_TO_OPS}   -DCMAKE_INSTALL_PREFIX=$HOME/OPS-INSTALL
  make # IEEE=1 this option is important for applications to get accurate results
  make install # sudo is needed if a system direction is chosen,

then the application can be built as

  mkdir appbuild
  cd appbuild
  # Please see below for CMake options
  cmake ${PATH_TO_APPS} -DOPS_INSTALL_DIR=$HOME/OPS-INSTALL -DOPS_TEST=ON -DAPP_INSTALL_DIR=$HOME/OPS-APP -DGPU_NUMBER=1
  make # IEEE=1 this option is important for applications to get accurate results
Tests

A few tasks for testing codes can be run by

  make test

The current tests are mainly based on the applications.

Options of interest to specify to cmake include:
  • -DCMAKE_BUILD_TYPE=Release - enable optimizations
  • -DBUILD_OPS_APPS=ON - build example applications (Library CMake only)
  • -DOPS_TEST=ON - enable the tests
  • -DCMAKE_INSTALL_PREFIX= - specify the installation direction for the library (/usr/local by default, Library CMake only)
  • -DAPP_INSTALL_DIR= - specify the installation direction for the applications ($HOME/OPS-APPS by default)
  • -DGPU_NUMBER= - specify the number of GPUs used in the tests
  • -DOPS_INSTALL_DIR= - specify where the OPS library is installed (Application CMake only, see here)
  • -DOPS_VERBOSE_WARNING=ON - show verbose output during building process

About

OPS is an API with associated libraries and preprocessors to generate parallel executables for applications on mulit-block structured meshes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 71.3%
  • Cuda 13.6%
  • C 10.7%
  • Fortran 1.9%
  • Python 1.3%
  • Shell 0.6%
  • Other 0.6%