Commit b7660a59 authored by Mark Meredith's avatar Mark Meredith
Browse files

Merge branch 'mwm/basics' into 'master'

Writer parser for mfix-exa inputs file format

See merge request exa/mfix-parser!1
parents e2a7604f 078342cd
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+1 −0
Original line number Diff line number Diff line
build
 No newline at end of file

.gitlab-ci.yml

0 → 100644
+20 −0
Original line number Diff line number Diff line
image: mwm126/mfix-exa:cuda

variables:
  GIT_STRATEGY: fetch
  GIT_SUBMODULE_STRATEGY: normal

###### Test jobs #####

test:all:
  script:
    - cmake -S .
            -B build
            -G Ninja
    - cmake --build build --target unit_tests
    - ./build/src/tests/unit_tests
    - cmake --build build --target mfix-parser
    - find -name inputs
    - find -name inputs |xargs -l ./build/mfix-parser
  tags:
    - mfix-exa

.gitmodules

0 → 100644
+9 −0
Original line number Diff line number Diff line
[submodule "PEGTL"]
	path = subprojects/PEGTL
	url = https://github.com/taocpp/PEGTL
[submodule "mfix/subprojects/mfix"]
	path = subprojects/mfix
	url = ../mfix
[submodule "subprojects/Catch2"]
	path = subprojects/Catch2
	url = https://github.com/catchorg/Catch2

CMakeLists.txt

0 → 100644
+24 −0
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.14)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

project(MFIX-Parser
   DESCRIPTION  "A parser for MFIX-Exa input files"
   HOMEPAGE_URL "https://mfix.netl.doe.gov/gitlab/exa/mfix-parser"
   LANGUAGES    CXX
   )

set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
set(USE_CCACHE "")
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
  set( CMAKE_CXX_COMPILER_LAUNCHER ccache )
endif()

add_subdirectory(src)

set(EXENAME "mfix-parser")
add_executable(${EXENAME} src/main.cpp)
target_link_libraries(${EXENAME} parser)
+24 −1
Original line number Diff line number Diff line
# mfix-parser

Repo for parsing and validating MFIX input(s) files for use by mfix-app
 No newline at end of file
Repo for parsing and validating MFIX input(s) files for use by mfix-app.

Uses PEGTL for parsing and Catch2 for tests.

This has the MFIX-Exa repo as a submodule in order to test against existing ``inputs`` files.


## Build

> python3 pip install cmake # if CMake not installed
> cmake -S. -Bbuild
> cmake --build build
> cd build
> ctest

## Run Tests

> cmake --build build --target unit_tests
> ./build/src/tests/unit_tests

## Run on inputs file

> cmake --build build --target mfix-parser
> ./build/mfix-parser subprojects/mfix/benchmarks/01-HCS/Size0001/inputs && echo "Parsing succeeded."
Loading