diff --git a/CHANGES/v2.1.txt b/CHANGES/v2.1.txt index f6a90c05c6e28d6af8fbd24bbdba3a23931aa3f8..24d99aca9396e2049d33df254777432e2e59e529 100644 --- a/CHANGES/v2.1.txt +++ b/CHANGES/v2.1.txt @@ -133,5 +133,6 @@ This release will include all the fixes available in branch 2.0. For users: - Small fixes in documentation. - CS2Backbone: fixed a bug that resulted in only a fraction of the chemical shifts being printed with WRITE_CS and parallel simulations + (requires to get the last almost updated from SVN) */ diff --git a/src/colvar/CS2Backbone.cpp b/src/colvar/CS2Backbone.cpp index 2b23745787836c17f92d4493e43fb87bc5679834..e2811128f6590efd25f19786a8979d8931243029 100644 --- a/src/colvar/CS2Backbone.cpp +++ b/src/colvar/CS2Backbone.cpp @@ -353,6 +353,14 @@ void CS2Backbone::calculate() cam_list[0].ens_return_shifts(coor, sh); if(!serial) comm.Sum(&sh[0][0], numResidues*6); + bool printout=false; + if(pperiod>0&&comm.Get_rank()==0) printout = (!(getStep()%pperiod)); + if(printout) { + char tmp1[21]; sprintf(tmp1, "%ld", getStep()); + string csfile = string("cs-")+getLabel()+"-"+tmp1+string(".dat");; + cam_list[0].printout_chemical_shifts(csfile.c_str(), sh); + } + double fact=1.0; if(ensemble) { fact = 1./((double) ens_dim); @@ -369,14 +377,6 @@ void CS2Backbone::calculate() double energy = cam_list[0].ens_energy_force(coor, csforces, sh); if(!serial) comm.Sum(&csforces[0][0], N*4); - bool printout=false; - if(pperiod>0&&comm.Get_rank()==0) printout = (!(getStep()%pperiod)); - if(printout) { - char tmp1[21]; sprintf(tmp1, "%ld", getStep()); - string csfile = string("cs-")+getLabel()+"-"+tmp1+string(".dat");; - cam_list[0].printout_chemical_shifts(csfile.c_str()); - } - Tensor virial; virial.zero(); double ff=fact*for_pl2alm;