Merge release-5-0 into master
authorRoland Schulz <roland@utk.edu>
Wed, 18 Jun 2014 14:06:23 +0000 (10:06 -0400)
committerRoland Schulz <roland@utk.edu>
Wed, 18 Jun 2014 14:25:37 +0000 (10:25 -0400)
Conflicts:
- src/gromacs/legacyheaders/types/simple.h
  moved changes into src/gromacs/utility/real.h
- src/gromacs/gmxlib/network.c &
  src/gromacs/utility/basenetwork.cpp
  changes to network.c partially applied to itself
  and paritally to basenetwork.
- src/gromacs/legacyheaders/network.h (trivial)
- src/programs/mdrun/md.cpp (trivial)

Change-Id: Iaeae5bcc691a3fa84978ee261ceb4a5d2aeb4f62

38 files changed:
CMakeLists.txt
manual/forcefield.tex
manual/install.tex
manual/topology.tex
scripts/GMXRC.csh.cmakein
share/top/oplsaa.ff/ffnonbonded.itp
share/top/oplsaa.ff/tip5pe.itp [new file with mode: 0644]
share/top/oplsaa.ff/watermodels.dat
src/contrib/do_shift.c
src/external/tng_io/CMakeLists.txt
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_eneconv.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_genion.c
src/gromacs/gmxana/gmx_make_ndx.c
src/gromacs/gmxana/gmx_principal.c
src/gromacs/gmxana/gmx_sham.c
src/gromacs/gmxlib/gmx_thread_affinity.c
src/gromacs/gmxlib/network.c
src/gromacs/gmxlib/nrnb.c
src/gromacs/gmxlib/txtdump.c
src/gromacs/gmxlib/viewit.c
src/gromacs/gmxpreprocess/readir.c
src/gromacs/mdlib/forcerec.c
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/make_verlet_simd_kernel_files.py
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.c.pre
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.h.pre
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.c
src/gromacs/mdlib/qm_gaussian.c
src/gromacs/mdlib/qm_orca.c
src/gromacs/simd/tests/simd_math.cpp
src/gromacs/utility/basenetwork.cpp
src/gromacs/utility/fatalerror.cpp
src/gromacs/utility/futil.cpp
src/gromacs/utility/real.h
src/programs/mdrun/md.cpp
src/programs/view/logo.cpp
src/programs/view/x11.cpp

index 4a07b24e2d29dc0396cb9ce1b1f7e95f991cc6a4..a7fd59e5f18fd15885ce89817ce3abbdc301f432 100644 (file)
@@ -782,8 +782,11 @@ set(PKG_CFLAGS "${PKG_CFLAGS} ${OpenMP_C_FLAGS}")
 ########################################################################
 # Specify install locations
 ########################################################################
-set(GMX_LIB_INSTALL_DIR lib CACHE STRING
-    "Library installation directory (default: lib)")
+# Use GNUInstallDirst to set paths on multiarch systems
+include(GNUInstallDirs)
+
+set(GMX_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
+    "Library installation directory (default: ${CMAKE_INSTALL_LIBDIR})")
 set(GMX_DATA_INSTALL_DIR gromacs CACHE STRING
     "Data installation directory under share/ (default: gromacs)")
 mark_as_advanced(GMX_LIB_INSTALL_DIR GMX_DATA_INSTALL_DIR)
index 1d35f33116a6a73e597ab59bcc61cf60e2ad38f0..9ffa55cc044a3b8c2d57b85424ffb9dc2aecf0f7 100644 (file)
@@ -2898,6 +2898,7 @@ As of version 4.5, {\gromacs} provides native support for the following AMBER fo
 \end{itemize}
 
 \subsection{CHARMM\index{CHARMM force field}}
+\label{subsec:charmmff}
 
 As of version 4.5, {\gromacs} supports the CHARMM27 force field for proteins~\cite{mackerell04, mackerell98}, lipids~\cite{feller00} and nucleic acids~\cite{foloppe00}. The protein parameters (and to some extent the lipid and nucleic acid parameters) were thoroughly tested -- both by comparing potential energies between the port and the standard parameter set in the CHARMM molecular simulation package, as well by how the protein force field behaves together with {\gromacs}-specific techniques such as virtual sites (enabling long time steps) and a fast implicit solvent recently implemented~\cite{Larsson10} -- and the details and results are presented in the paper by Bjelkmar et al.~\cite{Bjelkmar10}. The nucleic acid parameters, as well as the ones for HEME, were converted and tested by Michel Cuendet.
 
index a91a1a81025340830bddadfa02e04dd66c95370f..0f9e2fe76a3fd13fad6306fe44530c09226c5efb 100644 (file)
@@ -163,12 +163,12 @@ you should consult your local documentation for details.
         Be careful not to use a command which blocks the terminal
         ({\eg} {\tt vi}), since multiple instances might be run.
 \item   {\tt GMX_VIRIAL_TEMPERATURE}: print virial temperature energy term
-\item   {\tt LOG_BUFS}: the size of the buffer for file I/O. When set
+\item   {\tt GMX_LOG_BUFFER}: the size of the buffer for file I/O. When set
         to 0, all file I/O will be unbuffered and therefore very slow.
         This can be handy for debugging purposes, because it ensures
         that all files are always totally up-to-date.
-\item   {\tt LOGO}: set display color for logo in {\tt \normindex{ngmx}}.
-\item   {\tt LONGFORMAT}: use long float format when printing
+\item   {\tt GMX_LOGO_COLOR}: set display color for logo in {\tt \normindex{ngmx}}.
+\item   {\tt GMX_PRINT_LONGFORMAT}: use long float format when printing
         decimal values.
 \item   {\tt GMX_COMPELDUMP}: Applies for computational electrophysiology setups
         only (see section \ref{sec:compel}). The initial structure gets dumped to 
@@ -181,12 +181,7 @@ you should consult your local documentation for details.
 
 \begin{enumerate}
 
-\item   {\tt DUMPNL}: dump neighbor list. 
-        If set to a positive number the {\em entire}
-        neighbor list is printed in the log file (may be many megabytes).
-        Mainly for debugging purposes, but may also be handy for
-        porting to other platforms.
-\item   {\tt WHERE}: when set, print debugging info on line numbers.
+\item   {\tt GMX_PRINT_DEBUG_LINES}: when set, print debugging info on line numbers.
 \item   {\tt GMX_DD_NST_DUMP}: number of steps that elapse between dumping
         the current DD to a PDB file (default 0). This only takes effect
         during domain decomposition, so it should typically be
@@ -210,9 +205,7 @@ you should consult your local documentation for details.
 
 \begin{enumerate}
 
-\item   {\tt DISTGCT}: couple distances between two atoms when doing general coupling
-        theory processes. The format is a string containing two integers, separated by a space.
-\item   {\tt GALACTIC_DYNAMICS}: planetary simulations are made possible (just for fun) by setting
+\item   {\tt GMX_DO_GALACTIC_DYNAMICS}: planetary simulations are made possible (just for fun) by setting
         this environment variable, which allows setting {\tt epsilon_r = -1} in the {\tt .mdp}
         file. Normally, {\tt epsilon_r} must be greater than zero to prevent a fatal error.
         See {\wwwpage} for example input files for a planetary simulation.
@@ -350,45 +343,41 @@ you should consult your local documentation for details.
 
 \begin{enumerate}
 
-\item   {\tt ACC}: accuracy in Gaussian L510 (MC-SCF) component program.
-\item   {\tt BASENAME}: prefix of {\tt .tpr} files, used in Orca calculations
+\item   {\tt GMX_QM_ACCURACY}: accuracy in Gaussian L510 (MC-SCF) component program.
+\item   {\tt GMX_QM_ORCA_BASENAME}: prefix of {\tt .tpr} files, used in Orca calculations
         for input and output file names.
-\item   {\tt CPMCSCF}: when set to a nonzero value, Gaussian QM calculations will
+\item   {\tt GMX_QM_CPMCSCF}: when set to a nonzero value, Gaussian QM calculations will
         iteratively solve the CP-MCSCF equations.
-\item   {\tt DEVEL_DIR}: location of modified links in Gaussian.
+\item   {\tt GMX_QM_MODIFIED_LINKS_DIR}: location of modified links in Gaussian.
 \item   {\tt DSSP}: used by {\tt \normindex{do_dssp}} to point to the {\tt dssp}
         executable (not just its path).
