Merge branch 'release-4-5-patches'
authorRossen Apostolov <rossen@cbr.su.se>
Tue, 7 Sep 2010 13:19:40 +0000 (15:19 +0200)
committerRossen Apostolov <rossen@cbr.su.se>
Tue, 7 Sep 2010 13:19:40 +0000 (15:19 +0200)
src/kernel/runner.c
src/mdlib/minimize.c
src/mdlib/stat.c
src/tools/gmx_bar.c
src/tools/gmx_hbond.c

index ba6e24b4c7fb7ec20ecae6e9ff6010747ca995fe..d40bc968777486ae7117cd232aed94851e8fbebf 100644 (file)
@@ -570,7 +570,9 @@ int mdrunner(int nthreads_requested, FILE *fplog,t_commrec *cr,int nfile,
         fprintf(stderr,"Loaded with Money\n\n");
     }
 
-    if (PAR(cr) && !((Flags & MD_PARTDEC) || EI_TPI(inputrec->eI)))
+    if (PAR(cr) && !((Flags & MD_PARTDEC) ||
+                     EI_TPI(inputrec->eI) ||
+                     inputrec->eI == eiNM))
     {
         cr->dd = init_domain_decomposition(fplog,cr,Flags,ddxyz,rdd,rconstr,
                                            dddlb_opt,dlb_scale,
index ffda4608d5724ba54be7f9a46af4e9b24586ad7d..ebc766cbc8c9c34f9087e99637f90a0f03d70e6e 100644 (file)
@@ -407,8 +407,11 @@ void init_em(FILE *fplog,const char *title,
     snew(*enerd,1);
     init_enerdata(top_global->groups.grps[egcENER].nr,ir->n_flambda,*enerd);
 
-    /* Init bin for energy stuff */
-    *mdebin = init_mdebin((*outf)->fp_ene,top_global,ir,NULL); 
+    if (mdebin != NULL)
+    {
+        /* Init bin for energy stuff */
+        *mdebin = init_mdebin((*outf)->fp_ene,top_global,ir,NULL); 
+    }
 
     clear_rvec(mu_tot);
     calc_shifts(ems->s.box,fr->shift_vec);
@@ -2243,7 +2246,6 @@ double do_nm(FILE *fplog,t_commrec *cr,
              unsigned long Flags,
              gmx_runtime_t *runtime)
 {
-    t_mdebin   *mdebin;
     const char *NM = "Normal Mode Analysis";
     gmx_mdoutf_t *outf;
     int        natoms,atom,d;
@@ -2283,7 +2285,7 @@ double do_nm(FILE *fplog,t_commrec *cr,
             state_global,top_global,state_work,&top,
             &f,&f_global,
             nrnb,mu_tot,fr,&enerd,&graph,mdatoms,&gstat,vsite,constr,
-            nfile,fnm,&outf,&mdebin);
+            nfile,fnm,&outf,NULL);
     
     natoms = top_global->natoms;
     snew(fneg,natoms);
@@ -2502,9 +2504,6 @@ double do_nm(FILE *fplog,t_commrec *cr,
     
     if (MASTER(cr)) 
     {
-        print_ebin(NULL,FALSE,FALSE,FALSE,fplog,atom,t,eprAVER,
-                   FALSE,mdebin,fcd,&(top_global->groups),&(inputrec->opts));
-      
         fprintf(stderr,"\n\nWriting Hessian...\n");
         gmx_mtxio_write(ftp2fn(efMTX,nfile,fnm),sz,sz,full_matrix,sparse_matrix);
     }
index 6e6a19be75c6c7a13511d8e91bf9d5c2d343b3a8..ddf1d3b188fca4430d56e74889b965672e70daa9 100644 (file)
@@ -458,7 +458,7 @@ gmx_mdoutf_t *init_mdoutf(int nfile,const t_filenm fnm[],int mdrun_flags,
 
         sprintf(filemode, bAppendFiles ? "a+" : "w+");  
         
-        if (ir->eI != eiNM 
+        if ((EI_DYNAMICS(ir->eI) || EI_ENERGY_MINIMIZATION(ir->eI))
 #ifndef GMX_FAHCORE
             &&
             !(EI_DYNAMICS(ir->eI) &&
@@ -470,18 +470,21 @@ gmx_mdoutf_t *init_mdoutf(int nfile,const t_filenm fnm[],int mdrun_flags,
         {
             of->fp_trn = open_trn(ftp2fn(efTRN,nfile,fnm), filemode);
         }
-        if (!EI_ENERGY_MINIMIZATION(ir->eI) &&
+        if (EI_DYNAMICS(ir->eI) &&
             ir->nstxtcout > 0)
         {
             of->fp_xtc = open_xtc(ftp2fn(efXTC,nfile,fnm), filemode);
             of->xtc_prec = ir->xtcprec;
         }
-        of->fp_ene = open_enx(ftp2fn(efEDR,nfile,fnm), filemode);
+        if (EI_DYNAMICS(ir->eI) || EI_ENERGY_MINIMIZATION(ir->eI))
+        {
+            of->fp_ene = open_enx(ftp2fn(efEDR,nfile,fnm), filemode);
+        }
         of->fn_cpt = opt2fn("-cpo",nfile,fnm);
         
         if (ir->efep != efepNO && ir->nstdhdl > 0 &&
             (ir->separate_dhdl_file == sepdhdlfileYES ) && 
-            !EI_ENERGY_MINIMIZATION(ir->eI))
+            EI_DYNAMICS(ir->eI))
         {
             if (bAppendFiles)
             {
index ca4d1b676cbcce629dbaa3cd77ebb0027a770da6..f4a5657cda277033be9a56477b42603b45a45117 100644 (file)
@@ -1552,7 +1552,7 @@ static void calc_dg_stddev(sample_coll_t *ca, sample_coll_t *cb,
     for(i=0;i<cb->nsamples;i++)
     {
         samples_t *s=cb->s[i];
-        sample_range_t *r=&(ca->r[i]);
+        sample_range_t *r=&(cb->r[i]);
         if (r->use)
         {
             if (!s->hist)
index a347b58fdd490bfb0fe50aa71856cae04b2ab26e..d4769e5d73f9ef1a1c0ed944fe0edbd145445329 100644 (file)
@@ -3232,9 +3232,9 @@ int gmx_hbond(int argc,char *argv[])
     atom_id **index;
     rvec    *x,hbox;
     matrix  box;
-    real    t,ccut,dist,ang;
+    real    t,ccut,dist=0.0,ang=0.0;
     double  max_nhb,aver_nhb,aver_dist;
-    int     h,i,j,k=0,l,start,end,id,ja,ogrp,nsel;
+    int     h=0,i,j,k=0,l,start,end,id,ja,ogrp,nsel;
     int     xi,yi,zi,ai;
     int     xj,yj,zj,aj,xjj,yjj,zjj;
     int     xk,yk,zk,ak,xkk,ykk,zkk;