Merge release-4-5-patches into release-4-6
authorRoland Schulz <roland@utk.edu>
Tue, 20 Dec 2011 12:28:48 +0000 (07:28 -0500)
committerRoland Schulz <roland@utk.edu>
Tue, 20 Dec 2011 12:28:48 +0000 (07:28 -0500)
Conflicts:
admin/GerritBuild.bat
include/gstat.h
src/tools/anadih.c
src/tools/gmx_chi.c

Change-Id: If70475e8f38978aeb52652afce2ca2a62d355987

CMakeLists.txt
admin/GerritBuild
admin/GerritBuild.bat
cmake/FindLAPACK.cmake
cmake/gmxCFlags.cmake
include/gstat.h
src/gmxlib/gmx_lapack/dlasq2.c
src/gmxlib/gmx_lapack/slasq2.c
src/tools/anadih.c
src/tools/gmx_angle.c
src/tools/gmx_chi.c

index b3f02403aff1fced8d0d107f99c8ee7bda2295d2..7ce8069f791046ef0e482948c0446d3fb7468580 100644 (file)
@@ -560,12 +560,6 @@ if (${GMX_ACCELERATION} STREQUAL "auto" AND NOT GMX_OPENMM)
 
     set(GMX_ACCELERATION "SSE" CACHE STRING "Accelerated kernels. Pick one of: auto, none, SSE, BlueGene, Power6, ia64, altivec, fortran" FORCE)
     
-    if (GMX_64_BIT)
-      set(GMX_X86_64_ASM ON CACHE BOOL "Add SSE assembly files for x86_64" FORCE)
-    else (GMX_64_BIT)
-      set(GMX_IA32_ASM ON CACHE BOOL "Add SSE assembly files for i386" FORCE)
-    endif (GMX_64_BIT)
-
     # Determine the assembler/compiler to use
   else()
     set(GMX_ACCELERATION "none" CACHE STRING "Accelerated kernels. Pick one of: auto, none, SSE, BlueGene, Power6, ia64, altivec, fortran" FORCE)
@@ -584,6 +578,12 @@ string(TOUPPER ${GMX_ACCELERATION} ${GMX_ACCELERATION})
 if(${GMX_ACCELERATION} STREQUAL "NONE")
   # nothing to do
 elseif(${GMX_ACCELERATION} STREQUAL "SSE")
+    
+    if (GMX_64_BIT)
+      set(GMX_X86_64_ASM ON CACHE BOOL "Add SSE assembly files for x86_64" FORCE)
+    else (GMX_64_BIT)
+      set(GMX_IA32_ASM ON CACHE BOOL "Add SSE assembly files for i386" FORCE)
+    endif (GMX_64_BIT)
 
     if(CMAKE_GENERATOR MATCHES "Visual Studio")
       option(GMX_ASM_USEASM-NASM "Use Nasm for assembly instead of compiler (necessary on windows)" ON)
index 58ebefa95ae7df282ac35992f54c8d5cc0a159c0..a069921f77475d05117d094408c4a783156337b8 100755 (executable)
@@ -2,6 +2,12 @@
 if [ -n "${CMakeVersion}" ] ; then
    export PATH=$HOME/tools/cmake-${CMakeVersion}/bin:$PATH
 fi
-CC=gcc-${CompilerVersion} CXX=g++-${CompilerVersion} cmake -D GMX_DOUBLE=${GMX_DOUBLE} -D GMX_MPI=${GMX_MPI} -D GMX_OPENMP=${GMX_OPENMP} -DGMX_DEFAULT_SUFFIX=off -DCMAKE_BUILD_TYPE=Debug . &&
+export CMAKE_LIBRARY_PATH=/usr/lib/atlas-base
+export CC=gcc-${CompilerVersion} 
+export CXX=g++-${CompilerVersion} 
+export FC=gfortran-${CompilerVersion} 
+cmake -D GMX_DOUBLE=${GMX_DOUBLE} -D GMX_MPI=${GMX_MPI} -D GMX_OPENMP=${GMX_OPENMP} \
+    -DGMX_EXTERNAL_BLAS=${GMX_EXTERNAL} -DGMX_EXTERNAL_LAPACK=${GMX_EXTERNAL} \
+    -DGMX_DEFAULT_SUFFIX=off -DCMAKE_BUILD_TYPE=Debug . &&
 make &&
 ctest -D ExperimentalTest -V
