git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15319 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2016-07-15 22:38:42 +00:00
parent eb78022b5a
commit 12f3178e86
3 changed files with 49 additions and 40 deletions

View File

@ -3,13 +3,13 @@
# this file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.empty
# top level directory of Quantum ESPRESSO 5.1 or later
# top level directory of Quantum ESPRESSO 5.4.1 or later
QETOPDIR=$(HOME)/compile/espresso
# import compiler settings from Quantum ESPRESSO
sinclude $(QETOPDIR)/make.sys
# FLAGS for c++ OpenMPI 1.8.x when QE was compiled with GNU Fortran 4.x
# FLAGS for c++ OpenMPI 1.8.8 or later when QE was compiled with GNU Fortran 4.x
MPICXX=mpicxx
MPICXXFLAGS=-DOMPI_SKIP_MPICXX=1 -O2 -Wall -g -fPIC\
-I../../src -I$(QETOPDIR)/COUPLE/include
@ -23,8 +23,8 @@ $(QETOPDIR)/PW/src/libpw.a \
$(QETOPDIR)/Modules/libqemod.a
# part 2: lo-level libraries for all of Q-E
LIBOBJS = \
$(QETOPDIR)/flib/ptools.a \
$(QETOPDIR)/flib/flib.a \
$(QETOPDIR)/FFTXlib/libqefft.a \
$(QETOPDIR)/LAXlib/libqela.a \
$(QETOPDIR)/clib/clib.a \
$(QETOPDIR)/iotk/src/libiotk.a

View File

@ -3,7 +3,11 @@ QM/MM support library
Axel Kohlmeyer, akohlmey@gmail.com
Temple University, Philadelphia and ICTP, Trieste
This library provides the basic glue code to combine LAMMPS with the
with contributions by
Carlo Cavazzoni & Mariella Ippolito
Cineca, Italy
This library provides the basic glue code to combine LAMMPS with the
Quantum ESPRESSO package plane wave density functional theory code for
performing QM/MM molecular dynamics simulations. More information on
Quantum ESPRESSO can be found at: http://www.quantum-espresso.org
@ -16,10 +20,16 @@ also an interface layer into the QM code similar to the one in QE.
-------------------------------------------------
WARNING: This is experimental code under developementand is provided
WARNING: This is experimental code under developement and is provided
at this early stage to encourage others to write interfaces to other
QM codes. Please test *very* carefully before using this software for
production calculations.
production calculations. At the time of the last update of this README
(July 2016) you have to download a QE snapshot (revision 12582) from
the QE subversion repository.
At this point, both mechanical and multipole based electrostatic
coupling have been successfully tested on a cluster of water
molecules as included in the two example folders.
-------------------------------------------------
@ -52,11 +62,13 @@ to confirm that the classical part of the code is set up correctly.
Step 3)
Build a standalone pw.x executable in the Quantum ESPRESSO directory
and also make the "couple" target. At the time of this writing
(April 2014) you have to download a QE snapshot from the SVN
repository, since no official release with the library interface
to couple other codes to QE has been made yet. This is also needed
to confirm that corresponding code is working correctly and to
run test calculations on the cluster of QM atoms.
(July 2016) you have to download a QE snapshot (revision 12582)
from the SVN repository, since no official release with the
completed QM/MM support code has been made available yet. The current
plan is to have a usable QM/MM interface released with the next
Quantum ESPRESSO release version 6.0. Building the standalone pw.x
binary is also needed to confirm that corresponding QM input is
working correctly and to run test calculations on QM atoms only.
Step 4)
To compile and link the final QM/MM executable, which combines the

View File

