Giter Site home page Giter Site logo

gomc-wsu / gomc Goto Github PK

View Code? Open in Web Editor NEW
73.0 20.0 36.0 66.45 MB

GOMC - GPU Optimized Monte Carlo is a parallel molecular simulation code designed for high-performance simulation of large systems

Home Page: https://gomc-wsu.org

License: MIT License

C++ 86.19% Shell 0.35% C 2.40% CMake 2.05% Cuda 7.25% Objective-C 1.18% Python 0.47% HTML 0.03% Batchfile 0.07%
monte-carlo monte-carlo-simulation gpu openmp adsorption free-energy phase-equilibrium surface-tension cuda gibbs-ensemble

gomc's People

Contributors

dyukovsm avatar gomc-wsu avatar gregoryschwing avatar hamiedasadi avatar jpotoff avatar lschwiebert avatar msoroush avatar niloofartf avatar rakesh-porob avatar younesn avatar zzzhe1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gomc's Issues

Weird performance behavior of GPU

If we remove the cudaFree(d_temp_storage) from the end of the CallForceReciprocalGPU() function we gain 3x performance without changing the final result.

We have to figure out what the problem is here and why adding that line will decrease our performance by 3x.

Note: Adding that cudaFree increases the average runtime of cudaMalloc() ?!

DME example gives an error

Hello,

I downloaded the ewald version today and compiled. However, when I tried to run dme example, I ran into the following error. Anybody knows what has happened?
Thank you

-Mostafa

GOMC Serial Version 0.97
Started at: Fri Dec 18 22:41:16 2015
On hostname: chem80


This code was compiled to support the canonical (NVT) ensemble.

Warning: 1-4 electro static scaling has been set to zero!
Reading from Exotic Parameter File file: ./Par_TraPPE.inp

Finished reading Exotic Parameter File file: ./Par_TraPPE.inp

Reading from system PDB coordinate file file: ./STEP3_START_DME_BOX_0.pdb

Finished reading system PDB coordinate file file: ./STEP3_START_DME_BOX_0.pdb

REMAINDER! 1-4 Interaction is OFF

Min. Box Size: 8000.1
STARTING SIMULATION!!


-- ========== --
-- === BOX 0 === --

-- ========== --

Volume: 64000 A^3
Tot # mol: 1000

Molecule Type DME

Number: 1000 ;
Density: 1.1953 g/ml

Energy (in K): total: 9.36237e+10
intra (bonded): 37416.8

inter: 9.36237e+10 ; inter (tail corr.): -196353; elect: 85991.9; real: 88674.8; recip: 22427.8; self: -4.96243e+06; correction: 4.93732e+06

-- ========== --
-- === SYSTEM === --

-- ========== --

Energy (in K): total: 9.36237e+10
inter: 9.36237e+10 ; inter (tail corr.): -196353
intra (bonded): 37416.8 ; intra (nonbonded): 0
; elect: 85991.9; real: 88674.8; recip: 22427.8; self: -4.96243e+06; correction: 4.93732e+06
Printed combined psf to file DME_290_00_K_u_2605.psf
Floating point exception (core dumped)

DME example input file error

The input file for the DME example problem is incompatible with V1.70. Ewald summation appears to be turned off. Tolerance parameter is not set.

New "GPU" branch potential conflicts issue

I will create a new branch, called "GPU" from "development" branch and push the GPU implementation there. The problem is that "development" branch has the code of using cache; however, GPU code does not use cache, which implies the conflicts on most of the calculations of reciprocal energy.

Serial Cache code is more efficient on the simulations with Ewald calculation, but Volume Swap move ruins the performance. This is opposite to GPU implementation that GPU gives great performance on Volume Swap when there has Ewald. Moreover, there would be a big overhead to handle the cache on GPU implementation. Therefore, the question is how we should integrate GPU calculation with Serial's.

  1. Should we abandon Cache serial code, so that GPU code can be merged to the non-cache serial code easily?
  2. Should we keep a very big source code that has both serial-cache and integration of serial non-cache and GPU?
  3. Should we have two separate code? A serial cache code without GPU and another serial non-cache code with GPU?
  4. Any other ideas?

This is a long term question that we do not need to resolve until the GPU implementation is fully functional. However, it is good to start collecting ideas.