index f603724726900c7a756afc12a570bec5c1791ded..a3432031173ebd10377c37afd871db628a786c5d 100644 (file)
@@ -1,6 +1,6 @@
 REM Requires Windows SDK and CMake to be in the path
 REM Run Windows SDK SetEnv script
-SetEnv && ^
-cmake -G "Visual Studio 10 Win64" -D GMX_DOUBLE=%GMX_DOUBLE% -D GMX_MPI=%GMX_MPI% -D GMX_OPENMP=%GMX_OPENMP% -DGMX_DEFAULT_SUFFIX=off -DCMAKE_BUILD_TYPE=Debug . && ^
-msbuild All_Build.vcxproj && ^
-ctest -D ExperimentalTest -C Debug -V
+SetEnv /Release && ^
+cmake -G "Visual Studio 10 Win64" -D GMX_DOUBLE=%GMX_DOUBLE% -D GMX_MPI=%GMX_MPI% -D GMX_OPENMP=%GMX_OPENMP% -DGMX_DEFAULT_SUFFIX=off . && ^
+msbuild /m:2 /p:Configuration=MinSizeRel All_Build.vcxproj && ^
+ctest -D ExperimentalTest -C MinSizeRel -V
index 2eba100328f8c5f89afebb5c730c031f2b7f6c0e..58dd7e752a6f80982ac69c537628845079611595 100644 (file)
@@ -107,7 +107,7 @@ endforeach(_library ${_list})
 if(_libraries_work)
   # Test this combination of libraries.
   if(UNIX AND BLA_STATIC)
-    set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group ${${LIBRARIES}} ${_blas} -Wl,--end-group" ${_threads})
+    set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads})
   else(UNIX AND BLA_STATIC)
     set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
   endif(UNIX AND BLA_STATIC)
index 38317e72a9319c73ad3dfbb8989673db85d6c98f..21c795aa6bc8789581bb42991cc524eff1995af2 100644 (file)
@@ -105,6 +105,14 @@ MACRO(gmx_c_flags)
         GMX_TEST_CXXFLAG(CFLAGS_OPT "-qarch=auto -qtune=auto" GMXC_CXXFLAGS)
     endif()
 
+    #msvc
+    if (MSVC)
+        # disable warnings for: 
+        #      inconsistent dll linkage
+        GMX_TEST_CFLAG(CFLAGS_WARN "/wd4273" GMXC_CFLAGS)
+        GMX_TEST_CFLAG(CXXFLAGS_WARN "/wd4273" GMXC_CXXFLAGS)
+    endif()
+
 
     # now actually set the flags:
     # C
