static void moveit(FILE *log, int left,int right,char *s,rvec xx[],t_nsborder *nsb) { rvec *temp; int i,m,bP,start,homenr; if (!xx) return; start=nsb->index[nsb->nodeid]; homenr=nsb->homenr[nsb->nodeid]; #ifdef DEBUG fprintf(log,"Moving %s for trajectory file, start=%d, homenr=%d\n", s,start,homenr); #endif snew(temp,homenr); for(i=0; (i<homenr); i++) copy_rvec(xx[start+i],temp[i]); move_rvecs(log,FALSE,FALSE,left,right,xx,NULL,nsb->nnodes-1,nsb,NULL); for(i=0; (i<homenr); i++) { bP=0; for(m=0; (m<DIM); m++) if (fabs(xx[start+i][m] - temp[i][m]) > GMX_REAL_MIN) bP=1; if (bP && log) fprintf(log,"%s[%5d] before: (%8.3f,%8.3f,%8.3f)" " After: (%8.3f,%8.3f,%8.3f)\n", s,start+i,temp[i][XX],temp[i][YY],temp[i][ZZ], xx[start+i][XX],xx[start+i][YY],xx[start+i][ZZ]); } sfree(temp); }
static void pd_collect_state(const t_commrec *cr, t_state *state) { int shift; if (debug) { fprintf(debug, "Collecting state before exchange\n"); } shift = cr->nnodes - cr->npmenodes - 1; move_rvecs(cr, FALSE, FALSE, GMX_LEFT, GMX_RIGHT, state->x, NULL, shift, NULL); if (state->v) { move_rvecs(cr, FALSE, FALSE, GMX_LEFT, GMX_RIGHT, state->v, NULL, shift, NULL); } if (state->sd_X) { move_rvecs(cr, FALSE, FALSE, GMX_LEFT, GMX_RIGHT, state->sd_X, NULL, shift, NULL); } }