Skip to content

nonlocalmodels/nonlocalheatequation

Repository files navigation

Nonlocal Heat Equation CircleCI Codacy Badge Coverage Status

Documentation : master

Docker image : master image

About

This repository implements a distributed non-local heat equation solver using HPX as a part of work done in Google Summer of Code 2020. This code is mostly used to experiment with new HPX features or add new features to the non-local models. The code also implements Domain decomposition and Load balancing for rectangle domains. The latest documentation and a Docker image with the latest stable version are available as well.

Project Summary

Recently various nonlocal models have been applied for understanding of complex spatially multiscale phenomena like solid mechanics, fluid mechanics, particulate media, directed self-assembly of Block-Copolymer, etc. Nonlocal models have dependence of a single point on a small set of near neighboring points, which hints for data-level parallelism. We utilize a modern parallelization library, HPX, to develop the parallel solver. The goal of the proposed solution is to achieve full distribution of workload starting from mesh partition to computation of fields at mesh nodes. The following goal is achieved step by step, starting from a simple sequential implementation of 1D nonlocal diffusion. Ideas of 1D nonlocal serial equation are extended to 2D nonlocal serial implementation. The 2D nonlocal diffusion equation is made multi-threaded to enable concurrent processing within a single node in the 2D nonlocal asynchronous implementation. The 2D nonlocal diffusion equation is then made completely distributed to exploit data level parallelism in 2D nonlocal distributed implementation. The 2D nonlocal distributed implementation also implements Load balancing algorithm. Domain decomposition for the rectangle domain is implemented as a seperate tool.

Folder information

  • data contains sample mesh data used to test the Domain Decomposition tool.
  • description contains the latex code for building the project description.
  • docs contains the Cmake file for building the documentation.
  • include contains various header files used in the nonlocal heat equation implementation
  • src contains the source files for implementation ranging from serial 1d equation to fully distributed 2d nonlocal heat equation.
  • tests contains the test files used to test the correctness of various implementations of the nonlocal heat equation implementation and testing the Load Balancing algorithms.

Source files information

Dependencies and version

Following versions have been used and verified to be supported by the code:

  • CMake version : 3.10 or beyond
  • VTK version : 8.2.0
  • GMSH version : 4.7.0
  • METIS version : 5.1.0
  • HPX version : 1.4.1

Building and Installation

mkdir build
cd build 
cmake .. -DCMAKE_PREFIX_PATH= /path/to/hpx/installation
make all

Running tests

make test

Quick Start

Domain decomposition Tool

./2d_domain_decomposition ../data/400x400.msh data_4.txt 4

Distributed 2d nonlocal equation

srun -n 4 -c 1 -N 4 ./2d_nonlocal_distributed --file data_4.txt --dt 0.00001 --nt 20 --eps 8 --nx 20 --ny 20 --npx 20 --npy 20 --dh 0.0025

Test Load balancing

srun -n 4 -c 1 -N 4 ./2d_nonlocal_distributed --file ../tests/load_balance_25s_4n.txt --dt 0.00001 --nt 45 --eps 8 --nx 20 --ny 20 --npx 5 --npy 5 --dh 0.0025 --test 0 --test_load_balance --nbalance 10

Student Developer

Mentors