Project

General

Profile

Task #2621

Fine-Grained API to Describe Force Calculation and Neighbourhood Search

Added by Prashanth Kanduri over 1 year ago.

Status:
New
Priority:
Normal
Category:
core library
Target version:
Difficulty:
uncategorized
Close

Description

The key motivation here is to make large regions of the do_force_cutsVERLET(...) function more readable/maintainable. Along with drastically reduce lines of code visible at that abstraction level. To be read in the context of (#2574, #2594 and #2595)

ForceCalculator API (SR/LR)

This is an attempt to gain common grounds between different types of force calculations. It would club verbose lines of code into single lines and simple function calls. The lifetime of these objects would be throughout the MD-loop.

Aim is to enhance the readability of each schedule.

class IForceCalculator
{
public:
    void computeLocal();
    void computeNonLocal();
    void waitAndReduce();
}

class IForceCalculatorGPU: public IForceCalculator
{
    // Uses the Methods above in addition to the ones below
public:    
    void copyh2d();
    void copyd2h();
}

class SRForceCalculatorGPU: public IForceCalculatorGPU 
{
    ...
}

class PMECalculatorGPU : public IForceCalculatorGPU
{
public:
    void initPME();
}

NeighbourhoodSearch API (CPU/GPU/NoNS/Pruning)

Also goes in the same direction as the previous step. New schedule implementations can use this. New pair list logic can be added via extension.

class INeighbourSearch
{
public:
    void createLocalPairList();
    void createNonLocalPairList();
}

class PruneNS: public INeighbourSearch
{
    void prunePairList();
}

class NSCPU: public INeighbourSearch
{
    ...
}
md.png (209 KB) md.png An (incomplete) description of how this would work with the Schedule API Prashanth Kanduri, 08/22/2018 11:35 AM

Also available in: Atom PDF