Coder Social home page Coder Social logo

ilyak / libefp Goto Github PK

View Code? Open in Web Editor NEW
24.0 6.0 16.0 8.79 MB

Parallel implementation of the Effective Fragment Potential Method

License: Other

Makefile 0.45% Fortran 27.43% Perl 0.35% C 64.79% Shell 0.09% Assembly 0.31% C++ 0.69% CMake 3.99% Objective-C 1.89%

libefp's Introduction

LIBEFP

Overview

The Effective Fragment Potential (EFP) method allows one to describe large molecular systems by replacing chemically inert part of a system by a set of Effective Fragments while performing regular ab initio calculation on the chemically active part [1-8]. The LIBEFP library is a full implementation of the EFP method. It allows users to easily incorporate EFP support into their favourite quantum chemistry package. LIBEFP is used by many major quantum chemistry packages, such as Q-Chem, PSI4, NWChem, GAMESS, Molcas, and others.

Detailed description of methods and algorithms can be found in two LIBEFP papers:

Getting source code

The latest release can be downloaded here.

Installation

To build LIBEFP from source you need the following:

  • C compiler (with C99 standard and OpenMP support)

  • POSIX complaint make utility (BSD make or GNU make will work) or CMake

  • BLAS/LAPACK libraries (required when linking with LIBEFP)

If you are going to compile EFPMD program (required for tests):

  • Fortran 77 compiler

First, copy the configuration file which suits you from config directory to the top source code directory. Rename the file to config.inc and edit it according to your needs. All available options are explained in comments. Defaults usually work well, but you may need to change the MYLIBS variable to link with additional libraries required by your setup. You may also need to add additional include directories to MYCFLAGS (using -I flag) or library search path to MYLDFLAGS (using -L flag).

To compile issue:

make

If you only need the library you can use:

make libefp

To run the test suite (optional) issue:

make check
make checkomp    # to test OpenMP parallel code
make checkmpi    # to test MPI parallel code

Finally, to install everything issue:

make install

For CMake instructions, see README-cmake.md.

Documentation

The description of public LIBEFP API is available here. Also see this file for step-by-step instructions. Fortran bindings to LIBEFP are available in interface/efp.f90.

EFPMD

The EFPMD program is a molecular simulation package based on LIBEFP. It supports EFP-only molecular simulations such as geometry optimization and molecular dynamics. EFPMD is a part of the LIBEFP distribution. See this file for more information.

Parallel scaling

Parallel scaling of LIBEFP is shown below. Benchmarks were done on the SDSC Gordon supercomputer using EFPMD.

parallel.png

How to create custom EFP fragment types

LIBEFP comes with a library of ready-to-use fragments. If you decide to generate custom fragment parameters follow the instructions below.

