Schnek is a new library for C++ that makes it easy to develop large parallel simulation codes. The library is intended mainly for use in physics simulations on regular grids but some of its features might be useful for other types of simulation codes.

When writing a new simulation code from scratch one is confronted with a choice. One can either keep the code simple and focus on the physics and the numerical side. For this kind of code, most time is spent on actually developing the interesting stuff. The downside of this type of code is that is not much use to anybody else except the developer of the code herself and maybe the immediate collaborators in a research group.

The other option is to develop a code that might be useful for others, that can be configured using a configuration file and that is written to be versatile and adaptable to problems other than the one it was initially developed for. The code should be easy to use by others and hopefully should also be extendible by others. Writing this type of code requires a lot of time and effort. Only very few projects get to a stage where this investment of time and work is worthwhile.

In addition, if the code handles large amounts of data and should be able to run on multi-processor clusters then additional code has to be written. For simulations on regular grids this means that one has to use multi-dimensional arrays, define boundary values, synchronise grid values across multiple processes and write data into files that can be used by other software.

Schnek provides a single library that aids in all these tasks and thus massively reduces the code that needs to be written by the developer.

Features of Schnek are

  • setup file reader with C style syntax
  • extendable for formulas in setup files
  • hierarchical structure of simulation components
  • mutli-dimensional grids
  • initialisation of grid from formulas in setup file
  • boundary cells and ghost cells
  • MPI support for parallelisation
  • MPI update of ghost cells to neighbouring processes
  • easy to use parallel and serial HDF5 output of grids
  • literature reference system to encourage collaborative development of large codes

Schnek is hosted on GitHub and you can find the project page here.

Schnek is currently in beta phase. If you want to test Schnek please download the code and play around with it. If you are feeling adventurous you can also check out the latest version from the GitHub repository.

The documentation can be found here. It is currently in progress and will take some time to complete.