Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for the change of the NAMD reduction interface #732

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions namd/src/colvarproxy_namd.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "NamdState.h"
#include "Controller.h"
#include "PatchData.h"
#include "ConfigList.h"

#ifdef NAMD_TCL
#include <tcl.h>
Expand Down Expand Up @@ -138,7 +139,7 @@ colvarproxy_namd::colvarproxy_namd()

reduction = ReductionMgr::Object()->willSubmit(REDUCTIONS_BASIC);

#ifdef NODEGROUP_FORCE_REGISTER
#if defined(NODEGROUP_FORCE_REGISTER) && ( NAMD_VERSION_NUMBER < 34471682L )
CProxy_PatchData cpdata(CkpvAccess(BOCclass_group).patchData);
PatchData *patchData = cpdata.ckLocalBranch();
nodeReduction = patchData->reduction;
Expand Down Expand Up @@ -588,7 +589,7 @@ void colvarproxy_namd::calculate()
#endif

// send MISC energy
#ifdef NODEGROUP_FORCE_REGISTER
#if defined(NODEGROUP_FORCE_REGISTER) && ( NAMD_VERSION_NUMBER < 34471682L )
if(!simparams->CUDASOAintegrate) {
reduction->submit();
}
Expand Down Expand Up @@ -652,7 +653,7 @@ int colvarproxy_namd::run_colvar_gradient_callback(

void colvarproxy_namd::add_energy(cvm::real energy)
{
#ifdef NODEGROUP_FORCE_REGISTER
#if defined(NODEGROUP_FORCE_REGISTER) && ( NAMD_VERSION_NUMBER < 34471682L )
if (simparams->CUDASOAintegrate) {
nodeReduction->item(REDUCTION_MISC_ENERGY) += energy;
} else {
Expand Down
4 changes: 2 additions & 2 deletions namd/src/colvarproxy_namd.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#ifndef NAMD_VERSION_NUMBER
// Assume 2.14b1 for now until the NAMD macro is merged
#define NAMD_VERSION_NUMBER 34471681
#define NAMD_VERSION_NUMBER 34471681L
#endif

#include "colvarproxy_namd_version.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ class colvarproxy_namd : public colvarproxy, public GlobalMaster {

/// Used to submit restraint energy as MISC
SubmitReduction *reduction;
#ifdef NODEGROUP_FORCE_REGISTER
#if defined(NODEGROUP_FORCE_REGISTER) && ( NAMD_VERSION_NUMBER < 34471682L )
NodeReduction *nodeReduction;
#endif

Expand Down