Please leave a comments if you have any suggestions, and I will keep this post open.

Electrostatic calcualtion using cache ewald method

During GCMC simulation on binary system with charges, I noticed that using cache ewald method to calculate electrostatic interaction lead to wrong results. However, using none cache method produce correct results.

Initial TotalEnergy calculation is different on GPU and CPU

run2a_bridge.zip
CalculateEnergy:BoxInter is slighty different on GPU and CPU version.
In the example file I attached, the first call to BoxInter, pair.size() is 1:
GPU: max = (max < pairSize ? max : pairSize-1);
which makes max = 0 and return 0 for LJ energy
CPU: for (i = 0; i < pair1.size(); i++)
On CPU however, it stays 1 and runs 1 time and returns some nonzero value.

Is this intended or is this a bug?

Duplicate "const" qualifier in some branch like openMP

In some branches, found in openMP so far, there are duplicate qualifier "const" in CalculateEnergy.h and cbmc/DCData.h. Some compiler like intel compiler accepts it; however, some others like gcc 6.1.0 does not support duplicate "const" and will return errors.
Since there is no difference by defining double "const" and removing any one of them, it suggests us to keep only one "const", so the code can be supported by all different compilers.

Removing Max values

There is no need to report Max value for swap, intra swap move in log file. We need to remove it.

Displacement moves can crash GEMC due to unsuitable initial condition.

This issue occurs when the boxes change identity (liquid box becomes a gas, and gas becomes liquid). So simulations where the boxes change identity (e.g. gas box becomes liquid) may lead to molecules being displaced outside of the box. This will result in a segmentation fault. This problem is not observed during stable simulations where boxes maintain the same identity.

The cause of this segmentation fault is that the maximum displacement could bet too large. This allows the simulator to generate coordinates that are outside the box, even after applying periodic boundaries.

For instance, imagine that the box axes are 5 and 20. A displacement of 15 instead a box with axes of 20 will not cause a problem, but if the boxes change identity and a series of volume transfers result in the second box shrinking rapidly, a maximum displacement of 15 could lead to invalid coordinates.

Because the maximum displacement is updated only periodically, a rapid reduction in the volume of a box could allow a displacement amount that is too large.

Water example file error

The input file for the water test case is not compatible with V1.70 of the code. The input file lists Alpha and KMax parameters, which are no longer read from input. These parameters are now set by the tolerance parameter.

Energy Values

We are printing same value for Intra (N) and Intra (B) energy. This is wrong, for NVT simulation of isobutane, Intra (N) should be zero which has value in it.

Fix header references

Fix the header references and remove switching directory in header reference.
Include directory has to be added to the makefile.

Ex:
#include "../../lib/BasicTypes.h" to #include "BasicTypes.h"

Printing GPU device information

Printing GPU devices information in the beginning of the application sometimes cause the program fall into an infinite loop. This problem relates to cudaGetDeviceCount function and happens in newer NVIDIA drivers. There is a workaround to it but it is not related to our code. In these cases if the number of devices return was larger than 4 we shouldn't print out the GPU information.

Struct/Class definitions

Fix where structs are defined as class and/or any linking error we face in visual studio 2015.

Remove "Examples" directory.

We will now remove "Examples" directory from all branches since we will have a separate repository for example files.

OpenMP

We need OpenMP implementation for electrostatic calculation in order to increase the code performance. For this purpose I have created a new branch "OpenMP".

Translation on empty box

Receiving Segmentation fault on simulation squalane using GCMC with move probability of %20 displacement, %10 rotation, %70 swap.

Reporting of # of CPUs used?

Code outputs the relevant CPU info, but does not state how many of these CPU cores are actually being used. It would be helpful if the code could do that.

Info: GOMC Serial Version 2.0
Info: Start Time: Sat Jan 6 21:43:57 2018
Info: Host Name: potoff38.eng.wayne.edu
Info: Total number of CPUs: 4
Info: Total number of CPUs available: 4
Info: Model name: Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz

Default compiler should be intel and add OpenMP by default.

We should set the default compiler to intel in case the user has one.
in metamake.sh we can check and assign before running cmake.

We can add OpenMP tag in cmake using "FindOpenMP.cmake" module.
By default we will compile for openmp and appropriate flags (-fopenmp for GNU, -qopenmp for Intel, and /openmp for MSVC) will set.

