diff --git a/patches/gromacs-4.6.0.config b/patches/gromacs-4.6.1.config similarity index 100% rename from patches/gromacs-4.6.0.config rename to patches/gromacs-4.6.1.config diff --git a/patches/gromacs-4.6.0.diff b/patches/gromacs-4.6.1.diff similarity index 93% rename from patches/gromacs-4.6.0.diff rename to patches/gromacs-4.6.1.diff index 3a45247da6e4190a97e56465b7ec41c107fabeca..a30229c2df2e7ec7e7e93cd02e4b96217a14d732 100644 --- a/patches/gromacs-4.6.0.diff +++ b/patches/gromacs-4.6.1.diff @@ -48,7 +48,22 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/kernel/md.c" << \EOF_EOF #endif #ifdef GMX_THREAD_MPI #include "tmpi.h" -@@ -711,10 +717,50 @@ +@@ -235,10 +241,14 @@ + /* PME load balancing data for GPU kernels */ + pme_load_balancing_t pme_loadbal = NULL; + double cycles_pmes; + gmx_bool bPMETuneTry = FALSE, bPMETuneRunning = FALSE; + ++/* PLUMED */ ++ int plumedNeedsEnergy; ++/* END PLUMED */ ++ + #ifdef GMX_FAHCORE + /* Temporary addition for FAHCORE checkpointing */ + int chkpt_ret; + #endif + +@@ -714,10 +724,50 @@ } } fprintf(fplog, "\n"); @@ -99,7 +114,7 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/kernel/md.c" << \EOF_EOF print_date_and_time(fplog, cr->nodeid, "Started mdrun", runtime); wallcycle_start(wcycle, ewcRUN); if (fplog) -@@ -1027,10 +1073,17 @@ +@@ -1030,10 +1080,17 @@ vsite, shellfc, constr, nrnb, wcycle, do_verbose && !bPMETuneRunning); @@ -117,7 +132,7 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/kernel/md.c" << \EOF_EOF if (MASTER(cr) && do_log && !bFFscan) { -@@ -1172,16 +1225,37 @@ +@@ -1175,16 +1232,39 @@ /* The coordinates (x) are shifted (to get whole molecules) * in do_force. * This is parallellized as well, and does communication too. @@ -126,12 +141,14 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/kernel/md.c" << \EOF_EOF + + /* PLUMED */ + if(plumedswitch){ ++ plumedNeedsEnergy=0; + plumed_cmd(plumedmain,"setStep",&step); + plumed_cmd(plumedmain,"setPositions",&state->x[mdatoms->start][0]); + plumed_cmd(plumedmain,"setMasses",&mdatoms->massT[mdatoms->start]); + plumed_cmd(plumedmain,"setCharges",&mdatoms->chargeA[mdatoms->start]); + plumed_cmd(plumedmain,"setBox",&state->box[0][0]); + plumed_cmd(plumedmain,"prepareCalc",NULL); ++ plumed_cmd(plumedmain,"isEnergyNeeded",&plumedNeedsEnergy); + } + /* END PLUMED */ do_force(fplog, cr, ir, step, nrnb, wcycle, top, top_global, groups, @@ -139,10 +156,11 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/kernel/md.c" << \EOF_EOF f, force_vir, mdatoms, enerd, fcd, state->lambda, graph, fr, vsite, mu_tot, t, outf->fp_field, ed, bBornRadii, - (bNS ? GMX_FORCE_NS : 0) | force_flags); +- (bNS ? GMX_FORCE_NS : 0) | force_flags); ++ (plumedNeedsEnergy? GMX_FORCE_ENERGY : 0) |(bNS ? GMX_FORCE_NS : 0) | force_flags); + /* PLUMED */ + if(plumedswitch){ -+ plumed_cmd(plumedmain,"setEnergy",&enerd->term[F_EPOT]); ++ if(plumedNeedsEnergy) plumed_cmd(plumedmain,"setEnergy",&enerd->term[F_EPOT]); + plumed_cmd(plumedmain,"setForces",&f[mdatoms->start][0]); + plumed_cmd(plumedmain,"setVirial",&force_vir[0][0]); + plumed_cmd(plumedmain,"performCalc",NULL); diff --git a/src/core/Atoms.h b/src/core/Atoms.h index 50f044c043f2c9521873f3d61f11032d001bf1fd..5909f1bcbf08e354ef2a8d23947773d81ea4c774 100644 --- a/src/core/Atoms.h +++ b/src/core/Atoms.h @@ -166,6 +166,8 @@ public: double getEnergy()const{plumed_assert(collectEnergy && energyHasBeenSet); return energy;}; + bool isEnergyNeeded()const{return collectEnergy;}; + void setMDEnergyUnits(double d){MDUnits.setEnergy(d);}; void setMDLengthUnits(double d){MDUnits.setLength(d);}; void setMDTimeUnits(double d){MDUnits.setTime(d);}; diff --git a/src/core/PlumedMain.cpp b/src/core/PlumedMain.cpp index bc3e0d7d339875d607acb43d545ee9006ad33fac..ce0c0fffe75deeac98c164ad43b918be2d189376 100644 --- a/src/core/PlumedMain.cpp +++ b/src/core/PlumedMain.cpp @@ -301,6 +301,11 @@ void PlumedMain::cmd(const std::string & word,void*val){ } else if(word=="runFinalJobs"){ CHECK_INIT(initialized,word); runJobsAtEndOfCalculation(); + } else if(word=="isEnergyNeeded"){ + CHECK_INIT(initialized,word); + CHECK_NULL(val,word); + if(atoms.isEnergyNeeded()) *(static_cast<int*>(val))=1; + else *(static_cast<int*>(val))=0; } else { // multi word commands