Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / essentialdynamics / edsam.c
index f862b6db9293131380b853bb5a0e810ecd3253e8..38be02d5236b9e5780088ebd2e8f17b16d074410 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <stdio.h>
+#include <string.h>
 #include <time.h>
-#include "typedefs.h"
-#include "string2.h"
-#include "smalloc.h"
-#include "names.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/legacyheaders/names.h"
 #include "gromacs/fileio/confio.h"
-#include "mvdata.h"
-#include "txtdump.h"
-#include "vec.h"
-#include <time.h>
-#include "nrnb.h"
-#include "mshift.h"
-#include "mdrun.h"
-#include "update.h"
-#include "physics.h"
-#include "nrjac.h"
-#include "mtop_util.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/mdlib/groupcoord.h"
 
+#include "gromacs/linearalgebra/nrjac.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* We use the same defines as in mvdata.c here */
 #define  block_bc(cr,   d) gmx_bcast(     sizeof(d),     &(d), (cr))
@@ -469,8 +467,8 @@ static void dump_edi(t_edpar *edpars, t_commrec *cr, int nr_edi)
     char   fn[STRLEN];
 
 
-    sprintf(fn, "EDdump_node%d_edi%d", cr->nodeid, nr_edi);
-    out = ffopen(fn, "w");
+    sprintf(fn, "EDdump_rank%d_edi%d", cr->nodeid, nr_edi);
+    out = gmx_ffopen(fn, "w");
 
     fprintf(out, "#NINI\n %d\n#FITMAS\n %d\n#ANALYSIS_MAS\n %d\n",
             edpars->nini, edpars->fitmas, edpars->pcamas);
@@ -502,7 +500,7 @@ static void dump_edi(t_edpar *edpars, t_commrec *cr, int nr_edi)
     fprintf(out, "buf->do_edsam         =%p\n", (void*)edpars->buf->do_edsam  );
     fprintf(out, "buf->do_radcon        =%p\n", (void*)edpars->buf->do_radcon );
 
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 
@@ -1140,7 +1138,7 @@ static void get_flood_enx_names(t_edpar *edi, char** names, int *nnames)  /* get
     {
         srenew(names, count);
         sprintf(buf, "Vfl_%d", count);
-        names[count-1] = strdup(buf);
+        names[count-1] = gmx_strdup(buf);
         actual         = actual->next_edi;
         count++;
     }
@@ -1795,6 +1793,7 @@ static int read_edi_file(const char *fn, t_edpar *edi, int nr_mdatoms)
         /* Keep the curr_edi pointer for the case that the next group is empty: */
         last_edi = curr_edi;
         /* Let's prepare to read in the next edi data set: */
+        /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
         curr_edi = edi_read;
     }
     if (edi_nr == 0)
@@ -1929,7 +1928,7 @@ void dd_make_local_ed_indices(gmx_domdec_t *dd, struct gmx_edsam *ed)
 }
 
 
-static inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec is, rvec xu)
+static gmx_inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec is, rvec xu)
 {
     int tx, ty, tz;
 
@@ -2453,7 +2452,7 @@ static void nice_legend(const char ***setname, int *nsets, char **LegendStr, cha
     sprintf(tmp, "%c %s", EDgroupchar, value);
     add_to_string_aligned(LegendStr, tmp);
     sprintf(tmp2, "%s (%s)", tmp, unit);
-    (*setname)[*nsets] = strdup(tmp2);
+    (*setname)[*nsets] = gmx_strdup(tmp2);
     (*nsets)++;
 }
 
@@ -2666,12 +2665,6 @@ void init_edsam(gmx_mtop_t   *mtop,
     matrix   fit_rotmat;                    /* ... and rotation from fit to reference structure */
     rvec    *ref_x_old = NULL;              /* helper pointer */
 
-
-    if (!DOMAINDECOMP(cr) && PAR(cr) && MASTER(cr))
-    {
-        gmx_fatal(FARGS, "Please switch on domain decomposition to use essential dynamics in parallel.");
-    }
-
     if (MASTER(cr))
     {
         fprintf(stderr, "ED: Initializing essential dynamics constraints.\n");