-\item   {\tt GAUSS_DIR}: directory where Gaussian is installed.
-\item   {\tt GAUSS_EXE}: name of the Gaussian executable.
-\item   {\tt GKRWIDTH}: spacing used by {\tt \normindex{g_dipoles}}.
+\item   {\tt GMX_QM_GAUSS_DIR}: directory where Gaussian is installed.
+\item   {\tt GMX_QM_GAUSS_EXE}: name of the Gaussian executable.
+\item   {\tt GMX_DIPOLE_SPACING}: spacing used by {\tt \normindex{g_dipoles}}.
 \item   {\tt GMX_MAXRESRENUM}: sets the maximum number of residues to be renumbered by
         {\tt \normindex{grompp}}. A value of -1 indicates all residues should be renumbered.
 \item   {\tt GMX_FFRTP_TER_RENAME}: Some force fields (like AMBER) use specific names for N- and C-
         terminal residues (NXXX and CXXX) as {\tt .rtp} entries that are normally renamed. Setting
         this environment variable disables this renaming.
 \item   {\tt GMX_PATH_GZIP}: {\tt gunzip} executable, used by {\tt \normindex{g_wham}}.
-\item   {\tt GMXFONT}: name of X11 font used by {\tt \normindex{ngmx}}.
+\item   {\tt GMX_FONT}: name of X11 font used by {\tt \normindex{ngmx}}.
 \item   {\tt GMXTIMEUNIT}: the time unit used in output files, can be
         anything in fs, ps, ns, us, ms, s, m or h.
-\item   {\tt MEM}: memory used for Gaussian QM calculation.
+\item   {\tt GMX_QM_GAUSSIAN_MEMORY}: memory used for Gaussian QM calculation.
 \item   {\tt MULTIPROT}: name of the {\tt multiprot} executable, used by the
         contributed program {\tt \normindex{do_multiprot}}.
 \item   {\tt NCPUS}: number of CPUs to be used for Gaussian QM calculation
-\item   {\tt OPENMM_PLUGIN_DIR}: the location of OpenMM plugins, needed for
-        {\tt \normindex{mdrun-gpu}}.
-\item   {\tt ORCA_PATH}: directory where Orca is installed.
-\item   {\tt SASTEP}: simulated annealing step size for Gaussian QM calculation.
-\item   {\tt STATE}: defines state for Gaussian surface hopping calculation.
-\item   {\tt TESTMC}: perform 1000 random swaps in Monte Carlo clustering method
-        within {\tt \normindex{g_cluster}}.
-\item   {\tt TOTAL}: name of the {\tt total} executable used by the contributed
+\item   {\tt GMX_ORCA_PATH}: directory where Orca is installed.
+\item   {\tt GMX_QM_SA_STEP}: simulated annealing step size for Gaussian QM calculation.
+\item   {\tt GMX_QM_GROUND_STATE}: defines state for Gaussian surface hopping calculation.
+\item   {\tt GMX_TOTAL}: name of the {\tt total} executable used by the contributed
         {\tt \normindex{do_shift}} program.
-\item   {\tt VERBOSE}: make {\tt \normindex{g_energy}} and {\tt \normindex{eneconv}}
+\item   {\tt GMX_ENER_VERBOSE}: make {\tt \normindex{g_energy}} and {\tt \normindex{eneconv}}
         loud and noisy.
 \item   {\tt VMD_PLUGIN_PATH}: where to find VMD plug-ins. Needed to be
         able to read file formats recognized only by a VMD plug-in.
 \item   {\tt VMDDIR}: base path of VMD installation.
-\item   {\tt XMGR}: sets viewer to {\tt xmgr} (deprecated) instead of {\tt xmgrace}.
+\item   {\tt GMX_USE_XMGR}: sets viewer to {\tt xmgr} (deprecated) instead of {\tt xmgrace}.
 
 \end{enumerate}
 
@@ -399,34 +388,16 @@ processes. To run {\gromacs} in parallel over multiple nodes in a cluster
 of a supercomputer, you need to configure and compile {\gromacs} with an external
 MPI library. All supercomputers are shipped with MPI libraries optimized for 
 that particular platform, and if you are using a cluster of workstations
-there are several good free MPI implementations;
-Open MPI is usually a good choice. Once you have an MPI library
-installed it's trivial to compile {\gromacs} with MPI support: Just pass
-the option {\tt -DGMX_MPI=on} to {\tt cmake} and (re-)compile. Please see
-{\wwwpage} for more detailed instructions.
-Note that in addition to MPI parallelization, {\gromacs} supports
-thread-parallelization through \normindex{OpenMP}. MPI and OpenMP parallelization
-can be combined, which results in, so called, hybrid parallelization.
-See {\wwwpage} for details on use and performance of the parallelization
-schemes.
-
-For communications over multiple nodes connected by a network,
-there is a program usually called {\tt mpirun} with which you can start 
-the parallel processes. A typical command line could look like:
-{\tt mpirun -np 10 mdrun_mpi -s topol -v}
-
-With the implementation of threading available by default in {\gromacs} version 4.5, 
-if you have a single machine with multiple processors you don't have to
-use the {\tt mpirun} command, or compile with MPI. Instead, you can
-allow {\gromacs} to determine the number of threads automatically, or use the {\tt mdrun} option {\tt -nt}:
-{\tt mdrun -nt 8 -s topol.tpr}
+there are several good free MPI implementations; OpenMPI is usually a good choice.
+Note that MPI and threaded-MPI support are mutually incompatible.
 
-Check your local manuals (or online manual) for exact details
-of your MPI implementation.
-
-If you are interested in programming MPI yourself, you can find
-manuals and reference literature on the internet.
+In addition to MPI parallelization, {\gromacs} supports also
+thread-parallelization through \normindex{OpenMP}. MPI and OpenMP parallelization
+can be combined, which results in, so called, hybrid parallelization. It can offer
+better performance and scaling in some cases.
 
+See {\wwwpage} for details on the use and performance of the different
+parallelization schemes.
 
 \section{Running {\gromacs} on \normindex{GPUs}}
 As of version 4.6, {\gromacs} has native GPU support through CUDA.
@@ -471,5 +442,5 @@ Please check {\wwwpage} for up to date information on GPU usage.
 % LocalWords:  MAXRESRENUM grompp FFRTP TER NXXX CXXX rtp GZIP gunzip
 % LocalWords:  GMXFONT ns MEM MULTIPROT multiprot NCPUS CPUs OPENMM
 % LocalWords:  PLUGIN OpenMM plugins SASTEP TESTMC eneconv VMD VMDDIR
-% LocalWords:  XMGR xmgr parallelization nt online Nvidia nb cpu
+% LocalWords:  GMX_USE_XMGR xmgr parallelization nt online Nvidia nb cpu
 % LocalWords:  testverlet grommp
index c6f6fddc38676ce73e3925079f8cc140aff8d8c0..c5638116b5e48593c39062e7d4d3954b18dcacf2 100644 (file)
@@ -737,7 +737,9 @@ number of all angles needs to be specified.
 bond, preferably on heavy atoms. When the {\tt [~dihedrals~]} field is used,
 no other dihedrals will be generated for the bonds corresponding to the
 specified  dihedrals. It is possible to put more than one dihedral
-function on a rotatable bond. 
+function on a rotatable bond. In the case of CHARMM27 FF {\tt pdb2gmx}
+can add correction maps to the dihedrals using the default {\tt -cmap} option.
+Please refer to \ssecref{charmmff} for more information.
 
 {\tt pdb2gmx} sets the number of exclusions to 3, which
 means that interactions between atoms connected by at most 3 bonds are
index d4e58d3323ed7d49b513feeb8826774013a29030..f22607920b96cb3c2a2e5de659c1c41e8eadae8d 100644 (file)
@@ -87,7 +87,7 @@ setenv PKG_CONFIG_PATH ${GMXLDLIB}/pkgconfig${PKG_CONFIG_PATH}
 #debian/ubuntu needs a : at the end
 setenv MANPATH ${GMXMAN}:${MANPATH}
 
-setenv GMXFONT 10x20
+setenv GMX_FONT        10x20
 
 # Read completions if we understand it (i.e. have tcsh)
 # Currently disabled, since the completions don't work with the new
index cfc48092c01ca31daced31bf4de223009d47be0b..5d5f0bfaa49e01dcb356aabe46effa40058f7d5f 100644 (file)
  opls_117   HW 1      1.00800     0.410       A    0.00000e+00  0.00000e+00
 #endif
  opls_118   OW 8     15.99940     0.000       A    3.12000e-01  6.69440e-01