LIBEFP uses EFP potential files in format generated by GAMESS quantum chemistry package (see http://www.msg.ameslab.gov/gamess/). A version of GAMESS from August 11, 2011 is the currently a recommended and tested version. A set of pre-generated library fragments are available in the fraglib directory. If you want to generate parameters for custom fragments you should create GAMESS makefp job input similar to the fraglib/makefp.inp file. Using this input file as a template you can create EFP parameters for arbitrary fragment types.

After you created .efp file using GAMESS you should rename the fragment by replacing $FRAGNAME with your name of choice (e.g. rename $FRAGNAME to $MYH2O).

For a complete description of EFP data file format consult FRAGNAME section in GAMESS manual (see http://www.msg.ameslab.gov/gamess/).

Information for code contributors

  • The main design principle for the LIBEFP library is Keep It Simple. All code should be easy to read and to understand. It should be easy to integrate the library into programs written in different programming languages. So the language of choice is C and no fancy Object-Oriented hierarchies.

  • Be consistent in coding style when adding new code. Consistency is more important than particular coding style. Use descriptive names for variables and functions. The bigger the scope of the symbol the longer its name should be. Look at the sources and maintain similar style for new code.

  • As with most quantum chemistry methods, EFP can require large amounts of memory. The guideline for developers here is simple: ALWAYS check for memory allocation errors in your code and return EFP_RESULT_NO_MEMORY on error.

  • The code is reentrant which means that it is safe to use two different efp objects from two different threads. NEVER use mutable global state as it will break this. Store all mutable data in the efp object.

  • Use -Wall -Wextra -Werror flags to make sure that compilation produces no warnings. Use make check to make sure that the code passes test cases.

References

  1. Fragmentation Methods: A Route to Accurate Calculations on Large Systems. M.S.Gordon, D.G.Fedorov, S.R.Pruitt, L.V.Slipchenko. Chem. Rev. 112, 632-672 (2012).

  2. Effective fragment method for modeling intermolecular hydrogen bonding effects on quantum mechanical calculations. J.H.Jensen, P.N.Day, M.S.Gordon, H.Basch, D.Cohen, D.R.Garmer, M.Krauss, W.J.Stevens in "Modeling the Hydrogen Bond" (D.A. Smith, ed.) ACS Symposium Series 569, 1994, pp 139-151.

  3. An effective fragment method for modeling solvent effects in quantum mechanical calculations. P.N.Day, J.H.Jensen, M.S.Gordon, S.P.Webb, W.J.Stevens, M.Krauss, D.Garmer, H.Basch, D.Cohen. J.Chem.Phys. 105, 1968-1986 (1996).

  4. Solvation of the Menshutkin Reaction: A Rigorous test of the Effective Fragment Model. S.P.Webb, M.S.Gordon. J.Phys.Chem.A 103, 1265-73 (1999).

  5. The Effective Fragment Potential Method: a QM-based MM approach to modeling environmental effects in chemistry. M.S.Gordon, M.A.Freitag, P.Bandyopadhyay, J.H.Jensen, V.Kairys, W.J.Stevens. J.Phys.Chem.A 105, 293-307 (2001).

  6. The Effective Fragment Potential: a general method for predicting intermolecular interactions. M.S.Gordon, L.V.Slipchenko, H.Li, J.H.Jensen. Annual Reports in Computational Chemistry, Volume 3, pp 177-193 (2007).

  7. Water-benzene interactions: An effective fragment potential and correlated quantum chemistry study. L.V.Slipchenko, M.S.Gordon. J.Phys.Chem.A 113, 2092-2102 (2009).

  8. Damping functions in the effective fragment potential method. L.V.Slipchenko, M.S.Gordon. Mol.Phys. 107, 999-1016 (2009).

libefp's People

Contributors

dmmorozo avatar ilyak avatar loriab 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libefp's Issues

problems compiling to local ATLAS or mkl with gcc

I have problems getting it to compile with gcc (version 5.4.0) on Ubuntu 16.04 to local install of both ATLAS and mkl.

with ATLAS I used this in config:

# additional link libraries
MYLIBS= -llapack -lf77blas -latlas -lgfortran -L/mnt/batch/tasks/shared/BIGdisk/ATLAS/install/lib

# additional linker flags
MYLDFLAGS= -I/mnt/batch/tasks/shared/BIGdisk/ATLAS/install/include

# additional C flags
MYCFLAGS= -std=c99 -O3 -g -fopenmp 

# additional Fortran flags
MYFFLAGS= -g

and I get:

gcc -o efpmd -DFRAGLIB_PATH="\"/mnt/batch/tasks/shared/BIGdisk/libEFP/install/share/libefp/fraglib\"" -I../../src -I../libopt -I../libff -std=c99 -O3 -g -fopenmp  -L../../src -L../libopt -L../libff -I/mnt/batch/tasks/shared/BIGdisk/ATLAS/install/include cfg.o common.o efield.o energy.o grad.o gtest.o hess.o main.o md.o msg.o opt.o parse.o rand.o sp.o -lefp -lopt -lff -llapack -lf77blas -latlas -lgfortran -L/mnt/batch/tasks/shared/BIGdisk/ATLAS/install/lib -lm
../../src/libefp.a(clapack.o): In function `efp_dsyev':
/mnt/batch/tasks/shared/BIGdisk/libEFP/libefp-1.5.0-DF/src/clapack.c:83: undefined reference to `dsyev_'
/mnt/batch/tasks/shared/BIGdisk/ATLAS/install/lib/liblapack.a(ATL_dgetrfC.o): In function `ATL_dgetrfC':
ATL_getrfC.c:(.text+0x11f): undefined reference to `cblas_dtrsm'

for mkl I tried:


# additional link libraries
MYLIBS=  -lgfortran -I/mnt/batch/tasks/shared/BIGdisk/mkl-install/compilers_and_libraries/linux/mkl/include 

# additional linker flags
mymkl=/mnt/batch/tasks/shared/BIGdisk/mkl-install/compilers_and_libraries/linux/mkl/lib/intel64/
MYLDFLAGS = -Wl,--start-group {$mymkl}libmkl_gf_ilp64.a {$mymkl}libmkl_gnu_thread.a {$mymkl}libmkl_core.a -Wl,--end-group -lgomp  -lm -ldl

# additional C flags
MYCFLAGS= -std=c99 -O3 -g -fopenmp -m64

# additional Fortran flags
MYFFLAGS= -g

giving:

gcc -o efpmd -DFRAGLIB_PATH="\"/mnt/batch/tasks/shared/BIGdisk/libEFP/install/share/libefp/fraglib\"" -I../../src -I../libopt -I../libff -std=c99 -O3 -g -fopenmp -m64 -L../../src -L../libopt -L../libff -Wl,--start-group /mnt/batch/tasks/shared/BIGdisk/mkl-install/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_gf_ilp64.a /mnt/batch/tasks/shared/BIGdisk/mkl-install/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_gnu_thread.a /mnt/batch/tasks/shared/BIGdisk/mkl-install/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -lgomp  -lm -ldl cfg.o common.o efield.o energy.o grad.o gtest.o hess.o main.o md.o msg.o opt.o parse.o rand.o sp.o -lefp -lopt -lff -lgfortran -I/mnt/batch/tasks/shared/BIGdisk/mkl-install/compilers_and_libraries/linux/mkl/include  -lm
../../src/libefp.a(clapack.o): In function `efp_dgemm':
/mnt/batch/tasks/shared/BIGdisk/libEFP/libefp-1.5.0-DF/src/clapack.c:69: undefined reference to `dgemm_'
../../src/libefp.a(clapack.o): In function `efp_dsyev':
/mnt/batch/tasks/shared/BIGdisk/libEFP/libefp-1.5.0-DF/src/clapack.c:83: undefined reference to `dsyev_'
../../src/libefp.a(clapack.o): In function `efp_dgesv':
/mnt/batch/tasks/shared/BIGdisk/libEFP/libefp-1.5.0-DF/src/clapack.c:95: undefined reference to `dgesv_'
collect2: error: ld returned 1 exit status

any ideas?

libefp should be versioned

The shared library libefp.so should be versioned. Without sonames it is impossible for packaging systems to detect when dependencies are broken, and when any software compiled against libefp should be recompiled.

psi4 fails to find libefp: missing component: shallow fraglib

-- libefpConfig missing component: shallow fraglib (libefp: /usr/local/share/libefp/fraglib;/usr/local/share/libefp/fraglib/databases)

Both directories /usr/local/share/libefp/fraglib and /usr/local/share/libefp/fraglib/databases``` exist and have .efp files.

What's wrong?

inconsistency in screen_damping function

In libefp, when alpha=gamma, screen=1.0 - (1.0 + 0.5 * alpha * beta) * exp(-pi * r). But in Slipchenko†, L. V. and M. S. Gordon (2010). "Damping functions in the effective fragment potential method." Molecular Physics 107(8-12): 999-1016, there is no 0.5 in P(0) when alpha=beta. Which is why?

pol tests

While I can easily reproduce total efp energies and elec, xr, and disp components, and all (including pol) components coded up as psi4 test cases, I'm not able to compute the pol components in the libefp test cases. Moreover, the components don't sum to the total. Can you suggest where the numbers or my reasoning is going wrong? I have the same problem for all 6 pol_[1-3][ab] tests.

elec_1a.in	 0.0002900482
pol_1a.in 	 0.0002777238
xr_1.in	 	 0.0000134716
disp_1a.in	-0.0000989033
		-------------
		 0.0004823403	

total_1a.in	 0.0001922903

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.