Merge release-4-6 into master
authorRoland Schulz <roland@utk.edu>
Tue, 31 Dec 2013 00:18:23 +0000 (19:18 -0500)
committerRoland Schulz <roland@utk.edu>
Wed, 1 Jan 2014 02:17:20 +0000 (21:17 -0500)
Conflicts:
Only version:
CMakeLists.txt
admin/installguide/installguide.tex
share/html/online/mdp_opt.html
Other:
admin/mkhtml (deleted in master)
cmake/gmxCFlags.cmake (gcc 4.8 change ignored)

Changes other than conflicts:
        src/gromacs/gmxlib/gmx_detect_hardware.c (fix compile errors)

Change-Id: Id5845638857fd84ffaeac618d5286a2d23967f7f

src/contrib/fftw/CMakeLists.txt
src/gromacs/gmxana/gmx_make_edi.c
src/gromacs/gmxlib/gmx_detect_hardware.c
src/gromacs/mdlib/edsam.c

index 27a188dd4a81c982a48e2cf9f009a57f89fad375..050a9e1f05d7b0d0c693419893d819fcc49e96b2 100644 (file)
@@ -72,7 +72,7 @@ message(WARNING "The GROMACS build will download FFTW ${EXTERNAL_FFTW_VERSION} a
 # md5sum check to avoid needing the above warning
     ExternalProject_add(fftwBuild
         URL "http://www.fftw.org/fftw-${EXTERNAL_FFTW_VERSION}.tar.gz"
-        CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib
+        CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib --disable-fortran
         ${GMX_BUILD_OWN_FFTW_SHARED_FLAG} ${GMX_BUILD_OWN_FFTW_OPTIMIZATION_CONFIGURATION}
         ${GMX_BUILD_OWN_FFTW_PREC})
 externalproject_get_property(fftwBuild INSTALL_DIR)
index 9869237c72fce889f224fe32966ea8163f9acdc2..a732f1e04b6789477277963f0a8f974a3038c41b 100644 (file)
@@ -678,7 +678,7 @@ int gmx_make_edi(int argc, char *argv[])
     static const char* evStepOptions[evStepNr] = {"-linstep", "-accdir", "-not_used", "-radstep"};
     static const char* ConstForceStr;
     static real      * evStepList[evStepNr];
-    static real        radfix   = 0.0;
+    static real        radstep  = 0.0;
     static real        deltaF0  = 150;
     static real        deltaF   = 0;
     static real        tau      = .1;
@@ -714,7 +714,7 @@ int gmx_make_edi(int argc, char *argv[])
           "Stepsizes (nm/step) for fixed increment linear sampling (put in quotes! \"1.0 2.3 5.1 -3.1\")"},
         { "-accdir", FALSE, etSTR, {&evParams[1]},
           "Directions for acceptance linear sampling - only sign counts! (put in quotes! \"-1 +1 -1.1\")"},
-        { "-radstep", FALSE, etREAL, {&radfix},
+        { "-radstep", FALSE, etREAL, {&radstep},
           "Stepsize (nm/step) for fixed increment radius expansion"},
         { "-maxedsteps", FALSE, etINT, {&edi_params.maxedsteps},
           "Maximum number of steps per cycle" },
@@ -820,12 +820,12 @@ int gmx_make_edi(int argc, char *argv[])
                     }
                 }
             }
-            else if (ev_class == evRADFIX && opt2parg_bSet(evStepOptions[ev_class], NPA, pa))
+            else if (ev_class == evRADFIX)
             {
                 snew(evStepList[ev_class], nvecs);
                 for (i = 0; i < nvecs; i++)
                 {
-                    evStepList[ev_class][i] = radfix;
+                    evStepList[ev_class][i] = radstep;
                 }
             }
             else if (ev_class == evFLOOD)
index 3cc1358633a0cd5cc28cca3d2a3f5161bd4a0656..7274187626040991b722337dffa6b9295b5208c4 100644 (file)
@@ -56,6 +56,7 @@
 #include "gmx_detect_hardware.h"
 #include "main.h"
 #include "md_logging.h"
+#include "gromacs/utility/gmxomp.h"
 
 #include "thread_mpi/threads.h"
 
@@ -481,7 +482,7 @@ static int gmx_count_gpu_dev_unique(const gmx_gpu_info_t *gpu_info,
  * We assume that this is equal with the number of CPUs reported to be
  * online by the OS at the time of the call.
  */
-static int get_nthreads_hw_avail(const t_commrec gmx_unused *cr)
+static int get_nthreads_hw_avail(FILE gmx_unused *fplog, const t_commrec gmx_unused *cr)
 {
     int ret = 0;
 
@@ -517,7 +518,7 @@ static int get_nthreads_hw_avail(const t_commrec gmx_unused *cr)
                 "of supported hardware threads.\n", ret);
     }
 