+ opls_118e  OW  8     15.99940     0.000       A    3.09700e-01  7.44752e-01 ; J. Chem. Phys. 120 (2004) 6085-6093
  opls_119   HW 1      1.00800     0.000       A    0.00000e+00  0.00000e+00
  opls_120   OL 0      0.00000     0.000       D    0.00000e+00  0.00000e+00
  opls_122   CT 6     12.01100     0.248       A    3.80000e-01  2.09200e-01
diff --git a/share/top/oplsaa.ff/tip5pe.itp b/share/top/oplsaa.ff/tip5pe.itp
new file mode 100644 (file)
index 0000000..2801439
--- /dev/null
@@ -0,0 +1,38 @@
+[ moleculetype ]
+; molname       nrexcl
+SOL             2
+
+[ atoms ]
+; id    at type res nr  residu name     at name         cg nr   charge
+1       opls_118e    1       SOL              OW             1       0
+2       opls_119     1       SOL             HW1             1       0.241
+3       opls_119     1       SOL             HW2             1       0.241
+4       opls_120     1       SOL             LP1             1      -0.241
+5       opls_120     1       SOL             LP2             1      -0.241
+
+[ settles ]
+; i     funct   doh     dhh
+1       1       0.09572 0.15139
+
+[ virtual_sites3 ]
+; The position of the virtual site is computed as follows:
+;
+; The distance from OW to L is 0.07 nm, the geometry is tetrahedral
+; (109.47 deg)
+; Therefore, a = b = 0.07 * cos (109.47/2) / | xOH1 + xOH2 |
+;            c = 0.07 * sin (109.47/2) / | xOH1 X xOH2 |
+;
+; Using | xOH1 X xOH2 | = | xOH1 | | xOH2 | sin (H1-O-H2)
+;       | xOH1 + xOH2 | = 2 | xOH1 | cos (H1-O-H2)
+; Vsite pos x4 = x1 + a*x21 + b*x31 + c*(x21 X x31)
+
+; Vsite from                    funct   a       b               c
+4       1       2       3       4       -0.344908  -0.344908  -6.4437903493
+5       1       2       3       4       -0.344908  -0.344908   6.4437903493
+
+[ exclusions ]
+1       2       3       4       5
+2       1       3       4       5
+3       1       2       4       5
+4       1       2       3       5
+5       1       2       3       4
index 513bcae0d6222a9e18396176f495b23dde4400b3..44f5e9270a7602129556ac13a010a99016551c58 100644 (file)
@@ -1,5 +1,6 @@
 tip4p   TIP4P  TIP 4-point, recommended
 tip3p   TIP3P  TIP 3-point
 tip5p   TIP5P  TIP 5-point
+tip5pe  TIP5P  TIP 5-point improved for Ewald sums
 spc     SPC    simple point charge
 spce    SPC/E  extended simple point charge
index fd20a5ada9c29ecd67821986cc96676e6d8eb13f..60c21642e1763c5a91dc0b00ec118c7c97b95f8a 100644 (file)
@@ -80,8 +80,8 @@ int main(int argc,char *argv[])
     "calling the 'total' program. If you do not have the total program,",
     "get it. do_shift assumes that the total executable is in",
     "[TT]/home/mdgroup/total/total[tt]. If that is not the case, then you should",
-    "set an environment variable [BB]TOTAL[bb] as in: [PAR]",
-    "[TT]setenv TOTAL /usr/local/bin/total[tt][PAR]",
+    "set an environment variable [BB]GMX_TOTAL[bb] as in: [PAR]",
+    "[TT]setenv GMX_TOTAL /usr/local/bin/total[tt][PAR]",
     "where the right hand side should point to the total executable.[PAR]",
     "Output is printed in files [TT]shift.out[tt] where t is the time of the frame.[PAR]",
     "The program also needs an input file called [BB]random.dat[bb] which",
@@ -141,7 +141,7 @@ int main(int argc,char *argv[])
   gmx_tmpnam(tmpfile);
   fprintf(stderr,"pdbfile = %s\ntmpfile = %s\n",pdbfile,tmpfile);
   
-  if ((dptr=getenv("TOTAL")) == NULL)
+  if ((dptr=getenv("GMX_TOTAL")) == NULL)
     dptr="/home/mdgroup/total/total";
   sprintf(total,"%s > /dev/null",dptr);
   fprintf(stderr,"total cmd='%s'\n",total);
index dded3945c14022b263fcc4453d3da8da24f6ae83..41eb1551de31a517b20ef93754da53f256b2f4f0 100644 (file)
@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 2.8)
 
 project(TNG_IO)
+set(PROJECT_VERSION "1.0")
 
 if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
index 2a0ef2cc0757672aac3238b1dff9dd453ca536d9..ba31730f9113ed966b18003a2d268b421186f876 100644 (file)
@@ -93,7 +93,7 @@ static t_gkrbin *mk_gkrbin(real radius, real rcmax, gmx_bool bPhi, int ndegrees)
 
     snew(gb, 1);
 