index 719fe625125e43794b70da7347e3013086b7c9f0..7eb47ecfd45f1cf3ffd9dbb4f721eebb4b06ba9a 100644 (file)
@@ -240,7 +240,7 @@ void expfit(int n, real x[], real y[], real Dy[],
 
 void ana_dih_trans(const char *fn_trans,const char *fn_histo,
                          real **dih,int nframes,int nangles,
-                         const char *grpname,real t0,real dt,gmx_bool bRb,
+                         const char *grpname,real *time,gmx_bool bRb,
                           const output_env_t oenv);
 /*
  * Analyse dihedral transitions, by counting transitions per dihedral
@@ -260,7 +260,7 @@ void ana_dih_trans(const char *fn_trans,const char *fn_histo,
  * nframes   number of times frames
  * nangles   number of angles
  * grpname   a string for the header of plots
- * t0,dt     starting time resp. time between time frames
+ * time      array (size nframes) of times of trajectory frames
  * bRb       determines whether the polymer convention is used
  *           (trans = 0)
  */
@@ -269,7 +269,7 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
                              gmx_bool bHisto, const char *fn_histo, int maxchi, 
                              real **dih, int nlist, t_dlist dlist[], 
                               int nframes, int nangles, const char *grpname, 
-                              int multiplicity[], real t0, real dt, gmx_bool bRb, 
+                              int multiplicity[], real *time, gmx_bool bRb,
                               real core_frac, const output_env_t oenv); 
   /* as above but passes dlist so can copy occupancies into it, and multiplicity[] 
    *  (1..nangles, corresp to dih[this][], so can have non-3 multiplicity of
index c6af4d76366c5965e66c9be9040df1c932ae4d25..e45a93b67a953f2b20ad712c9b37a1aa2852e743 100644 (file)
@@ -4,6 +4,10 @@
 
 #include <types/simple.h>
 
+#ifdef _MSC_VER
+#pragma warning(disable: 4723) /*division by zero - is used on purpose here*/
+#endif
+
 void 
 F77_FUNC(dlasq2,DLASQ2)(int *n, 
                         double *z__, 
index f385eaf1810bcd122a3730640c0e3c673e47d426..98660fc32085fbf0f21b48225205cd9f61e80a96 100644 (file)
@@ -4,6 +4,10 @@
 
 #include <types/simple.h>
 
+#ifdef _MSC_VER
+#pragma warning(disable: 4723) /*division by zero - is used on purpose here*/
+#endif
+
 void 
 F77_FUNC(slasq2,SLASQ2)(int *n, 
                         float *z__, 
index c3c32dbaff19ae14d63ec0afab02f1a0563e1cdd..0a9f5a652e1f2bef311e21ec3d3292c2ce1f4dfc 100644 (file)
@@ -113,7 +113,7 @@ static int calc_Nbin(real phi, int multiplicity, real core_frac)
 
 void ana_dih_trans(const char *fn_trans,const char *fn_histo,
                   real **dih,int nframes,int nangles,
-                  const char *grpname,real t0,real dt,gmx_bool bRb,
+                  const char *grpname,real *time,gmx_bool bRb,
                    const output_env_t oenv)
 {
   /* just a wrapper; declare extra args, then chuck away at end. */ 
@@ -131,7 +131,7 @@ void ana_dih_trans(const char *fn_trans,const char *fn_histo,
 
   low_ana_dih_trans(TRUE, fn_trans,TRUE, fn_histo, maxchi, 
                     dih, nlist, dlist, nframes,
-                   nangles, grpname, multiplicity, t0, dt, bRb, 0.5,oenv); 
+                   nangles, grpname, multiplicity, time, bRb, 0.5,oenv);
   sfree(dlist); 
   sfree(multiplicity); 
   
@@ -140,8 +140,8 @@ void ana_dih_trans(const char *fn_trans,const char *fn_histo,
 void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
                       gmx_bool bHisto, const char *fn_histo, int maxchi, 
                       real **dih, int nlist, t_dlist dlist[], int nframes,
-                      int nangles, const char *grpname, int multiplicity[], 
-                      real t0, real dt, gmx_bool bRb, real core_frac,
+                      int nangles, const char *grpname, int multiplicity[],
+                      real *time, gmx_bool bRb, real core_frac,
                        const output_env_t oenv)
 {
   FILE *fp;
@@ -152,6 +152,13 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
   real ttime,tt;
   real *rot_occ[NROT] ; 
   int  (*calc_bin)(real,int,real);  
+  real dt;
+
+  if (1 <= nframes) {
+    return;
+  }
+  /* Assumes the frames are equally spaced in time */
+  dt=(time[nframes-1]-time[0])/(nframes-1);
   
   /* Analysis of dihedral transitions */
   fprintf(stderr,"Now calculating transitions...\n");
@@ -248,8 +255,7 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
     sprintf(title,"Number of transitions: %s",grpname);
     fp=xvgropen(fn_trans,title,"Time (ps)","# transitions/timeframe",oenv);
     for(j=0; (j<nframes); j++) {
-      tt = t0+j*dt;
-      fprintf(fp,"%10.3f  %10d\n",tt,tr_f[j]);
+      fprintf(fp,"%10.3f  %10d\n",time[j],tr_f[j]);
     }
     ffclose(fp);
   }
index fa7b4fe10ceaf772c7f32295f3faa9542f7e3bf3..af00d9175755ad7b0e2051ab769aa95cc57864bb 100644 (file)
@@ -107,7 +107,11 @@ int gmx_g_angle(int argc,char *argv[])
     "If this is not the case, the program will crash.[PAR]",
     "With option [TT]-or[tt] a trajectory file is dumped containing cos and",
     "sin of selected dihedral angles which subsequently can be used as",
-    "input for a PCA analysis using [TT]g_covar[tt]."
+    "input for a PCA analysis using [TT]g_covar[tt].[PAR]",
+    "Option [TT]-ot[tt] plots when transitions occur between",
+    "dihedral rotamers of multiplicity 3 and [TT]-oh[tt]",
+    "records a histogram of the times between such transitions,",
+    "assuming the input trajectory frames are equally spaced in time."
   };
   static const char *opt[] = { NULL, "angle", "dihedral", "improper", "ryckaert-bellemans", NULL };
   static gmx_bool bALL=FALSE,bChandler=FALSE,bAverCorr=FALSE,bPBC=TRUE;
@@ -289,7 +293,7 @@ int gmx_g_angle(int argc,char *argv[])
   
   if (bTrans) 
     ana_dih_trans(opt2fn("-ot",NFILE,fnm),opt2fn("-oh",NFILE,fnm),
-                 dih,nframes,nangles,grpname,time[0],dt,bRb,oenv);
+                 dih,nframes,nangles,grpname,time,bRb,oenv);
                  
   if (bCorr) {
     /* Autocorrelation function */
index 94db178b6b71ba096df2def57e8b4baedccd8b13..60ebc2901306767e5796a384bb400adc9ea791a2 100644 (file)
@@ -1040,7 +1040,9 @@ int gmx_chi(int argc,char *argv[])
     "The total number of rotamer transitions per timestep", 
     "(argument [TT]-ot[tt]), the number of transitions per rotamer", 
     "(argument [TT]-rt[tt]), and the ^3J couplings (argument [TT]-jc[tt]), ", 
-    "can also be written to [TT].xvg[tt] files.[PAR]", 
+    "can also be written to [TT].xvg[tt] files. Note that the analysis",
+    "of rotamer transitions assumes that the supplied trajectory frames",
+    "are equally spaced in time.[PAR]",
 
     "If [TT]-chi_prod[tt] is set (and [TT]-maxchi[tt] > 0), cumulative rotamers, e.g.", 
     "1+9([GRK]chi[grk]1-1)+3([GRK]chi[grk]2-1)+([GRK]chi[grk]3-1) (if the residue has three 3-fold ", 
@@ -1271,7 +1273,7 @@ int gmx_chi(int argc,char *argv[])
   low_ana_dih_trans(bDo_ot, opt2fn("-ot",NFILE,fnm),
                    bDo_oh, opt2fn("-oh",NFILE,fnm),maxchi, 
                    dih, nlist, dlist, nf, nactdih, grpname, multiplicity, 
-                   *time,  dt, FALSE, core_frac,oenv) ; 
+                   time, FALSE, core_frac,oenv);
 
   /* Order parameters */  
   order_params(log,opt2fn("-o",NFILE,fnm),maxchi,nlist,dlist,