Itra Swap move in Ewald code

The new type of move, intra-swap, does not work properly on Ewald code. The simulation energy does not match to the recalculated system energy. It is probably related to incorrectly updating cache because this new move was ported to cached Ewald code.
I will double check the cache update and restore; also we can implement this move on noncache version to see if we can duplicate the problem.

branch of GPU implementation of Reciprocal Calculation

According to the independent simulations within each reciprocal image and the large iteration for all reciprocal images, there is a great benefit that we can achieve from porting reciprocal energy calculation to GPU.

Since GPU code does not require extra cache for real and imaginary values, it is similar to Serial code without cache. Our "ewald" branch now has the serial code with cache, so there are two options for us to start the GPU branch. First, creating a new branch from "ewald". Second, pushing GPU code to the GPU repository instead of this Serial's. I would prefer the first option because this GPU implementation only implements reciprocal energy on GPU, and most of the simulations are still running on CPU; therefore, it is better to treat GPU as an alternative. Also, we probably want to develop a code that can provide users the option to turn GPU on or off.According to the independent simulations within each reciprocal image and the large iteration for all reciprocal images, there is a great benefit that we can achieve from porting reciprocal energy calculation to GPU.

Data collection implementation

Implementation of data collection and sending data back to our server is next priority and will be implemented before next release.

Need to check force field file against user settings

Since GOMC supports two versions of parameter files, we should have some error checking in case a user makes a silly mistake and tries to use the Mie parameter format, but has the CHARMM force field file type set to "true".

Histogram output

The histogram output has 1 additional entry. For example, 2x10^7 steps with 2x10^6 equilibration steps produces 18x10^6 steps of data. If one extracts histogram data every 200 steps that should produce exactly 90,000 entries, not 90,001.

Printing bonded parameter file

It doesn't print the whole bonded parameters for pure systems.
For example if there exists 5 dihedral for molecule with 2 different parameters it will only print one of them. For binary systems same kind of issues happen.

CUB library needs to be imported using CMake

Instead of letting the user download the library or us leaving the library inside our code, we could probably let the CMake download the library and move it into our code before compilation.

Clarification of Logfile Output

Code reports number of CPUs available on a node, but does not report how many CPUs it is using.

Need to greatly reduce or eliminate "!".

Output of 1-4 scaling and exclusions should occur in the same part of the log file as the potential cut-off, temperature, and other simulation parameters. This should not be labeled as a "REMINDER".

When 1-4 scaling is set to "exclude 1-4" and parameter has been provided in the input file for 1-4 electrostatic scaling, the log file should include a comment such as "found non-zero 1-4 electrostatic scaling, but exclude 1-4 set; ignoring 1-4 electrostatic interactions."

Disabling pressure calculation is an option, it should not be labeled as a "warning". Warnings should be used when users select options that have the potential to produce incorrect results.

We should denote certain keywords for the output file such as:
PARAMETER: for temperature, pressure, chemical potential, run length, potential cutoff, 1-4 scaling
OPTION: for options set by the user that are either on or off( pressure calculation, caching of kvectors, force field style, tail corrections, maybe 1-4 scaling).
WARNING: for potentially unsafe operation that could lead to incorrect results.

GOMC input issues

While running a binary mixture in GCMC mode, if no molecules of type two are in the PDB and PSF files for box 0, the simulation assumes there is only one molecule type, even if two molecule types are specified in the input file. If GOMC needs two molecule types to be in the box 0 PDB and PSF files, this should be flagged as an error. Otherwise, the code should use the data read from the input file to realize there are two molecule types.

Histogram output incorrect

Under some conditions, in GCMC simulations, the energies output to the histogram file are very large and not correct. It appears that the trigger is the use of an initial configuration with a very large energy, perhaps a problem with the initial configuration (overlapping the system boundary?). The code needs to do a better job handling these cases, (flagging the initial configuration as incorrect?) instead of running like nothing is wrong.
hist_issue.zip

Overlap detection fails during swap move

For simulation of polar molecules, if any atom of the molecule has no VDW parameter (e.g. water), there is a chance that during insertion, atom of opposite charge will overlap and generate a very large energy value. Current mechanism of avoiding overlap is not working properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.