Merge "made SHAKE work again with particle decompostion" into release-4-6
authorErik Lindahl <erik@kth.se>
Fri, 11 Jan 2013 23:22:07 +0000 (00:22 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 11 Jan 2013 23:22:07 +0000 (00:22 +0100)
12 files changed:
cmake/gmxManageGPU.cmake
src/gmxlib/gmx_detect_hardware.c
src/gmxlib/gmx_omp_nthreads.c
src/gmxlib/sfactor.c
src/kernel/hizzie.c
src/kernel/readir.c
src/kernel/runner.c
src/mdlib/domdec.c
src/mdlib/gmx_wallcycle.c
src/mdlib/sim_util.c
src/tools/gmx_genpr.c
src/tools/gmx_rmsf.c

index 2d0121555a1a26cba4dc94538b8398d4120dde87..2ad6661fedab67eac1f46c24152c1df237f97bea 100644 (file)
@@ -52,14 +52,14 @@ if(GMX_GPU_AUTO AND GMX_DOUBLE)
 endif()
 
 # detect GPUs in the build host machine
-if (GMX_GPU OR GMX_GPU_AUTO AND NOT GMX_GPU_DETECTION_DONE)
+if ((GMX_GPU OR GMX_GPU_AUTO) AND NOT GMX_GPU_DETECTION_DONE)
     include(gmxDetectGpu)
     gmx_detect_gpu()
 endif()
 
 # We need to call find_package even when we've already done the detection/setup
 if(GMX_GPU OR GMX_GPU_AUTO)
-    if(NOT GMX_GPU AND GMX_GPU_AUTO AND GMX_GPU_DETECTION_DONE)
+    if(NOT GMX_GPU AND NOT GMX_DETECT_GPU_AVAILABLE)
         # Stay quiet when detection has occured and found no GPU.
         # Noise is acceptable when there is a GPU or the user required one.
         set(FIND_CUDA_QUIETLY QUIET)
@@ -80,7 +80,7 @@ endif()
 # - ON , FALSE: The user requested GPU builds, will require CUDA and will fail
 #               if it is not available.
 # - ON , TRUE : Can't happen (GMX_GPU=ON can only be user-set at this point)
-if(GMX_GPU OR GMX_GPU_AUTO AND NOT GMX_GPU_DETECTION_DONE)
+if((GMX_GPU OR GMX_GPU_AUTO) AND NOT GMX_GPU_DETECTION_DONE)
     if (EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
         set(CUDA_FOUND TRUE CACHE INTERNAL "Whether the CUDA toolkit was found" FORCE)
     else()
@@ -142,6 +142,9 @@ endif()
 # user turns GMX_GPU=OFF after a failed cmake pass, these variables will be
 # left behind in the cache.
 mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_SDK_ROOT_DIR CUDA_VERBOSE_BUILD)
+if(NOT GMX_GPU)
+    mark_as_advanced(CUDA_TOOLKIT_ROOT_DIR)
+endif()
 
 macro(gmx_gpu_setup)
     # set up nvcc options
index ad3dd9488a4e661d0254acea985ee7a9873b6715..fe4ca975a4df59d120570293e406a9039c1308ba 100644 (file)
@@ -139,7 +139,7 @@ static void print_gpu_use_stats(FILE *fplog,
     }
     else
     {
-        sprintf(sbuf, "%d GPU%s %sselected to be used for this run: ",
+        sprintf(sbuf, "%d GPU%s %sselected for this run: ",
                 ngpu, (ngpu > 1) ? "s" : "",
                 gpu_info->bUserSet ? "user-" : "auto-");
         for (i = 0; i < ngpu; i++)
index 4cbdfca374fe80dd876bc673c1a23ab1fd021e71..f05ce9e895361c79e6936c209e3c77092cb80479 100644 (file)
@@ -382,7 +382,7 @@ void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
 #endif
 
     /* inform the user about the settings */
-    if (SIMMASTER(cr) && bOMP)
+    if (bOMP)
     {
 #ifdef GMX_THREAD_MPI
         const char *mpi_str="per tMPI thread";
@@ -393,15 +393,15 @@ void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
         /* for group scheme we print PME threads info only */
         if (bFullOmpSupport)
         {
-            fprintf(stderr, "Using %d OpenMP thread%s %s\n",
-                    modth.gnth,modth.gnth > 1 ? "s" : "",
-                    cr->nnodes > 1 ? mpi_str : "");
+            md_print_info(cr, fplog, "Using %d OpenMP thread%s %s\n",
+                          modth.gnth,modth.gnth > 1 ? "s" : "",
+                          cr->nnodes > 1 ? mpi_str : "");
         }
         if (bSepPME && modth.gnth_pme != modth.gnth)
         {
-            fprintf(stderr, "Using %d OpenMP thread%s %s for PME\n",
-                    modth.gnth_pme,modth.gnth_pme > 1 ? "s" : "",
-                    cr->nnodes > 1 ? mpi_str : "");
+            md_print_info(cr, fplog, "Using %d OpenMP thread%s %s for PME\n",
+                          modth.gnth_pme,modth.gnth_pme > 1 ? "s" : "",
+                          cr->nnodes > 1 ? mpi_str : "");
         }
     }
 
index 76bf1a3a5a9faf7d0de83b46b3d5ea20a953a25c..345598589d1a8ac9b11065683ce78475a8db70f6 100644 (file)
@@ -134,7 +134,6 @@ extern t_complex *** rc_tensor_allocation(int x, int y, int z)
   t_complex ***t;
   int i,j;
 
-  snew(t,x);
   t = (t_complex ***)calloc(x,sizeof(t_complex**));
   if(!t) exit(fprintf(stderr,"\nallocation error"));
   t[0] = (t_complex **)calloc(x*y,sizeof(t_complex*));
index 16e8baac4a75e2e82340b750fa917b7008bd3367..8810780bb57dd525afb5270ff5588de54d66bb7d 100644 (file)
@@ -215,7 +215,7 @@ void set_histp(t_atoms *pdba,rvec *x,real angle,real dist){
   /* A histidine residue exists that requires automated assignment, so
    * doing the analysis of donors and acceptors is worthwhile. */
   fprintf(stderr,
-         "Analysing hydrogen-bonding network for automated assigment of histidine\n"
+         "Analysing hydrogen-bonding network for automated assignment of histidine\n"
          " protonation.");
 
   snew(donor,natom);
index 3826994673b41e34b5487fdd8d7a585edca4707e..e22db5cacfcabd901c8917e73a0afa9604f3dd9b 100644 (file)
@@ -1647,7 +1647,7 @@ void get_ir(const char *mdparin,const char *mdparout,
   EETYPE("DispCorr",    ir->eDispCorr,  edispc_names);
   CTYPE ("Extension of the potential lookup tables beyond the cut-off");
   RTYPE ("table-extension", ir->tabext, 1.0);
-  CTYPE ("Seperate tables between energy group pairs");
+  CTYPE ("Separate tables between energy group pairs");
   STYPE ("energygrp-table", egptable,   NULL);
   CTYPE ("Spacing for the PME/PPPM FFT grid");
   RTYPE ("fourierspacing", ir->fourier_spacing,0.12);
index be3ed6b310c9a3a60ccdd5bdd9a496c62ef6936d..d323bf65afc3e7f45b4c176497b373f5350793b4 100644 (file)
@@ -263,8 +263,6 @@ static t_commrec *mdrunner_start_threads(gmx_hw_opt_t *hw_opt,
     mda->deviceOptions=deviceOptions;
     mda->Flags=Flags;
 
-    fprintf(stderr, "Starting %d tMPI threads\n",hw_opt->nthreads_tmpi);
-    fflush(stderr);
     /* now spawn new threads that start mdrunner_start_fn(), while 
        the main thread returns */
     ret=tMPI_Init_fn(TRUE, hw_opt->nthreads_tmpi,
@@ -1689,6 +1687,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
                   cr->nnodes==1 ? "process" : "processes"
 #endif
                   );
+    fflush(stderr);
 #endif
 
     gmx_omp_nthreads_init(fplog, cr,
index 2f19d21b3b39fbdd665e5720ac333fa245dcffc9..9d6bdc6c38965c59b931e8ea11dd75a9c32e507c 100644 (file)
@@ -5345,7 +5345,7 @@ static void print_dd_load_av(FILE *fplog,gmx_domdec_t *dd)
         if (lossf >= DD_PERF_LOSS)
         {
             sprintf(buf,
-                    "NOTE: %.1f %% performance was lost due to load imbalance\n"
+                    "NOTE: %.1f %% of the available CPU time was lost due to load imbalance\n"
                     "      in the domain decomposition.\n",lossf*100);
             if (!comm->bDynLoadBal)
             {
index 4b3c1ec4ec972009dee8254298a6f6d51948311f..324f17d88472d488dbb01e64f29ba1d3b1f080c3 100644 (file)
@@ -725,7 +725,7 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime,
         fprintf(fplog, "%s\n", hline);
 
         gpu_cpu_ratio = tot_gpu/tot_cpu_overlap;
-        fprintf(fplog, "\n Force evaluation time GPU/CPU: %.3f ms/%.3f ms = %.3f\n",
+        fprintf(fplog, "\nForce evaluation time GPU/CPU: %.3f ms/%.3f ms = %.3f\n",
                 tot_gpu/gpu_t->nb_c, tot_cpu_overlap/wc->wcc[ewcFORCE].n,
                 gpu_cpu_ratio);
 
@@ -747,9 +747,9 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime,
                          * but we currently can't check that here.
                          */
                         md_print_warn(NULL,fplog,
-                                      "NOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n"
+                                      "\nNOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n"
                                       "      performance loss. Maybe the domain decomposition limits the PME tuning.\n"
-                                      "      In that case, try setting the DD grid manually (-dd) or lowering -dds.\n");
+                                      "      In that case, try setting the DD grid manually (-dd) or lowering -dds.");
                     }
                     else
                     {
@@ -757,15 +757,15 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime,
                          * too small for increasing the cut-off for PME tuning.
                          */
                         md_print_warn(NULL,fplog,
-                                      "NOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n"
-                                      "      performance loss.\n");
+                                      "\nNOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n"
+                                      "      performance loss.");
                     }
                 }
                 if (gpu_cpu_ratio > 1.2)
                 {
                     md_print_warn(NULL,fplog,
-                                  "NOTE: The GPU has >20%% more load than the CPU. This imbalance causes\n"
-                                  "      performance loss, consider using a shorter cut-off and a finer PME grid.\n");
+                                  "\nNOTE: The GPU has >20%% more load than the CPU. This imbalance causes\n"
+                                  "      performance loss, consider using a shorter cut-off and a finer PME grid.");
                 }
             }
         }
index eb9f636140116ec2adad8531460842b5057c0013..8f211715d9f1a6c824dda0d07fb4dd4a125b1daf 100644 (file)
@@ -1318,7 +1318,10 @@ void do_force_cutsVERLET(FILE *fplog,t_commrec *cr,
             wallcycle_stop(wcycle,ewcWAIT_GPU_NB_L);
 
             /* now clear the GPU outputs while we finish the step on the CPU */
+
+            wallcycle_start_nocount(wcycle,ewcLAUNCH_GPU_NB);
             nbnxn_cuda_clear_outputs(nbv->cu_nbv, flags);
+            wallcycle_stop(wcycle,ewcLAUNCH_GPU_NB);
         }
         else
         {            
index 705d7a5da36a17b619fe497c297a3b3b7eae0c80..bf86a3e467ee1cecc0c3a8b7dca9fc09c4ae45e5 100644 (file)
@@ -137,7 +137,7 @@ int gmx_genpr(int argc,char *argv[])
   nfn     = opt2fn_null("-n",NFILE,fnm);
   
   if (( nfn == NULL ) && ( xfn == NULL))
-    gmx_fatal(FARGS,"no index file and no structure file suplied");
+    gmx_fatal(FARGS,"no index file and no structure file supplied");
       
   if ((disre_frac < 0) || (disre_frac >= 1))
     gmx_fatal(FARGS,"disre_frac should be between 0 and 1");
index 321d6b099d8ad56bb978ab49b965ce298809dff1..b3471401024f06ac4ffe7986ebeff82753cb965c 100644 (file)
@@ -426,7 +426,7 @@ int gmx_rmsf(int argc,char *argv[])
                                 *(top.atoms.atomname[index[i]]));
        
        fprintf(fp,"%5d  %10.5f  %10.5f\n",
-               bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : i+1,rmsf[i]*bfac,
+               bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : index[i]+1,rmsf[i]*bfac,
                pdb_bfac);
       }
     }
@@ -437,7 +437,7 @@ int gmx_rmsf(int argc,char *argv[])
       if (!bRes || i+1==isize ||
          top.atoms.atom[index[i]].resind!=top.atoms.atom[index[i+1]].resind)
        fprintf(fp,"%5d %8.4f\n",
-               bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : i+1,sqrt(rmsf[i]));
+               bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : index[i]+1,sqrt(rmsf[i]));
     ffclose(fp);
   }
   
@@ -455,7 +455,7 @@ int gmx_rmsf(int argc,char *argv[])
       if (!bRes || i+1==isize ||
          top.atoms.atom[index[i]].resind!=top.atoms.atom[index[i+1]].resind)
        fprintf(fp,"%5d %8.4f\n",
-               bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : i+1,sqrt(rmsf[i]));
+               bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : index[i]+1,sqrt(rmsf[i]));
     ffclose(fp);
   }