File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -765,6 +765,13 @@ void colvarproxy_impl::calculate() {
765765 cudaCheck (cudaSetDevice (m_device_id ));
766766 // The following memcpy operations are supposed to be overlapped with the NB kernel
767767 if (numAtoms > 0 ) {
768+ if (mClient -> requestUpdateAtomTotalForces ()) {
769+ if (mClient -> isStartupStep ()) {
770+ set_total_forces_invalid ();
771+ } else {
772+ set_total_forces_valid ();
773+ }
774+ }
768775 if (!has_gpu_support ()) {
769776 // Transform the arrays for Colvars
770777 auto & colvars_pos = * (modify_atom_positions ());
@@ -1078,8 +1085,8 @@ bool CudaGlobalMasterColvars::requestUpdateCharges() {
10781085 return mImpl -> atomsChanged ();
10791086}
10801087
1081- void CudaGlobalMasterColvars ::setStep (int64_t step ) {
1082- CudaGlobalMasterClient ::setStep (step );
1088+ void CudaGlobalMasterColvars ::setStep (int64_t step , int startup , int doMigration ) {
1089+ CudaGlobalMasterClient ::setStep (step , startup , doMigration );
10831090 if (mImpl -> atomsChanged ()) {
10841091 mImpl -> reallocate ();
10851092 }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class CudaGlobalMasterColvars: public CudaGlobalMasterClient {
3434 int updateFromTCLCommand (const std::vector<std::string>& arguments) override ;
3535 void onBuffersUpdated () override ;
3636 void calculate () override ;
37- void setStep (int64_t step) override ;
37+ void setStep (int64_t step, int startup, int doMigration ) override ;
3838 cudaStream_t getStream () override ;
3939 bool requestedAtomsChanged () override ;
4040 bool requestedForcedAtomsChanged () override { return requestedAtomsChanged (); }
@@ -76,6 +76,7 @@ class CudaGlobalMasterColvars: public CudaGlobalMasterClient {
7676 return CudaGlobalMasterClient::replica_comm_send (msg_data, msg_len, dest_rep);
7777 }
7878 int64_t getStep () const {return m_step;}
79+ int isStartupStep () const {return m_is_startup_step;}
7980 std::string getTCLUpdateResult () override {return mTCLResult ;}
8081private:
8182 std::unique_ptr<colvarproxy_impl> mImpl ;
You can’t perform that action at this time.
0 commit comments