diff -bur NAMD_2.11_Source/arch/Linux-x86_64.cuda NAMD_2.11_Source-edited/arch/Linux-x86_64.cuda --- NAMD_2.11_Source/arch/Linux-x86_64.cuda 2015-08-07 14:34:14.000000000 -0600 +++ NAMD_2.11_Source-edited/arch/Linux-x86_64.cuda 2017-03-30 15:40:33.282263643 -0600 @@ -1,12 +1,15 @@ -CUDADIR=/usr/local/encap/cuda-6.0 -CUDAINCL=-I$(CUDADIR)/include -CUDALIB=-L$(CUDADIR)/lib64 -lcudart_static -lrt -CUDASODIR=$(CUDADIR)/lib64 +CUDADIR= +CUDAINCL=-I/usr/include +CUBDIR=.rootdir/cub +CUBINCL=-I$(CUBDIR) +CUDALIB=-L/usr/lib -lcufft_static -lculibos -lcudart_static -lrt +CUDASODIR=/usr/lib LIBCUDARTSO= -CUDAFLAGS=-DNAMD_CUDA +CUDAFLAGS=-D_FORCE_INLINES -DNAMD_CUDA CUDAOBJS=$(CUDAOBJSRAW) CUDA=$(CUDAFLAGS) -I. $(CUDAINCL) -CUDACC=$(CUDADIR)/bin/nvcc -O3 --maxrregcount 32 $(CUDAGENCODE) -Xcompiler "-m64" $(CUDA) -CUDAGENCODE=-gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=compute_20 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_50,code=compute_50 +CUDACC=/usr/bin/nvcc -O3 --maxrregcount 48 $(CUDAGENCODE) -Xcompiler "-m64" $(CUDA) +CUDADLINKOPTS=-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 +CUDAGENCODE=-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61 diff -bur NAMD_2.11_Source/arch/Linux-x86_64.fftw3 NAMD_2.11_Source-edited/arch/Linux-x86_64.fftw3 --- NAMD_2.11_Source/arch/Linux-x86_64.fftw3 2011-07-12 12:23:09.000000000 -0600 +++ NAMD_2.11_Source-edited/arch/Linux-x86_64.fftw3 2016-07-19 10:22:49.544924149 -0600 @@ -1,7 +1,7 @@ FFTDIR=$(HOME)/fftw3 -FFTINCL=-I$(FFTDIR)/include -FFTLIB=-L$(FFTDIR)/lib -lfftw3f +FFTINCL=-I/usr/include +FFTLIB=-L/usr/lib -lfftw3f FFTFLAGS=-DNAMD_FFTW -DNAMD_FFTW_3 FFT=$(FFTINCL) $(FFTFLAGS) diff -bur NAMD_2.11_Source/arch/Linux-x86_64.tcl NAMD_2.11_Source-edited/arch/Linux-x86_64.tcl --- NAMD_2.11_Source/arch/Linux-x86_64.tcl 2011-06-17 14:38:43.000000000 -0600 +++ NAMD_2.11_Source-edited/arch/Linux-x86_64.tcl 2016-07-19 10:28:02.458475804 -0600 @@ -1,9 +1,9 @@ #TCLDIR=/Projects/namd2/tcl/tcl8.5.9-linux-x86_64 TCLDIR=/Projects/namd2/tcl/tcl8.5.9-linux-x86_64-threaded -TCLINCL=-I$(TCLDIR)/include +TCLINCL=-I/usr/include/tcl #TCLLIB=-L$(TCLDIR)/lib -ltcl8.5 -ldl -TCLLIB=-L$(TCLDIR)/lib -ltcl8.5 -ldl -lpthread +TCLLIB=-L/usr/lib -ltcl8.6 -ldl -lpthread TCLFLAGS=-DNAMD_TCL TCL=$(TCLINCL) $(TCLFLAGS) Only in NAMD_2.11_Source-edited/: charm-6.7.0 Only in NAMD_2.11_Source-edited/: Linux-x86_64-g++ diff -bur NAMD_2.11_Source/Makefile NAMD_2.11_Source-edited/Makefile --- NAMD_2.11_Source/Makefile 2015-12-20 15:30:25.000000000 -0700 +++ NAMD_2.11_Source-edited/Makefile 2016-09-15 16:45:01.050425871 -0600 @@ -361,6 +361,8 @@ PLUGINLIB = $(PLUGINOBJS) +include .rootdir/Plumed.inc + CUDAOBJSRAW = \ $(DSTDIR)/ComputePmeCUDAKernel.o \ $(DSTDIR)/ComputeNonbondedCUDAKernel.o @@ -452,6 +454,7 @@ $(DPMELIB) \ $(FMMLIB) \ $(TCLLIB) \ + $(PLUMED_LOAD) \ $(FFTLIB) \ $(PLUGINLIB) \ $(SBLIB) \ Only in NAMD_2.11_Source-edited/: Makefile.preplumed Only in NAMD_2.11_Source-edited/: Plumed.cmake Only in NAMD_2.11_Source-edited/: Plumed.h Only in NAMD_2.11_Source-edited/: Plumed.inc diff -bur NAMD_2.11_Source/src/ComputeMgr.C NAMD_2.11_Source-edited/src/ComputeMgr.C --- NAMD_2.11_Source/src/ComputeMgr.C 2015-09-25 14:07:00.000000000 -0600 +++ NAMD_2.11_Source-edited/src/ComputeMgr.C 2016-09-15 16:45:01.062425930 -0600 @@ -87,8 +87,131 @@ #include "GlobalMasterSymmetry.h" #include "GlobalMasterEasy.h" #include "GlobalMasterMisc.h" +// PLUMED +#include "../Plumed.h" +// END PLUMED #include "GlobalMasterFreeEnergy.h" #include "GlobalMasterColvars.h" +class GlobalMasterPlumed: + public GlobalMasterEasy, + private PLMD::Plumed +{ + std::vector index; + std::vector positions; + std::vector forces; + std::vector masses; + std::vector charges; + double box[3][3]; + SimParameters *spar; +public: + GlobalMasterPlumed(): + GlobalMasterEasy("plumedScript") + { + easy_init(config); + } + void easy_init(const char* config) + { + int realPrecision=sizeof(double); + cmd("setRealPrecision",&realPrecision); + spar=Node::Object()->simParameters; + + double energyUnits=4.184; + double lengthUnits=0.1; + double timeUnits=0.001; + cmd("setMDEnergyUnits",&energyUnits); + cmd("setMDLengthUnits",&lengthUnits); + cmd("setMDTimeUnits",&timeUnits); + + cmd("setPlumedDat",spar->plumedFilename); + + int natoms=Node::Object()->molecule->numAtoms; + cmd("setNatoms",&natoms); + + cmd("setMDEngine","namd"); + + cmd("setLog",stdout); + + double dt=spar->dt; + cmd("setTimestep",&dt); + cmd("setNoVirial"); + cmd("init"); + + int s=step+1; + cmd("setStep",&s); + share(); + + } + + void share(){ + int* p; + int n; + bool redo=false; + cmd("prepareDependencies"); + cmd("createFullList",&n); + cmd("getFullList",&p); + if(index.size()!=n)redo=true; + if(!redo) for(int i=0;imolecule->atommass(index[i]); + charges[i]=Node::Object()->molecule->atomcharge(index[i]); + }; + + if(spar->lattice.volume()>0.0){ + for(int i=0;i<3;i++) box[0][i]=spar->lattice.a()[i]; + for(int i=0;i<3;i++) box[1][i]=spar->lattice.b()[i]; + for(int i=0;i<3;i++) box[2][i]=spar->lattice.c()[i]; + cmd("setBox",&box[0][0]); + } + + for(int i=0;iaddClient(new GlobalMasterTMD()); if (simParams->miscForcesOn) masterServerObject->addClient(new GlobalMasterMisc()); + // PLUMED + if (simParams->plumedOn){ + masterServerObject->addClient(new GlobalMasterPlumed()); + } + // END PLUMED if ( simParams->freeEnergyOn ) masterServerObject->addClient(new GlobalMasterFreeEnergy()); if ( simParams->colvarsOn ) Only in NAMD_2.11_Source-edited/src: ComputeMgr.C.preplumed diff -bur NAMD_2.11_Source/src/SimParameters.C NAMD_2.11_Source-edited/src/SimParameters.C --- NAMD_2.11_Source/src/SimParameters.C 2015-12-08 08:41:37.000000000 -0700 +++ NAMD_2.11_Source-edited/src/SimParameters.C 2016-09-15 16:45:01.078426010 -0600 @@ -1500,6 +1500,13 @@ opts.optionalB("main", "GBISSer", "Use GB implicit solvent?", &GBISserOn, FALSE); + + // PLUMED + //// plumed + opts.optionalB("main", "plumed", "Is PLUMED active?",&plumedOn,FALSE); + opts.require("plumed", "plumedfile","PLUMED script",PARSE_STRING); + // END PLUMED + opts.optional("GBIS", "solventDielectric", "Solvent Dielectric", &solvent_dielectric, 78.5); opts.optional("GBIS", "intrinsicRadiusOffset", @@ -4600,7 +4607,7 @@ // Global forces configuration globalForcesOn = ( tclForcesOn || freeEnergyOn || miscForcesOn || - (IMDon && ! IMDignore) || SMDOn || TMDOn || colvarsOn || symmetryOn ); + (IMDon && ! IMDignore) || SMDOn || TMDOn || colvarsOn || symmetryOn || plumedOn ); if (tclForcesOn) @@ -4685,6 +4692,21 @@ iout << endi; } + // PLUMED + if (plumedOn) + { + iout << iINFO << "PLUMED ACTIVE\n"; + + current = config->find("plumedfile"); + iout << iINFO << "PLUMED CONFIG FILE "<< current->data << "\n" << endi; + strcpy(plumedFilename,current->data); + + ifstream plumedFile(current->data); + if ( ! plumedFile ) NAMD_die("Error reading PLUMED config file.\n"); + + } + // END PLUMED + if (IMDon) { iout << iINFO << "INTERACTIVE MD ACTIVE\n"; Only in NAMD_2.11_Source-edited/src: SimParameters.C.preplumed diff -bur NAMD_2.11_Source/src/SimParameters.h NAMD_2.11_Source-edited/src/SimParameters.h --- NAMD_2.11_Source/src/SimParameters.h 2015-09-04 16:20:03.000000000 -0600 +++ NAMD_2.11_Source-edited/src/SimParameters.h 2016-09-15 16:45:01.090426069 -0600 @@ -468,6 +468,9 @@ Bool miscForcesOn; // Using misc forces? Bool colvarsOn; // Using the colvars module? + Bool plumedOn; // Using Plumed? + char plumedFilename[1024]; // Plumed filename + Bool fixedAtomsOn; // Are there fixed atoms? Bool fixedAtomsForces; // Calculate forces anyway? Bool fixedAtomsForceOutput; // Output fixed forces? Only in NAMD_2.11_Source-edited/src: SimParameters.h.preplumed