-    if ((ptr = getenv("GKRWIDTH")) != NULL)
+    if ((ptr = getenv("GMX_DIPOLE_SPACING")) != NULL)
     {
         double bw = strtod(ptr, NULL);
         gb->spacing = bw;
index 3e87f0dbd4ad54e1de85339fdee034dba69e2fcb..b4a542197b26e3239d84cd2ce93259232c2fb5f6 100644 (file)
@@ -68,7 +68,7 @@ static int *select_it(int nre, gmx_enxnm_t *nm, int *nset)
     int      *set;
     gmx_bool  bVerbose = TRUE;
 
-    if ((getenv("VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
     {
         bVerbose = FALSE;
     }
index a0ddbfb1604f94754fa26a136a04df21a0f43fa2..4ffec6be5d7f73780a1508b15fdd1e463cc4c3c3 100644 (file)
@@ -108,7 +108,7 @@ static int *select_it(int nre, char *nm[], int *nset)
     int      *set;
     gmx_bool  bVerbose = TRUE;
 
-    if ((getenv("VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
     {
         bVerbose = FALSE;
     }
@@ -178,7 +178,7 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
     const char *fm2   = "%3d  %-34s";
     char      **newnm = NULL;
 
-    if ((getenv("VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
     {
         bVerbose = FALSE;
     }
index 7699f36f8dc407765fe905de618920452d8771a3..9456e4825a73acd90ad5391fcf439083fce43eb7 100644 (file)
@@ -472,8 +472,7 @@ int gmx_genion(int argc, char *argv[])
 
     if ((p_num == 0) && (n_num == 0))
     {
-        fprintf(stderr, "No ions to add.\n");
-        exit(0);
+        fprintf(stderr, "No ions to add, will just copy input configuration.\n");
     }
     else
     {
@@ -508,52 +507,51 @@ int gmx_genion(int argc, char *argv[])
         {
             gmx_fatal(FARGS, "Not enough solvent for adding ions");
         }
-    }
 
-    if (opt2bSet("-p", NFILE, fnm))
-    {
-        update_topol(opt2fn("-p", NFILE, fnm), p_num, n_num, p_name, n_name, grpname);
-    }
+        if (opt2bSet("-p", NFILE, fnm))
+        {
+            update_topol(opt2fn("-p", NFILE, fnm), p_num, n_num, p_name, n_name, grpname);
+        }
 
-    snew(bSet, nw);
-    snew(repl, nw);
+        snew(bSet, nw);
+        snew(repl, nw);
 
-    snew(v, atoms.nr);
-    snew(atoms.pdbinfo, atoms.nr);
+        snew(v, atoms.nr);
+        snew(atoms.pdbinfo, atoms.nr);
 
-    set_pbc(&pbc, ePBC, box);
+        set_pbc(&pbc, ePBC, box);
 
-    if (seed == 0)
-    {
-        rng = gmx_rng_init(gmx_rng_make_seed());
-    }
-    else
-    {
-        rng = gmx_rng_init(seed);
-    }
-    /* Now loop over the ions that have to be placed */
-    while (p_num-- > 0)
-    {
-        insert_ion(nsa, &nw, bSet, repl, index, x, &pbc,
-                   1, p_q, p_name, &atoms, rmin, rng);
-    }
-    while (n_num-- > 0)
-    {
-        insert_ion(nsa, &nw, bSet, repl, index, x, &pbc,
-                   -1, n_q, n_name, &atoms, rmin, rng);
-    }
-    gmx_rng_destroy(rng);
-    fprintf(stderr, "\n");
+        if (seed == 0)
+        {
+            rng = gmx_rng_init(gmx_rng_make_seed());
+        }
+        else
+        {
+            rng = gmx_rng_init(seed);
+        }
+        /* Now loop over the ions that have to be placed */
+        while (p_num-- > 0)
+        {
+            insert_ion(nsa, &nw, bSet, repl, index, x, &pbc,
+                       1, p_q, p_name, &atoms, rmin, rng);
+        }
+        while (n_num-- > 0)
+        {
+            insert_ion(nsa, &nw, bSet, repl, index, x, &pbc,
+                       -1, n_q, n_name, &atoms, rmin, rng);
+        }
+        gmx_rng_destroy(rng);
+        fprintf(stderr, "\n");
 
-    if (nw)
-    {
-        sort_ions(nsa, nw, repl, index, &atoms, x, p_name, n_name);
-    }
+        if (nw)
+        {
+            sort_ions(nsa, nw, repl, index, &atoms, x, p_name, n_name);
+        }
 
-    sfree(atoms.pdbinfo);
-    atoms.pdbinfo = NULL;
-    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), *top.name, &atoms, x, NULL, ePBC,
-                   box);
+        sfree(atoms.pdbinfo);
+        atoms.pdbinfo = NULL;
+    }
+    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), *top.name, &atoms, x, NULL, ePBC, box);
 
     return 0;
 }
index 3e48c99a264628710de5ffb8ea09286ef045fbaa..7bdccbefff8c4cf25f7fbfa4eecc912779abbf97 100644 (file)
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-#define MAXNAMES 30
-#define NAME_LEN 30
+/* It's not nice to have size limits, but we should not spend more time
+ * on this ancient tool, but instead use the new selection library.
+ */
+#define MAXNAMES 1024
+#define NAME_LEN 1024
 
 gmx_bool bCase = FALSE;
 
index 72db5d6ba57262164977fc3bb4e252b85f49aa07..8e9a2d46299b51c0cb7271d092e2121fc17422ec 100644 (file)
@@ -75,7 +75,11 @@ int gmx_principal(int argc, char *argv[])
 {
     const char     *desc[] = {
         "[THISMODULE] calculates the three principal axes of inertia for a group",
-        "of atoms.",
+        "of atoms. NOTE: Old versions of Gromacs wrote the output data in a",
+        "strange transposed way. As of Gromacs-5.0, the output file paxis1.dat",
+        "contains the x/y/z components of the first (major) principal axis for",
+        "each frame, and similarly for the middle and minor axes in paxis2.dat",
+        "and paxis3.dat."
     };
     static gmx_bool foo = FALSE;
 
@@ -106,9 +110,9 @@ int gmx_principal(int argc, char *argv[])
         { efTRX, "-f",   NULL,       ffREAD },
         { efTPS, NULL,   NULL,       ffREAD },
         { efNDX, NULL,   NULL,       ffOPTRD },
-        { efDAT, "-a1",  "axis1",    ffWRITE },
-        { efDAT, "-a2",  "axis2",    ffWRITE },
-        { efDAT, "-a3",  "axis3",    ffWRITE },
+        { efDAT, "-a1",  "paxis1",   ffWRITE },
+        { efDAT, "-a2",  "paxis2",   ffWRITE },
+        { efDAT, "-a3",  "paxis3",   ffWRITE },
         { efDAT, "-om",  "moi",      ffWRITE }
     };
 #define NFILE asize(fnm)
@@ -139,9 +143,9 @@ int gmx_principal(int argc, char *argv[])
 
         calc_principal_axes(&top, x, index, gnx, axes, moi);
 
-        fprintf(axis1, "%15.10f     %15.10f  %15.10f  %15.10f\n", t, axes[XX][XX], axes[YY][XX], axes[ZZ][XX]);
-        fprintf(axis2, "%15.10f     %15.10f  %15.10f  %15.10f\n", t, axes[XX][YY], axes[YY][YY], axes[ZZ][YY]);
-        fprintf(axis3, "%15.10f     %15.10f  %15.10f  %15.10f\n", t, axes[XX][ZZ], axes[YY][ZZ], axes[ZZ][ZZ]);
+        fprintf(axis1, "%15.10f     %15.10f  %15.10f  %15.10f\n", t, axes[XX][XX], axes[XX][YY], axes[XX][ZZ]);
+        fprintf(axis2, "%15.10f     %15.10f  %15.10f  %15.10f\n", t, axes[YY][XX], axes[YY][YY], axes[YY][ZZ]);
+        fprintf(axis3, "%15.10f     %15.10f  %15.10f  %15.10f\n", t, axes[ZZ][XX], axes[ZZ][YY], axes[ZZ][ZZ]);
         fprintf(fmoi,  "%15.10f     %15.10f  %15.10f  %15.10f\n", t, moi[XX], moi[YY], moi[ZZ]);
     }
     while (read_next_x(oenv, status, &t, x, box));
index c0193996177ecd719a22ba06fedce0b7cd0bdfc7..8e367e082e6e38501e4dcf715a67cfa12fcde7e8 100644 (file)
@@ -413,25 +413,24 @@ static void pick_minima(const char *logfile, int *ibox, int ndim, int len, real
 
 static void do_sham(const char *fn, const char *ndx,
                     const char *xpmP, const char *xpm, const char *xpm2,
-                    const char *xpm3, const char *xpm4, const char *pdb,
+                    const char *xpm3, const char *pdb,
                     const char *logf,
                     int n, int neig, real **eig,
                     gmx_bool bGE, int nenerT, real **enerT,
-                    int nmap, real *mapindex, real **map,
                     real Tref,
                     real pmax, real gmax,
                     real *emin, real *emax, int nlevels, real pmin,
-                    const char *mname, int *idim, int *ibox,
+                    int *idim, int *ibox,
                     gmx_bool bXmin, real *xmin, gmx_bool bXmax, real *xmax)
 {
     FILE        *fp;
     real        *min_eig, *max_eig;
     real        *axis_x, *axis_y, *axis_z, *axis = NULL;
     double      *P;
-    real       **PP, *W, *E, **WW, **EE, *S, **SS, *M, **MM, *bE;
+    real       **PP, *W, *E, **WW, **EE, *S, **SS, *M, *bE;
     rvec         xxx;
     char        *buf;
-    double      *bfac, efac, bref, Pmax, Wmin, Wmax, Winf, Emin, Emax, Einf, Smin, Smax, Sinf, Mmin, Mmax, Minf;
+    double      *bfac, efac, bref, Pmax, Wmin, Wmax, Winf, Emin, Emax, Einf, Smin, Smax, Sinf, Mmin, Mmax;
     real        *delta;
     int          i, j, k, imin, len, index, d, *nbin, *bindex, bi;
     int         *nxyz, maxbox;
@@ -703,45 +702,7 @@ static void do_sham(const char *fn, const char *ndx,
             axis[j] = min_eig[i] + j/bfac[i];
         }
     }
-    if (map)
-    {
-        snew(M, len);
-        snew(MM, maxbox*maxbox);
-        for (i = 0; (i < ibox[0]); i++)
-        {
-            MM[i] = &(M[i*ibox[1]]);
-        }
-        Mmin = 1e8;
-        Mmax = -1e8;
-        for (i = 0; (i < nmap); i++)
-        {
-            Mmin = min(Mmin, map[0][i]);
-            Mmax = max(Mmax, map[0][i]);
-        }
-        Minf = Mmax*1.05;
-        for (i = 0; (i < len); i++)
-        {
-            M[i] = Minf;
-        }
-        for (i = 0; (i < nmap); i++)
-        {
-            index = gmx_nint(mapindex[i]);
-            if (index >= len)
-            {
-                gmx_fatal(FARGS, "Number of bins in file from -mdata option does not correspond to current analysis");
-            }
 
-            if (P[index] != 0)
-            {
-                M[index] = map[0][i];
-            }
-        }
-    }
-    else
-    {
-        MM   = NULL;
-        Minf = NOTSET;
-    }
     pick_minima(logf, ibox, neig, len, W);
     if (gmax <= 0)
     {
@@ -780,13 +741,6 @@ static void do_sham(const char *fn, const char *ndx,
         write_xpm(fp, flags, "Entropy Landscape", "TDS (kJ/mol)", "PC1", "PC2",
                   ibox[0], ibox[1], axis_x, axis_y, SS, 0, Sinf, rlo, rhi, &nlevels);
         gmx_ffclose(fp);
-        if (map)
-        {
-            fp = gmx_ffopen(xpm4, "w");
-            write_xpm(fp, flags, "Custom Landscape", mname, "PC1", "PC2",
-                      ibox[0], ibox[1], axis_x, axis_y, MM, 0, Minf, rlo, rhi, &nlevels);
-            gmx_ffclose(fp);
-        }
     }
     else if (neig == 3)
     {
@@ -813,10 +767,6 @@ static void do_sham(const char *fn, const char *ndx,
         }
         gmx_ffclose(fp);
         write_xplor("out.xplor", W, ibox, min_eig, max_eig);
-        if (map)
-        {
-            write_xplor("user.xplor", M, ibox, min_eig, max_eig);
-        }
         nxyz[XX] = imin/(ibox[1]*ibox[2]);
         nxyz[YY] = (imin-nxyz[XX]*ibox[1]*ibox[2])/ibox[2];
         nxyz[ZZ] = imin % ibox[2];
@@ -861,11 +811,6 @@ static void do_sham(const char *fn, const char *ndx,
         gmx_ffclose(fp);
         sfree(buf);
     }
-    if (map)
-    {
-        sfree(MM);
-        sfree(M);
-    }
 }
 
 static void ehisto(const char *fh, int n, real **enerT, const output_env_t oenv)
@@ -977,7 +922,6 @@ int gmx_sham(int argc, char *argv[])
     static rvec        nrbox     = {32, 32, 32};
     static rvec        xmin      = {0, 0, 0}, xmax = {1, 1, 1};
     static int         nsets_in  = 1, nb_min = 4, resol = 10, nlevels = 25;
-    static const char *mname     = "";
     t_pargs            pa[]      = {
         { "-time",    FALSE, etBOOL, {&bHaveT},
           "Expect a time in the input" },
@@ -1015,14 +959,12 @@ int gmx_sham(int argc, char *argv[])
           "Maximum enthalpy in output, default is calculate" },
         { "-nlevels", FALSE, etINT,  {&nlevels},
           "Number of levels for energy landscape" },
-        { "-mname",   FALSE, etSTR,  {&mname},
-          "Legend label for the custom landscape" },
     };
 #define NPA asize(pa)
 
     FILE           *out;
-    int             n, e_n, d_n, nlast, s, nset, e_nset, d_nset, i, j = 0, *idim, *ibox;
-    real          **val, **et_val, **dt_val, *t, *e_t, e_dt, d_dt, *d_t, dt, tot, error;
+    int             n, e_n, nlast, s, nset, e_nset, d_nset, i, j = 0, *idim, *ibox;
+    real          **val, **et_val, *t, *e_t, e_dt, d_dt, dt, tot, error;
     real           *rmin, *rmax;
     double         *av, *sig, cum1, cum2, cum3, cum4, db;
     const char     *fn_ge, *fn_ene;
@@ -1040,9 +982,7 @@ int gmx_sham(int argc, char *argv[])
         { efXPM, "-ls",   "gibbs",    ffOPTWR  },
         { efXPM, "-lsh",  "enthalpy", ffOPTWR  },
         { efXPM, "-lss",  "entropy",  ffOPTWR  },
-        { efXPM, "-map",  "map",      ffOPTWR  },
         { efPDB, "-ls3",  "gibbs3",   ffOPTWR  },
-        { efXVG, "-mdata", "mapdata",  ffOPTRD  },
         { efLOG, "-g",    "shamlog",  ffOPTWR  }
     };
 #define NFILE asize(fnm)
@@ -1102,22 +1042,6 @@ int gmx_sham(int argc, char *argv[])
         et_val = NULL;
     }
 
-    if (opt2fn_null("-mdata", NFILE, fnm) != NULL)
-    {
-        dt_val = read_xvg_time(opt2fn("-mdata", NFILE, fnm), bHaveT,
-                               FALSE, tb, FALSE, te,
-                               nsets_in, &d_nset, &d_n, &d_dt, &d_t);
-        if (d_nset != 1)
-        {
-            gmx_fatal(FARGS, "Can only handle one mapping data column in %s",
-                      opt2fn("-mdata", NFILE, fnm));
-        }
-    }
-    else
-    {
-        dt_val = NULL;
-    }
-
     if (fn_ene && et_val)
     {
         ehisto(opt2fn("-histo", NFILE, fnm), e_n, et_val, oenv);
@@ -1159,14 +1083,14 @@ int gmx_sham(int argc, char *argv[])
     do_sham(opt2fn("-dist", NFILE, fnm), opt2fn("-bin", NFILE, fnm),
             opt2fn("-lp", NFILE, fnm),
             opt2fn("-ls", NFILE, fnm), opt2fn("-lsh", NFILE, fnm),
-            opt2fn("-lss", NFILE, fnm), opt2fn("-map", NFILE, fnm),
+            opt2fn("-lss", NFILE, fnm),
             opt2fn("-ls3", NFILE, fnm), opt2fn("-g", NFILE, fnm),
-            n, nset, val, fn_ge != NULL, e_nset, et_val, d_n, d_t, dt_val, Tref,
+            n, nset, val, fn_ge != NULL, e_nset, et_val, Tref,
             pmax, gmax,
             opt2parg_bSet("-emin", NPA, pa) ? &emin : NULL,
             opt2parg_bSet("-emax", NPA, pa) ? &emax : NULL,
             nlevels, pmin,
-            mname, idim, ibox,
+            idim, ibox,
             opt2parg_bSet("-xmin", NPA, pa), rmin,
             opt2parg_bSet("-xmax", NPA, pa), rmax);
 
index 02363e230502374b1088b3dca026a22c8fe0a731..8814ec410f72b9c3bb89b871ba7bb76d995063a5 100644 (file)
@@ -239,7 +239,8 @@ gmx_set_thread_affinity(FILE                *fplog,
          */
         MPI_Comm comm_intra;
 
-        MPI_Comm_split(MPI_COMM_WORLD, gmx_hostname_num(), cr->rank_intranode,
+        MPI_Comm_split(MPI_COMM_WORLD,
+                       gmx_physicalnode_id_hash(), cr->rank_intranode,
                        &comm_intra);
         MPI_Scan(&nthread_local, &thread0_id_node, 1, MPI_INT, MPI_SUM, comm_intra);
         /* MPI_Scan is inclusive, but here we need exclusive */
index b683c97ec459bc03d33cdffdf5d6636c476a1e97..3cbcf33c4eb3cd210a99de5239b3887b944cd4f1 100644 (file)
@@ -139,7 +139,7 @@ t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
 void gmx_setup_nodecomm(FILE gmx_unused *fplog, t_commrec *cr)
 {
     gmx_nodecomm_t *nc;
-    int             n, rank, hostnum, ng, ni;
+    int             n, rank, nodehash, ng, ni;
 
     /* Many MPI implementations do not optimize MPI_Allreduce
      * (and probably also other global communication calls)
@@ -160,7 +160,7 @@ void gmx_setup_nodecomm(FILE gmx_unused *fplog, t_commrec *cr)
     MPI_Comm_size(cr->mpi_comm_mygroup, &n);
     MPI_Comm_rank(cr->mpi_comm_mygroup, &rank);
 
-    hostnum = gmx_hostname_num();
+    nodehash = gmx_physicalnode_id_hash();
 
     if (debug)
     {
@@ -169,7 +169,7 @@ void gmx_setup_nodecomm(FILE gmx_unused *fplog, t_commrec *cr)
 
 
     /* The intra-node communicator, split on node number */
-    MPI_Comm_split(cr->mpi_comm_mygroup, hostnum, rank, &nc->comm_intra);
+    MPI_Comm_split(cr->mpi_comm_mygroup, nodehash, rank, &nc->comm_intra);
     MPI_Comm_rank(nc->comm_intra, &nc->rank_intra);
     if (debug)
     {
@@ -229,25 +229,25 @@ void gmx_init_intranode_counters(t_commrec *cr)
     /* thread-MPI is not initialized when not running in parallel */
 #if defined GMX_MPI && !defined GMX_THREAD_MPI
     int nrank_world, rank_world;
-    int i, mynum, *num, *num_s, *num_pp, *num_pp_s;
+    int i, myhash, *hash, *hash_s, *hash_pp, *hash_pp_s;
 
     MPI_Comm_size(MPI_COMM_WORLD, &nrank_world);
     MPI_Comm_rank(MPI_COMM_WORLD, &rank_world);
 
-    /* Get the node number from the hostname to identify the nodes */
-    mynum = gmx_hostname_num();
+    /* Get a (hopefully unique) hash that identifies our physical node */
+    myhash = gmx_physicalnode_id_hash();
 
     /* We can't rely on MPI_IN_PLACE, so we need send and receive buffers */
-    snew(num,   nrank_world);
-    snew(num_s, nrank_world);
-    snew(num_pp,   nrank_world);
-    snew(num_pp_s, nrank_world);
+    snew(hash,   nrank_world);
+    snew(hash_s, nrank_world);
+    snew(hash_pp,   nrank_world);
+    snew(hash_pp_s, nrank_world);
 
-    num_s[rank_world]    = mynum;
-    num_pp_s[rank_world] = (cr->duty & DUTY_PP) ? mynum : -1;
+    hash_s[rank_world]    = myhash;
+    hash_pp_s[rank_world] = (cr->duty & DUTY_PP) ? myhash : -1;
 
-    MPI_Allreduce(num_s,    num,    nrank_world, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
-    MPI_Allreduce(num_pp_s, num_pp, nrank_world, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
+    MPI_Allreduce(hash_s,    hash,    nrank_world, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
+    MPI_Allreduce(hash_pp_s, hash_pp, nrank_world, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
 
     nrank_intranode    = 0;
     rank_intranode     = 0;
@@ -255,7 +255,7 @@ void gmx_init_intranode_counters(t_commrec *cr)
     rank_pp_intranode  = 0;
     for (i = 0; i < nrank_world; i++)
     {
-        if (num[i] == mynum)
+        if (hash[i] == myhash)
         {
             nrank_intranode++;
             if (i < rank_world)
@@ -263,7 +263,7 @@ void gmx_init_intranode_counters(t_commrec *cr)
                 rank_intranode++;
             }
         }
-        if (num_pp[i] == mynum)
+        if (hash_pp[i] == myhash)
         {
             nrank_pp_intranode++;
             if ((cr->duty & DUTY_PP) && i < rank_world)
@@ -272,10 +272,10 @@ void gmx_init_intranode_counters(t_commrec *cr)
             }
         }
     }
-    sfree(num);
-    sfree(num_s);
-    sfree(num_pp);
-    sfree(num_pp_s);
+    sfree(hash);
+    sfree(hash_s);
+    sfree(hash_pp);
+    sfree(hash_pp_s);
 #else
     /* Serial or thread-MPI code: we run within a single physical node */
     nrank_intranode    = cr->nnodes;
index afa12f55c8e10619d5df49dc4c9668885a2a97f1..f1def42efb7784d3e0a1b6ec250385211e818adf 100644 (file)
@@ -425,6 +425,15 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
         fprintf(out, " %-32s %16s %15.3f  %6.1f\n",
                 "Total", "", *mflop, tfrac);
         fprintf(out, "%s\n\n", myline);
+
+        if (nrnb->n[eNR_NBKERNEL_GENERIC] > 0)
+        {
+            fprintf(out,
+                    "WARNING: Using the slow generic C kernel. This is fine if you are\n"
+                    "comparing different implementations or MD software. Routine\n"
+                    "simulations should use a different non-bonded setup for much better\n"
+                    "performance.\n\n");
+        }
     }
 }
 
index d0dbca8405c0985b605b537b77b45a103f3d9b68..2d45b2754606959545ffbbba894d764ad4c81383 100644 (file)
@@ -271,7 +271,7 @@ void pr_rvecs(FILE *fp, int indent, const char *title, rvec vec[], int n)
     const char *format;
     int         i, j;
 
-    if (getenv("LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
     {
         format = flong;
     }
@@ -308,7 +308,7 @@ void pr_rvecs_of_dim(FILE *fp, int indent, const char *title, rvec vec[], int n,
     const char *format;
     int         i, j;
 
-    if (getenv("LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
     {
         format = flong;
     }
@@ -376,7 +376,7 @@ void pr_reals_of_dim(FILE *fp, int indent, const char *title, real *vec, int n,
     const char *flong  = "%15.8e";
     const char *format;
 
-    if (getenv("LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
     {
         format = flong;
     }
index beace19aac008b226cafd2859334fa273ed7864f..794dc8c63387efde491146825349276c05b57c16 100644 (file)
@@ -97,7 +97,7 @@ void do_view(const output_env_t oenv, const char *fn, const char *opts)
                 case efXVG:
                     if (!(cmd = getenv(env)) )
                     {
-                        if (getenv("XMGR") )
+                        if (getenv("GMX_USE_XMGR") )
                         {
                             cmd = "xmgr";
                         }
index b8e9e6d9b8bb623b11a16a5a12be482f2c834c3c..24710003bc11ceaf89e4e1a6db2cecca56c0f186 100644 (file)
@@ -1072,7 +1072,7 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         ir->epsilon_r  = 1.0;
     }
 
-    if (getenv("GALACTIC_DYNAMICS") == NULL)
+    if (getenv("GMX_DO_GALACTIC_DYNAMICS") == NULL)
     {
         sprintf(err_buf, "epsilon-r must be >= 0 instead of %g\n", ir->epsilon_r);
         CHECK(ir->epsilon_r < 0);
index e3fe4cbd9a637bc861775fa54d83dbf20b015eb2..c1caca163df069ed4ab2978b657aec2552306d79 100644 (file)
@@ -1775,6 +1775,15 @@ static void pick_nbnxn_kernel(FILE                *fp,
                 lookup_nbnxn_kernel_name(*kernel_type),
                 nbnxn_kernel_pairlist_simple(*kernel_type) ? NBNXN_CPU_CLUSTER_I_SIZE : NBNXN_GPU_CLUSTER_SIZE,
                 nbnxn_kernel_to_cj_size(*kernel_type));
+
+        if (nbnxnk4x4_PlainC == *kernel_type ||
+            nbnxnk8x8x8_PlainC == *kernel_type)
+        {
+            md_print_warn(cr, fp,
+                          "WARNING: Using the slow %s kernels. This should\n"
+                          "not happen during routine usage on supported platforms.\n\n",
+                          lookup_nbnxn_kernel_name(*kernel_type));
+        }
     }
 }
 
index 76a1c5d4abca266f206492a177ad11b35131318c..b3fdecc0147a1ba909073f892ff9850ef8a48e5f 100755 (executable)
@@ -142,9 +142,7 @@ VerletKernelTypeDict = {
     },
     '4xn' : {
         'Define' : 'GMX_NBNXN_SIMD_4XN',
-        'WidthSetup' : ('#ifdef GMX_NBNXN_HALF_WIDTH_SIMD\n' \
-                        '#define GMX_USE_HALF_WIDTH_SIMD_HERE\n' \
-                        '#endif\n'),
+        'WidthSetup' : (''),
         'WidthCheck' : ('#if !(GMX_SIMD_REAL_WIDTH == 2 || GMX_SIMD_REAL_WIDTH == 4 || GMX_SIMD_REAL_WIDTH == 8)\n' \
                         '#error "unsupported SIMD width"\n' \
                         '#endif\n'),
index ed2ffcdc22e14c3f0cff8e089013c8e19eacd69b..666bd705a2bc4273e86d6611f212567cba1d9d57 100644 (file)
 
 #include "typedefs.h"
 
+#include "gromacs/mdlib/nbnxn_simd.h"
+
 #ifdef {0}
 
-{1}
-#include "gromacs/simd/macros.h"
-#include "gromacs/simd/vector_operations.h"
+{1}#include "gromacs/simd/vector_operations.h"
+
 {2}
 #define GMX_SIMD_J_UNROLL_SIZE {3}
 #include "{4}"
index 61e3155fa54ab4bc491565a3bda1e4423f9df2f4..e3fa05fb8f5b57a7f2eca53bceea931212fa0323 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
@@ -34,6 +34,8 @@
  */
 #include "typedefs.h"
 
+#include "gromacs/mdlib/nbnxn_simd.h"
+
 #ifdef __cplusplus
 extern "C" {{
 #endif
index 3cd1cce93b74de3f91a4e0b3c6041d780f2b7a30..f48af3b006ffd11f4b75f5507ad807a25347739d 100644 (file)
@@ -48,6 +48,7 @@
 #ifdef GMX_NBNXN_SIMD_4XN
 
 #include "gromacs/simd/vector_operations.h"
+
 #if !(GMX_SIMD_REAL_WIDTH == 2 || GMX_SIMD_REAL_WIDTH == 4 || GMX_SIMD_REAL_WIDTH == 8)
 #error "unsupported SIMD width"
 #endif
index f24c538d3f51856501cd121de0f02d4a83decbff..61a97056385b1db361cb69ffd6178a1138298685 100644 (file)
@@ -113,7 +113,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
         /* we read the number of cpus and environment from the environment
          * if set.
          */
-        buf = getenv("NCPUS");
+        buf = getenv("GMX_QM_GAUSSIAN_NCPUS");
         if (buf)
         {
             sscanf(buf, "%d", &qm->nQMcpus);
@@ -123,7 +123,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
             qm->nQMcpus = 1;
         }
         fprintf(stderr, "number of CPUs for gaussian = %d\n", qm->nQMcpus);
-        buf = getenv("MEM");
+        buf = getenv("GMX_QM_GAUSSIAN_MEMORY");
         if (buf)
         {
             sscanf(buf, "%d", &qm->QMmem);
@@ -133,7 +133,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
             qm->QMmem = 50000000;
         }
         fprintf(stderr, "memory for gaussian = %d\n", qm->QMmem);
-        buf = getenv("ACC");
+        buf = getenv("GMX_QM_ACCURACY");
         if (buf)
         {
             sscanf(buf, "%d", &qm->accuracy);
@@ -144,7 +144,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
         }
         fprintf(stderr, "accuracy in l510 = %d\n", qm->accuracy);
 
-        buf = getenv("CPMCSCF");
+        buf = getenv("GMX_QM_CPMCSCF");
         if (buf)
         {
             sscanf(buf, "%d", &i);
@@ -162,7 +162,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
         {
             fprintf(stderr, "NOT using cp-mcscf in l1003\n");
         }
-        buf = getenv("SASTEP");
+        buf = getenv("GMX_QM_SA_STEP");
         if (buf)
         {
             sscanf(buf, "%d", &qm->SAstep);
@@ -197,7 +197,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
             fclose(out);
         }
         /* gaussian settings on the system */
-        buf = getenv("GAUSS_DIR");
+        buf = getenv("GMX_QM_GAUSS_DIR");
         fprintf(stderr, "%s", buf);
 
         if (buf)
@@ -206,26 +206,26 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
         }
         else
         {
-            gmx_fatal(FARGS, "no $GAUSS_DIR, check gaussian manual\n");
+            gmx_fatal(FARGS, "no $GMX_QM_GAUSS_DIR, check gaussian manual\n");
         }
 
-        buf = getenv("GAUSS_EXE");
+        buf = getenv("GMX_QM_GAUSS_EXE");
         if (buf)
         {
             qm->gauss_exe = strdup(buf);
         }
         else
         {
-            gmx_fatal(FARGS, "no $GAUSS_EXE, check gaussian manual\n");
+            gmx_fatal(FARGS, "no $GMX_QM_GAUSS_EXE set, check gaussian manual\n");
         }
-        buf = getenv("DEVEL_DIR");
+        buf = getenv("GMX_QM_MODIFIED_LINKS_DIR");
         if (buf)
         {
             qm->devel_dir = strdup (buf);
         }
         else
         {
-            gmx_fatal(FARGS, "no $DEVEL_DIR, this is were the modified links reside.\n");
+            gmx_fatal(FARGS, "no $GMX_QM_MODIFIED_LINKS_DIR, this is were the modified links reside.\n");
         }
 
         /*  if(fr->bRF){*/
@@ -1107,7 +1107,7 @@ real call_gaussian_SH(t_commrec *cr, t_forcerec *fr, t_QMrec *qm, t_MMrec *mm,
     if (!step)
     {
         snew(buf, 20);
-        buf = getenv("STATE");
+        buf = getenv("GMX_QM_GROUND_STATE");
         if (buf)
         {
             sscanf(buf, "%d", &state);
index a8860d679fd5bb84f49e429168445b0d6fdb261c..2b4912d073168ae873f0f04a2a862ad23f8e1793 100644 (file)
@@ -67,7 +67,7 @@ void init_orca(t_QMrec *qm)
     snew(buf, 200);
 
     /* ORCA settings on the system */
-    buf = getenv("BASENAME");
+    buf = getenv("GMX_QM_ORCA_BASENAME");
     if (buf)
     {
         snew(qm->orca_basename, 200);
@@ -75,12 +75,12 @@ void init_orca(t_QMrec *qm)
     }
     else
     {
-        gmx_fatal(FARGS, "$BASENAME not set\n");
+        gmx_fatal(FARGS, "$GMX_QM_ORCA_BASENAME is not set\n");
     }
 
     /* ORCA directory on the system */
     snew(buf, 200);
-    buf = getenv("ORCA_PATH");
+    buf = getenv("GMX_ORCA_PATH");
 
     if (buf)
     {
@@ -89,7 +89,7 @@ void init_orca(t_QMrec *qm)
     }
     else
     {
-        gmx_fatal(FARGS, "$ORCA_PATH not set, check manual\n");
+        gmx_fatal(FARGS, "$GMX_ORCA_PATH not set, check manual\n");
     }
 
     fprintf(stderr, "Setting ORCA path to: %s...\n", qm->orca_dir);
index 9d4d63eeabd07e2a7771c36bd6ba8248e93a53ee..a064ae1fae16a5879f3fc80eb19b71e893459aee 100644 (file)
@@ -451,9 +451,9 @@ TEST_F(SimdMathTest, gmxSimdPmecorrForceR)
 {
     // Pme correction only needs to be ~1e-6 accuracy single, 1e-10 double
 #ifdef GMX_DOUBLE
-    setUlpTol((gmx_int64_t)(1e-10/GMX_REAL_EPS));
+    setUlpTol((gmx_int64_t)(5e-10/GMX_REAL_EPS));
 #else
-    setUlpTol((gmx_int64_t)(1e-6/GMX_REAL_EPS));
+    setUlpTol((gmx_int64_t)(5e-6/GMX_REAL_EPS));
 #endif
 
     setRange(0.15, 4);
@@ -473,9 +473,9 @@ TEST_F(SimdMathTest, gmxSimdPmecorrPotentialR)
 {
     // Pme correction only needs to be ~1e-6 accuracy single, 1e-10 double
 #ifdef GMX_DOUBLE
-    setUlpTol((gmx_int64_t)(1e-10/GMX_REAL_EPS));
+    setUlpTol((gmx_int64_t)(5e-10/GMX_REAL_EPS));
 #else
-    setUlpTol((gmx_int64_t)(1e-6/GMX_REAL_EPS));
+    setUlpTol((gmx_int64_t)(5e-6/GMX_REAL_EPS));
 #endif
     setRange(0.15, 4);
     setAbsTol(GMX_REAL_EPS);
index d4adc345a8dfb72cca9202d837921d272b2d4c80..8e74d6bf82da1c18ee0590abcdf385a8a58f18d5 100644 (file)
@@ -108,11 +108,7 @@ int gmx_node_rank(void)
 #endif
 }
 
-#if defined GMX_LIB_MPI && defined GMX_TARGET_BGQ
-#include <spi/include/kernel/location.h>
-#endif
-
-int gmx_physicalnode_id_hash(void)
+static int mpi_hostname_hash(void)
 {
     int hash_int;
 
@@ -146,23 +142,12 @@ int gmx_physicalnode_id_hash(void)
     return hash_int;
 }
 
-int gmx_hostname_num()
-{
-#ifndef GMX_MPI
-    return 0;
-#else
-#ifdef GMX_THREAD_MPI
-    /* thread-MPI currently puts the thread number in the process name,
-     * we might want to change this, as this is inconsistent with what
-     * most MPI implementations would do when running on a single node.
-     */
-    return 0;
-#else
-    int  resultlen, hostnum, i, j;
-    char mpi_hostname[MPI_MAX_PROCESSOR_NAME], hostnum_str[MPI_MAX_PROCESSOR_NAME];
+#if defined GMX_LIB_MPI && defined GMX_TARGET_BGQ
+#include <spi/include/kernel/location.h>
 
-    MPI_Get_processor_name(mpi_hostname, &resultlen);
-#ifdef GMX_TARGET_BGQ
+static int bgq_nodenum(void)
+{
+    int           hostnum;
     Personality_t personality;
     Kernel_GetPersonality(&personality, sizeof(personality));
     /* Each MPI rank has a unique coordinate in a 6-dimensional space
@@ -183,38 +168,9 @@ int gmx_hostname_num()
     hostnum += personality.Network_Config.Dcoord;
     hostnum *= personality.Network_Config.Enodes;
     hostnum += personality.Network_Config.Ecoord;
-#else
-    /* This procedure can only differentiate nodes with host names
-     * that end on unique numbers.
-     */
-    i = 0;
-    j = 0;
-    /* Only parse the host name up to the first dot */
-    while (i < resultlen && mpi_hostname[i] != '.')
-    {
-        if (std::isdigit(mpi_hostname[i]))
-        {
-            hostnum_str[j++] = mpi_hostname[i];
-        }
-        i++;
-    }
-    hostnum_str[j] = '\0';
-    if (j == 0)
-    {
-        hostnum = 0;
-    }
-    else
-    {
-        /* Use only the last 9 decimals, so we don't overflow an int */
-        hostnum = std::strtol(hostnum_str + std::max(0, j-9), NULL, 10);
-    }
-#endif
 
     if (debug)
     {
-        std::fprintf(debug, "In gmx_hostname_num: hostname '%s', hostnum %d\n",
-                     mpi_hostname, hostnum);
-#ifdef GMX_TARGET_BGQ
         std::fprintf(debug,
                      "Torus ID A: %d / %d B: %d / %d C: %d / %d D: %d / %d E: %d / %d\n"
                      "Node ID T: %d / %d core: %d / %d hardware thread: %d / %d\n",
@@ -234,11 +190,39 @@ int gmx_hostname_num()
                      64,
                      Kernel_ProcessorThreadID(),
                      4);
-#endif
     }
     return hostnum;
+}
+#endif
+
+int gmx_physicalnode_id_hash(void)
+{
+    int hash;
+
+#ifndef GMX_MPI
+    hash = 0;
+#else
+#ifdef GMX_THREAD_MPI
+    /* thread-MPI currently puts the thread number in the process name,
+     * we might want to change this, as this is inconsistent with what
+     * most MPI implementations would do when running on a single node.
+     */
+    hash = 0;
+#else
+#ifdef GMX_TARGET_BGQ
+    hash = bgq_nodenum();
+#else
+    hash = mpi_hostname_hash();
 #endif
 #endif
+#endif
+
+    if (debug)
+    {
+        fprintf(debug, "In gmx_physicalnode_id_hash: hash %d\n", hash);
+    }
+
+    return hash;
 }
 
 #ifdef GMX_LIB_MPI
index a14a2a18337db775b2c4383f5fe1377a874c7590..179b91005e48762966a0dac588b517b63fd3c0eb 100644 (file)
@@ -91,7 +91,7 @@ void _where(const char *file, int line)
         if (bFirst) /* we repeat the check in the locked section because things
                        might have changed */
         {
-            if ((temp = getenv("WHERE")) != NULL)
+            if ((temp = getenv("GMX_PRINT_DEBUG_LINES")) != NULL)
             {
                 nskip = strtol(temp, NULL, 10);
             }
index 312d6a4a8e03ebc57ba6b5c307f35c846bde66cc..81f9c77d8c670a4215178fcddeae2fe204b95561 100644 (file)
@@ -434,7 +434,7 @@ FILE *gmx_ffopen(const char *file, const char *mode)
         /* Check whether we should be using buffering (default) or not
          * (for debugging)
          */
-        if (bUnbuffered || ((bufsize = getenv("LOG_BUFS")) != NULL))
+        if (bUnbuffered || ((bufsize = getenv("GMX_LOG_BUFFER")) != NULL))
         {
             /* Check whether to use completely unbuffered */
             if (bUnbuffered)
index 03141a25a7cf34474f8ac566acd2a4a0e1a0cba6..a8fb5a52deec970017af31f1f15437b9bc0fccb8 100644 (file)
 #define GMX_UTILITY_REAL_H
 
 /*! \brief Double precision accuracy */
-#define GMX_DOUBLE_EPS   1.11022302E-16
+#define GMX_DOUBLE_EPS   2.2204460492503131e-16
 
 /*! \brief Maximum double precision value - reduced 1 unit in last digit for MSVC */
-#define GMX_DOUBLE_MAX   1.79769312E+308
+#define GMX_DOUBLE_MAX   1.7976931348623157e+308
 
 /*! \brief Minimum double precision value */
-#define GMX_DOUBLE_MIN   2.22507386E-308
+#define GMX_DOUBLE_MIN   2.2250738585072014e-308
 
 /*! \brief Single precision accuracy */
-#define GMX_FLOAT_EPS    5.96046448E-08
+#define GMX_FLOAT_EPS    1.19209290e-07F
 
 /*! \brief Maximum single precision value - reduced 1 unit in last digit for MSVC */
-#define GMX_FLOAT_MAX    3.40282346E+38
+#define GMX_FLOAT_MAX    3.40282346E+38F
 
 /*! \brief Minimum single precision value */
-#define GMX_FLOAT_MIN    1.17549435E-38
+#define GMX_FLOAT_MIN    1.175494351E-38F
 
 
 /*! \typedef real
index 88c78dc9be381fbf3cde0db6ae2127b585800d4f..c8b4db19d5d8f3208ff92c3acd520d3f11e4effb 100644 (file)
@@ -190,7 +190,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     gmx_shellfc_t     shellfc;
     int               count, nconverged = 0;
     double            tcount                 = 0;
-    gmx_bool          bConverged             = TRUE, bOK, bSumEkinhOld, bExchanged, bNeedRepartition;
+    gmx_bool          bConverged             = TRUE, bOK, bSumEkinhOld, bDoReplEx, bExchanged, bNeedRepartition;
     gmx_bool          bResetCountersHalfMaxH = FALSE;
     gmx_bool          bVV, bIterativeCase, bFirstIterate, bTemp, bPres, bTrotter;
     gmx_bool          bUpdateDoLR;
@@ -461,15 +461,6 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         set_constraints(constr, top, ir, mdatoms, cr);
     }
 
-    if (repl_ex_nst > 0)
-    {
-        /* We need to be sure replica exchange can only occur
-         * when the energies are current */
-        check_nst_param(fplog, cr, "nstcalcenergy", ir->nstcalcenergy,
-                        "repl_ex_nst", &repl_ex_nst);
-        /* This check needs to happen before inter-simulation
-         * signals are initialized, too */
-    }
     if (repl_ex_nst > 0 && MASTER(cr))
     {
         repl_ex = init_replica_exchange(fplog, cr->ms, state_global, ir,
@@ -784,6 +775,9 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                             && (ir->bExpanded) && (step > 0) && (!bStartingFromCpt));
         }
 
+        bDoReplEx = ((repl_ex_nst > 0) && (step > 0) && !bLastStep &&
+                     do_per_step(step, repl_ex_nst));
+
         if (bSimAnn)
         {
             update_annealing_target_temp(&(ir->opts), t);
@@ -1013,7 +1007,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
         do_ene = (do_per_step(step, ir->nstenergy) || bLastStep);
 
-        if (do_ene || do_log)
+        if (do_ene || do_log || bDoReplEx)
         {
             bCalcVir  = TRUE;
             bCalcEner = TRUE;
@@ -1804,8 +1798,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
         /* Replica exchange */
         bExchanged = FALSE;
-        if ((repl_ex_nst > 0) && (step > 0) && !bLastStep &&
-            do_per_step(step, repl_ex_nst))
+        if (bDoReplEx)
         {
             bExchanged = replica_exchange(fplog, cr, repl_ex,
                                           state_global, enerd,
index 480820b9814ed8882ca656761d8e04031615f87e..b3238d39c8f9db46b571f6aca34c90a992092352 100644 (file)
@@ -201,7 +201,7 @@ t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
     logo->bQuitOnClick = bQuitOnClick;
     InitWin(&logo->wd, 0, 0, 360, 270, 1, "GROMACS");
     bg = LIGHTGREY;
-    if ((newcol = getenv("LOGO")) != NULL)
+    if ((newcol = getenv("GMX_LOGO_COLOR")) != NULL)
     {
         GetNamedColor(x11, newcol, &bg);
     }
index eb2608b85d7e2886791f275e979d2740a0505115..1ebe3ce51e865dfc5ce888f27bae5e07162989ae 100644 (file)
@@ -323,7 +323,7 @@ t_x11 *GetX11(int *argc, char *argv[])
     title = strdup(argv[0]);
 
     /* First check environment */
-    fontname = getenv("GMXFONT");
+    fontname = getenv("GMX_FONT");
     display  = getenv("DISPLAY");
 
     snew(ARGV, *argc);