-#ifdef GMX_OMPENMP
+#ifdef GMX_OPENMP
     if (ret != gmx_omp_get_num_procs())
     {
         md_print_warn(cr, fplog,
@@ -633,7 +634,7 @@ gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
         }
 
         /* detect number of hardware threads */
-        hwinfo_g->nthreads_hw_avail = get_nthreads_hw_avail(cr);
+        hwinfo_g->nthreads_hw_avail = get_nthreads_hw_avail(fplog, cr);
 
         /* detect GPUs */
         hwinfo_g->gpu_info.ncuda_dev            = 0;
index d0bccbc811d4a9f84271e336d29e9df6b24b24f8..737eecddd067041a153f45851592dc5ffbe5eba6 100644 (file)
@@ -90,7 +90,7 @@ typedef struct
     real   *xproj;   /* instantaneous x projections    */
     real   *fproj;   /* instantaneous f projections    */
     real    radius;  /* instantaneous radius           */
-    real   *refproj; /* starting or target projecions  */
+    real   *refproj; /* starting or target projections */
     /* When using flooding as harmonic restraint: The current reference projection
      * is at each step calculated from the initial refproj0 and the slope. */
     real  *refproj0, *refprojslope;
@@ -176,8 +176,6 @@ typedef struct edpar
     t_edvecs            vecs;         /* eigenvectors                         */
     real                slope;        /* minimal slope in acceptance radexp   */
 
-    gmx_bool            bNeedDoEdsam; /* if any of the options mon, linfix, ...
-                                       * is used (i.e. apart from flooding)   */
     t_edflood           flood;        /* parameters especially for flooding   */
     struct t_ed_buffer *buf;          /* handle to local buffers              */
     struct edpar       *next_edi;     /* Pointer to another ED group          */
@@ -234,6 +232,19 @@ static void write_edo_legend(gmx_edsam_t ed, int nED, const output_env_t oenv);
 /* End function declarations */
 
 
+/* Do we have to perform essential dynamics constraints or possibly only flooding
+ * for any of the ED groups? */
+static gmx_bool bNeedDoEdsam(t_edpar *edi)
+{
+    return     edi->vecs.mon.neig
+            || edi->vecs.linfix.neig
+            || edi->vecs.linacc.neig
+            || edi->vecs.radfix.neig
+            || edi->vecs.radacc.neig
+            || edi->vecs.radcon.neig;
+}
+
+
 /* Multiple ED groups will be labeled with letters instead of numbers
  * to avoid confusion with eigenvector indices */
 static char get_EDgroupChar(int nr_edi, int nED)
@@ -337,7 +348,7 @@ static void project(rvec      *x,     /* positions to project */
                     t_edpar   *edi)   /* edi data set */
 {
     /* It is not more work to subtract the average position in every
-     * subroutine again, because these routines are rarely used simultanely */
+     * subroutine again, because these routines are rarely used simultaneously */
     project_to_eigvectors(x, &edi->vecs.mon, edi);
     project_to_eigvectors(x, &edi->vecs.linfix, edi);
     project_to_eigvectors(x, &edi->vecs.linacc, edi);
@@ -2476,15 +2487,6 @@ static void write_edo_legend(gmx_edsam_t ed, int nED, const output_env_t oenv)
 
     for (nr_edi = 1; nr_edi <= nED; nr_edi++)
     {
-        /* Remember for each ED group whether we have to do essential dynamics
-         * constraints or possibly only flooding */
-        edi->bNeedDoEdsam = edi->vecs.mon.neig
-            || edi->vecs.linfix.neig
-            || edi->vecs.linacc.neig
-            || edi->vecs.radfix.neig
-            || edi->vecs.radacc.neig
-            || edi->vecs.radcon.neig;
-
         fprintf(ed->edo, "#\n");
         fprintf(ed->edo, "# Summary of applied con/restraints for the ED group %c\n", get_EDgroupChar(nr_edi, nED));
         fprintf(ed->edo, "# Atoms in average structure: %d\n", edi->sav.nr);
@@ -2602,7 +2604,7 @@ static void write_edo_legend(gmx_edsam_t ed, int nED, const output_env_t oenv)
     edi         = ed->edpar;
     for (nr_edi = 1; nr_edi <= nED; nr_edi++)
     {
-        if (edi->bNeedDoEdsam) /* Only print ED legend if at least one ED option is on */
+        if ( bNeedDoEdsam(edi) ) /* Only print ED legend if at least one ED option is on */
         {
             nice_legend(&setname, &nsets, &LegendStr, "RMSD to ref", "nm", get_EDgroupChar(nr_edi, nED) );
 
@@ -2658,6 +2660,7 @@ void init_edsam(gmx_mtop_t   *mtop,  /* global topology                    */
     rvec    *xfit   = NULL, *xstart = NULL; /* dummy arrays to determine initial RMSDs  */
     rvec     fit_transvec;                  /* translation ... */
     matrix   fit_rotmat;                    /* ... and rotation from fit to reference structure */
+    rvec    *ref_x_old = NULL;              /* helper pointer */
 
 
     if (!DOMAINDECOMP(cr) && PAR(cr) && MASTER(cr))
@@ -2701,13 +2704,13 @@ void init_edsam(gmx_mtop_t   *mtop,  /* global topology                    */
      * not before dd_partition_system which is called after init_edsam */
     if (MASTER(cr))
     {
-        /* Remove pbc, make molecule whole.
-         * When ir->bContinuation=TRUE this has already been done, but ok.
-         */
-        snew(x_pbc, mtop->natoms);
-        m_rveccopy(mtop->natoms, x, x_pbc);
-        do_pbc_first_mtop(NULL, ir->ePBC, box, mtop, x_pbc);
-
+        if (!EDstate->bFromCpt)
+        {
+            /* Remove PBC, make molecule(s) subject to ED whole. */
+            snew(x_pbc, mtop->natoms);
+            m_rveccopy(mtop->natoms, x, x_pbc);
+            do_pbc_first_mtop(NULL, ir->ePBC, box, mtop, x_pbc);
+        }
         /* Reset pointer to first ED data set which contains the actual ED data */
         edi = ed->edpar;
         /* Loop over all ED/flooding data sets (usually only one, though) */
@@ -2744,7 +2747,16 @@ void init_edsam(gmx_mtop_t   *mtop,  /* global topology                    */
                the size of the buffers is likely different for every ED group */
             srenew(xfit, edi->sref.nr );
             srenew(xstart, edi->sav.nr  );
-            copy_rvecn(edi->sref.x_old, xfit, 0, edi->sref.nr);
+            if (edi->bRefEqAv)
+            {
+                /* Reference indices are the same as average indices */
+                ref_x_old = edi->sav.x_old;
+            }
+            else
+            {
+                ref_x_old = edi->sref.x_old;
+            }
+            copy_rvecn(ref_x_old, xfit, 0, edi->sref.nr);
             copy_rvecn(edi->sav.x_old, xstart, 0, edi->sav.nr);
 
             /* Make the fit to the REFERENCE structure, get translation and rotation */
@@ -2884,7 +2896,10 @@ void init_edsam(gmx_mtop_t   *mtop,  /* global topology                    */
             edi = edi->next_edi;
         }
         /* Cleaning up on the master node: */
-        sfree(x_pbc);
+        if (!EDstate->bFromCpt)
+        {
+            sfree(x_pbc);
+        }
         sfree(xfit);
         sfree(xstart);
 
@@ -2945,8 +2960,8 @@ void init_edsam(gmx_mtop_t   *mtop,  /* global topology                    */
     edi = ed->edpar;
     for (nr_edi = 1; nr_edi <= EDstate->nED; nr_edi++)
     {
-        /* Allocate space for ED buffer */
-        snew(edi->buf, 1);
+        /* Allocate space for ED buffer variables */
+        snew_bc(cr, edi->buf, 1); /* MASTER has already allocated edi->buf in init_edi() */
         snew(edi->buf->do_edsam, 1);
 
         /* Space for collective ED buffer variables */
@@ -3024,14 +3039,14 @@ void do_edsam(t_inputrec     *ir,
     while (edi != NULL)
     {
         edinr++;
-        if (edi->bNeedDoEdsam)
+        if ( bNeedDoEdsam(edi) )
         {
 
             buf = edi->buf->do_edsam;
 
             if (ed->bFirst)
             {
-                /* initialise radacc radius for slope criterion */
+                /* initialize radacc radius for slope criterion */
                 buf->oldrad = calc_radius(&edi->vecs.radacc);
             }
 
@@ -3163,7 +3178,7 @@ void do_edsam(t_inputrec     *ir,
                     copy_rvec(x_unsh, xs[edi->sav.anrs_loc[i]]);
                 }
             }
-        } /* END of if (edi->bNeedDoEdsam) */
+        } /* END of if ( bNeedDoEdsam(edi) ) */
 
         /* Prepare for the next ED group */
         edi = edi->next_edi;