@ -18,6 +18,14 @@
#include "libqecouple.h"
#include "libqmmm.h"
#ifndef QE_LIBCOUPLE_API_VERSION
#define QE_LIBCOUPLE_API_VERSION 1
#endif
#if QE_LIBCOUPLE_API_VERSION != 1
#error "Unsupported QE coupling API. Want API version 1."
#endif
#include "library.h"
static const char delim[] = " \t\n\r";
@ -56,6 +64,16 @@ int main(int argc, char **argv)
qmmmcfg.comm_mode = QMMM_COMM_MPI;
nqm = ncpu - qmmmcfg.nmm;
retval = 0;
#if 1 // AK: temporary hack
if ( qmmmcfg.nmm != 2 ) {
if (me == 0) {
fprintf( stderr, "\n Error in the number of processors for MM code"
"\n for the time being only two processor are allowed\n");
}
MPI_Finalize();
return -1;
}
#endif
if (me == 0) {
const char *msg;
@ -148,11 +166,9 @@ int main(int argc, char **argv)
if (qmmmcfg.qmarg != NULL) {
char *ptr = strtok(qmmmcfg.qmarg,delim);
do {
/* -nimage is not supported */
if (strncmp("-npot",ptr,5) == 0) {
ptr=strtok(NULL,delim);
npots=atoi(ptr);
} else if ((strncmp("-nk",ptr,3) == 0)
/* -nimage parallelization is not supported with QM/MM
* -npot parallelization has been removed from QE */
if ((strncmp("-nk",ptr,3) == 0)
|| (strncmp("-npoo",ptr,5) == 0)) {
ptr=strtok(NULL,delim);
npool=atoi(ptr);
@ -179,9 +195,6 @@ int main(int argc, char **argv)
}
retval = 0;
if (me == 0) fprintf(stderr,"QM: nimage: %d npots: %d npools: %d "
"ntg: %d nband: %d ndiag: %d\n",
nimage,npots,npool,ntg,nband,ndiag);
/* setup and call Q-E. */
c2qmmm_mpi_config(qmmmcfg.qmmm_mode, qmmmcfg.qm_comm,
@ -194,7 +207,7 @@ int main(int argc, char **argv)
} else if (qmmmcfg.role == QMMM_ROLE_MASTER) {
FILE *fp;
char *cuda, *echo, *suffix;
char *suffix;
void *lmp;
MPI_Comm_rank(intra_comm,&me);
@ -228,15 +241,7 @@ int main(int argc, char **argv)
if (qmmmcfg.maarg != NULL) {
char *ptr = strtok(qmmmcfg.maarg,delim);
do {
if ((strncmp("-c",ptr,2) == 0)
|| (strncmp("-cuda",ptr,5) == 0)) {
ptr=strtok(NULL,delim);
cuda=strdup(ptr);
} else if ((strncmp("-e",ptr,2) == 0)
|| (strncmp("-echo",ptr,5) == 0)) {
ptr=strtok(NULL,delim);
echo=strdup(ptr);
} else if ((strncmp("-sf",ptr,3) == 0)
if ((strncmp("-sf",ptr,3) == 0)
|| (strncmp("-suffix",ptr,7) == 0)) {
ptr=strtok(NULL,delim);
suffix=strdup(ptr);
@ -274,7 +279,7 @@ int main(int argc, char **argv)
} else if (qmmmcfg.role == QMMM_ROLE_SLAVE) {
FILE *fp;
char *cuda, *echo, *suffix;
char *suffix;
void *lmp;
MPI_Comm_rank(intra_comm,&me);
@ -308,15 +313,7 @@ int main(int argc, char **argv)
if (qmmmcfg.slarg != NULL) {
char *ptr = strtok(qmmmcfg.maarg,delim);
do {
if ((strncmp("-c",ptr,2) == 0)
|| (strncmp("-cuda",ptr,5) == 0)) {
ptr=strtok(NULL,delim);
cuda=strdup(ptr);
} else if ((strncmp("-e",ptr,2) == 0)
|| (strncmp("-echo",ptr,5) == 0)) {
ptr=strtok(NULL,delim);
echo=strdup(ptr);
} else if ((strncmp("-sf",ptr,3) == 0)
if ((strncmp("-sf",ptr,3) == 0)
|| (strncmp("-suffix",ptr,7) == 0)) {
ptr=strtok(NULL,delim);
suffix=strdup(ptr);