2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team,
6 * check out http://www.gromacs.org for more information.
7 * Copyright (c) 2012,2013, by the GROMACS development team, led by
8 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9 * others, as listed in the AUTHORS file in the top-level source
10 * directory and at http://www.gromacs.org.
12 * GROMACS is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * as published by the Free Software Foundation; either version 2.1
15 * of the License, or (at your option) any later version.
17 * GROMACS is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with GROMACS; if not, see
24 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * If you want to redistribute modifications to GROMACS, please
28 * consider that scientific software is very special. Version
29 * control is crucial - bugs must be traceable. We will be happy to
30 * consider code for inclusion in the official distribution, but
31 * derived work must not be called official GROMACS. Details are found
32 * in the README & COPYING files - if they are missing, get the
33 * official version at http://www.gromacs.org.
35 * To help us fund GROMACS development, we humbly ask that you cite
36 * the research papers on the package. Check out http://www.gromacs.org.
43 #include <thread_mpi.h>
53 /* This file is completely threadsafe - keep it that way! */
68 #include "buildinfo.h"
69 #include "gmx_cpuid.h"
71 static void pr_two(FILE *out, int c, int i)
75 fprintf(out, "%c0%1d", c, i);
79 fprintf(out, "%c%2d", c, i);
83 void pr_difftime(FILE *out, double dt)
85 int ndays, nhours, nmins, nsecs;
86 gmx_bool bPrint, bPrinted;
89 dt = dt-24*3600*ndays;
99 fprintf(out, "%d", ndays);
101 bPrint = bPrint || (nhours > 0);
106 pr_two(out, 'd', nhours);
110 fprintf(out, "%d", nhours);
113 bPrinted = bPrinted || bPrint;
114 bPrint = bPrint || (nmins > 0);
119 pr_two(out, 'h', nmins);
123 fprintf(out, "%d", nmins);
126 bPrinted = bPrinted || bPrint;
129 pr_two(out, ':', nsecs);
133 fprintf(out, "%ds", nsecs);
139 gmx_bool be_cool(void)
141 /* Yes, it is bad to check the environment variable every call,
142 * but we dont call this routine often, and it avoids using
143 * a mutex for locking the variable...
145 #ifdef GMX_COOL_QUOTES
146 return (getenv("GMX_NO_QUOTES") == NULL);
153 void space(FILE *out, int n)
155 fprintf(out, "%*s", n, "");
158 static void sp_print(FILE *out, const char *s)
163 space(out, (80-slen)/2);
164 fprintf(out, "%s\n", s);
167 static void ster_print(FILE *out, const char *s)
172 snprintf(buf, 128, ":-) %s (-:", s);
174 space(out, (80-slen)/2);
175 fprintf(out, "%s\n", buf);
179 static void pukeit(const char *db, const char *defstring, char *retstring,
180 int retsize, int *cqnum)
187 if (be_cool() && ((fp = low_libopen(db, FALSE)) != NULL))
189 nhlp = fget_lines(fp, &help);
190 /* for libraries we can use the low-level close routines */
193 *cqnum = nhlp*rando(&seed);
194 if (strlen(help[*cqnum]) >= STRLEN)
196 help[*cqnum][STRLEN-1] = '\0';
198 strncpy(retstring, help[*cqnum], retsize);
199 for (i = 0; (i < nhlp); i++)
207 strncpy(retstring, defstring, retsize);
211 void bromacs(char *retstring, int retsize)
215 pukeit("bromacs.dat",
216 "Groningen Machine for Chemical Simulation",
217 retstring, retsize, &dum);
220 void cool_quote(char *retstring, int retsize, int *cqnum)
235 /* protect audience from explicit lyrics */
236 snew(tmpstr, retsize+1);
237 pukeit("gurgle.dat", "Thanx for Using GROMACS - Have a Nice Day",
238 tmpstr, retsize-2, p);
240 if ((ptr = strchr(tmpstr, '_')) != NULL)
244 sprintf(retstring, "\"%s\" %s", tmpstr, ptr);
248 strcpy(retstring, tmpstr);
253 void CopyRight(FILE *out, const char *szProgram)
255 /* Dont change szProgram arbitrarily - it must be argv[0], i.e. the
256 * name of a file. Otherwise, we won't be able to find the library dir.
258 #define NCR (int)asize(CopyrightText)
259 /* TODO: Is this exception still needed? */
261 #define NLICENSE 0 /*FAH has an exception permission from GPL to allow digital signatures in Gromacs*/
263 #define NLICENSE (int)asize(LicenseText)
266 char buf[256], tmpstr[1024];
270 set_program_name("Gromacs");
272 set_program_name(szProgram);
275 ster_print(out, "G R O M A C S");
278 bromacs(tmpstr, 1023);
279 sp_print(out, tmpstr);
282 ster_print(out, GromacsVersion());
285 /* fprintf(out,"\n");*/
287 /* sp_print(out,"PLEASE NOTE: THIS IS A BETA VERSION\n");
289 fprintf(out,"\n"); */
291 for (i = 0; (i < NCR); i++)
293 sp_print(out, CopyrightText[i]);
295 for (i = 0; (i < NLICENSE); i++)
297 sp_print(out, LicenseText[i]);
302 snprintf(buf, 256, "%s", Program());
304 strcat(buf, " (double precision)");
306 ster_print(out, buf);
316 /* protect the audience from suggestive discussions */
317 cool_quote(cq, 1023, &cqnum);
321 fprintf(fp, "\ngcq#%d: %s\n\n", cqnum, cq);
325 fprintf(fp, "\n%s\n\n", cq);
338 void please_cite(FILE *fp, const char *key)
340 static const t_citerec citedb[] = {
342 "M. P. Allen and D. J. Tildesley",
343 "Computer simulation of liquids",
344 "Oxford Science Publications",
347 "H. J. C. Berendsen, D. van der Spoel and R. van Drunen",
348 "GROMACS: A message-passing parallel molecular dynamics implementation",
352 "H. J. C. Berendsen, J. P. M. Postma, A. DiNola and J. R. Haak",
353 "Molecular dynamics with coupling to an external bath",
355 81, 1984, "3684-3690" },
357 "J. P. Ryckaert and G. Ciccotti and H. J. C. Berendsen",
358 "Numerical Integration of the Cartesian Equations of Motion of a System with Constraints; Molecular Dynamics of n-Alkanes",
360 23, 1977, "327-341" },
362 "S. Miyamoto and P. A. Kollman",
363 "SETTLE: An Analytical Version of the SHAKE and RATTLE Algorithms for Rigid Water Models",
365 13, 1992, "952-962" },
367 "D. T. Cromer & J. B. Mann",
368 "X-ray scattering factors computed from numerical Hartree-Fock wave functions",
372 "E. Barth and K. Kuczera and B. Leimkuhler and R. D. Skeel",
373 "Algorithms for Constrained Molecular Dynamics",
375 16, 1995, "1192-1209" },
377 "U. Essmann, L. Perera, M. L. Berkowitz, T. Darden, H. Lee and L. G. Pedersen ",
378 "A smooth particle mesh Ewald method",
380 103, 1995, "8577-8592" },
382 "A. E. Torda and R. M. Scheek and W. F. van Gunsteren",
383 "Time-dependent distance restraints in molecular dynamics simulations",
385 157, 1989, "289-294" },
387 "I. G. Tironi and R. Sperb and P. E. Smith and W. F. van Gunsteren",
388 "Generalized reaction field method for molecular dynamics simulations",
390 102, 1995, "5451-5459" },
392 "B. Hess and H. Bekker and H. J. C. Berendsen and J. G. E. M. Fraaije",
393 "LINCS: A Linear Constraint Solver for molecular simulations",
395 18, 1997, "1463-1472" },
398 "P-LINCS: A Parallel Linear Constraint Solver for molecular simulation",
399 "J. Chem. Theory Comput.",
400 4, 2008, "116-122" },
402 "B. Hess and C. Kutzner and D. van der Spoel and E. Lindahl",
403 "GROMACS 4: Algorithms for highly efficient, load-balanced, and scalable molecular simulation",
404 "J. Chem. Theory Comput.",
405 4, 2008, "435-447" },
407 "J. S. Hub, B. L. de Groot and D. van der Spoel",
408 "g_wham - A free weighted histogram analysis implementation including robust error and autocorrelation estimates",
409 "J. Chem. Theory Comput.",
410 6, 2010, "3713-3720"},
412 "Y. In-Chul and M. L. Berkowitz",
413 "Ewald summation for systems with slab geometry",
415 111, 1999, "3155-3162" },
417 "B. L. de Groot and D. M. F. van Aalten and R. M. Scheek and A. Amadei and G. Vriend and H. J. C. Berendsen",
418 "Prediction of Protein Conformational Freedom From Distance Constrains",
420 29, 1997, "240-251" },
422 "D. van der Spoel and P. J. van Maaren and H. J. C. Berendsen",
423 "A systematic study of water models for molecular simulation. Derivation of models optimized for use with a reaction-field.",
425 108, 1998, "10220-10230" },
427 "D. S. Wishart and A. M. Nip",
428 "Protein Chemical Shift Analysis: A Practical Guide",
429 "Biochem. Cell Biol.",
430 76, 1998, "153-163" },
432 "V. N. Maiorov and G. M. Crippen",
433 "Size-Independent Comparison of Protein Three-Dimensional Structures",
434 "PROTEINS: Struct. Funct. Gen.",
435 22, 1995, "273-283" },
437 "K. A. Feenstra and B. Hess and H. J. C. Berendsen",
438 "Improving Efficiency of Large Time-scale Molecular Dynamics Simulations of Hydrogen-rich Systems",
440 20, 1999, "786-798" },
442 "N. Timneanu and C. Caleman and J. Hajdu and D. van der Spoel",
443 "Auger Electron Cascades in Water and Ice",
445 299, 2004, "277-283" },
447 "T. A. Pascal and S. T. Lin and W. A. Goddard III",
448 "Thermodynamics of liquids: standard molar entropies and heat capacities of common solvents from 2PT molecular dynamics",
449 "Phys. Chem. Chem. Phys.",
450 13, 2011, "169-181" },
452 "C. Caleman and P. J. van Maaren and M. Hong and J. S. Hub and L. T. da Costa and D. van der Spoel",
453 "Force Field Benchmark of Organic Liquids: Density, Enthalpy of Vaporization, Heat Capacities, Surface Tension, Isothermal Compressibility, Volumetric Expansion Coefficient, and Dielectric Constant",
454 "J. Chem. Theo. Comp.",
457 "E. Lindahl and B. Hess and D. van der Spoel",
458 "GROMACS 3.0: A package for molecular simulation and trajectory analysis",
460 7, 2001, "306-317" },
462 "J. Wang and W. Wang and S. Huo and M. Lee and P. A. Kollman",
463 "Solvation model based on weighted solvent accessible surface area",
465 105, 2001, "5055-5067" },
467 "D. Eisenberg and A. D. McLachlan",
468 "Solvation energy in protein folding and binding",
470 319, 1986, "199-203" },
472 "Frank Eisenhaber and Philip Lijnzaad and Patrick Argos and Chris Sander and Michael Scharf",
473 "The Double Cube Lattice Method: Efficient Approaches to Numerical Integration of Surface Area and Volume and to Dot Surface Contouring of Molecular Assemblies",
475 16, 1995, "273-284" },
477 "B. Hess, H. Saint-Martin and H.J.C. Berendsen",
478 "Flexible constraints: an adiabatic treatment of quantum degrees of freedom, with application to the flexible and polarizable MCDHO model for water",
480 116, 2002, "9602-9610" },
482 "Csaba Hetenyi and David van der Spoel",
483 "Efficient docking of peptides to proteins without prior knowledge of the binding site.",
485 11, 2002, "1729-1737" },
487 "B. Hess and R.M. Scheek",
488 "Orientation restraints in molecular dynamics simulations using time and ensemble averaging",
490 164, 2003, "19-27" },
492 "A. K. Rappe and W. A. Goddard III",
493 "Charge Equillibration for Molecular Dynamics Simulations",
495 95, 1991, "3358-3363" },
497 "Y. Mu, P. H. Nguyen and G. Stock",
498 "Energy landscape of a small peptide revelaed by dihedral angle principal component analysis",
499 "Prot. Struct. Funct. Bioinf.",
502 "T. Okabe and M. Kawata and Y. Okamoto and M. Mikami",
503 "Replica-exchange {M}onte {C}arlo method for the isobaric-isothermal ensemble",
505 335, 2001, "435-439" },
507 "K. Hukushima and K. Nemoto",
508 "Exchange Monte Carlo Method and Application to Spin Glass Simulations",
509 "J. Phys. Soc. Jpn.",
510 65, 1996, "1604-1608" },
513 "Dipolar Relaxation and Nuclear Overhauser effects in nonrigid molecules: The effect of fluctuating internuclear distances",
515 72, 1980, "6035-6043" },
517 "P. Bultinck and W. Langenaeker and P. Lahorte and F. De Proft and P. Geerlings and M. Waroquier and J. P. Tollenaere",
518 "The electronegativity equalization method I: Parametrization and validation for atomic charge calculations",
520 106, 2002, "7887-7894" },
522 "Q. Y. Yang and K. A. Sharp",
523 "Atomic charge parameters for the finite difference Poisson-Boltzmann method using electronegativity neutralization",
524 "J. Chem. Theory Comput.",
525 2, 2006, "1152-1167" },
527 "D. van der Spoel, E. Lindahl, B. Hess, G. Groenhof, A. E. Mark and H. J. C. Berendsen",
528 "GROMACS: Fast, Flexible and Free",
530 26, 2005, "1701-1719" },
532 "D. van der Spoel, P. J. van Maaren, P. Larsson and N. Timneanu",
533 "Thermodynamics of hydrogen bonding in hydrophilic and hydrophobic media",
535 110, 2006, "4393-4398" },
537 "D. van der Spoel and M. M. Seibert",
538 "Protein folding kinetics and thermodynamics from atomistic simulations",
539 "Phys. Rev. Letters",
540 96, 2006, "238102" },
543 "Transverse-current autocorrelation-function calculations of the shear viscosity for molecular liquids",
545 49, 1994, "359-366" },
547 "G. Bussi, D. Donadio and M. Parrinello",
548 "Canonical sampling through velocity rescaling",
550 126, 2007, "014101" },
552 "J. S. Hub and B. L. de Groot",
553 "Does CO2 permeate through Aquaporin-1?",
555 91, 2006, "842-848" },
557 "J. S. Hub and B. L. de Groot",
558 "Mechanism of selectivity in aquaporins and aquaglyceroporins",
560 105, 2008, "1198-1203" },
562 "M. S. Friedrichs, P. Eastman, V. Vaidyanathan, M. Houston, S. LeGrand, A. L. Beberg, D. L. Ensign, C. M. Bruns, and V. S. Pande",
563 "Accelerating Molecular Dynamic Simulation on Graphics Processing Units",
565 30, 2009, "864-872" },
567 "O. Engin, A. Villa, M. Sayar and B. Hess",
568 "Driving Forces for Adsorption of Amphiphilic Peptides to Air-Water Interface",
570 114, 2010, "11093" },
572 "S. Fritsch, C. Junghans and K. Kremer",
573 "Adaptive molecular simulation study on structure formation of toluene around C60 using Gromacs",
574 "J. Chem. Theo. Comp.",
577 "C. Junghans and S. Poblete",
578 "A reference implementation of the adaptive resolution scheme in ESPResSo",
582 "H. Wang, F. Dommert, C.Holm",
583 "Optimizing working parameters of the smooth particle mesh Ewald algorithm in terms of accuracy and efficiency",
585 133, 2010, "034117" },
587 "Y. Sugita, Y. Okamoto",
588 "Replica-exchange molecular dynamics method for protein folding",
590 314, 1999, "141-151" },
592 "C. Kutzner and J. Czub and H. Grubmuller",
593 "Keep it Flexible: Driving Macromolecular Rotary Motions in Atomistic Simulations with GROMACS",
594 "J. Chem. Theory Comput.",
595 7, 2011, "1381-1393" },
597 "M. Hoefling, N. Lima, D. Haenni, C.A.M. Seidel, B. Schuler, H. Grubmuller",
598 "Structural Heterogeneity and Quantitative FRET Efficiency Distributions of Polyprolines through a Hybrid Atomistic Simulation and Monte Carlo Approach",
602 "R. W. Hockney and J. W. Eastwood",
603 "Computer simulation using particles",
607 "V. Ballenegger, J.J. Cerda, and C. Holm",
608 "How to Convert SPME to P3M: Influence Functions and Error Estimates",
609 "J. Chem. Theory Comput.",
610 8, 2012, "936-947" },
612 "Garmay Yu, Shvetsov A, Karelov D, Lebedev D, Radulescu A, Petukhov M, Isaev-Ivanov V",
613 "Correlated motion of protein subdomains and large-scale conformational flexibility of RecA protein filament",
614 "Journal of Physics: Conference Series",
615 340, 2012, "012094" }
617 #define NSTR (int)asize(citedb)
622 #define LINE_WIDTH 79
629 for (index = 0; (index < NSTR) && (strcmp(citedb[index].key, key) != 0); index++)
634 fprintf(fp, "\n++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++\n");
637 /* Insert newlines */
638 author = wrap_lines(citedb[index].author, LINE_WIDTH, 0, FALSE);
639 title = wrap_lines(citedb[index].title, LINE_WIDTH, 0, FALSE);
640 fprintf(fp, "%s\n%s\n%s %d (%d) pp. %s\n",
641 author, title, citedb[index].journal,
642 citedb[index].volume, citedb[index].year,
643 citedb[index].pages);
649 fprintf(fp, "Entry %s not found in citation database\n", key);
651 fprintf(fp, "-------- -------- --- Thank You --- -------- --------\n\n");
656 /* Version information generated at compile time. */
659 /* Fall back to statically defined version. */
660 static const char _gmx_ver_string[] = "VERSION " VERSION;
663 const char *GromacsVersion()
665 return _gmx_ver_string;
668 void gmx_print_version_info_gpu(FILE *fp);
670 void gmx_print_version_info(FILE *fp)
672 fprintf(fp, "Gromacs version: %s\n", _gmx_ver_string);
674 fprintf(fp, "GIT SHA1 hash: %s\n", _gmx_full_git_hash);
675 /* Only print out the branch information if present.
676 * The generating script checks whether the branch point actually
677 * coincides with the hash reported above, and produces an empty string
679 if (_gmx_central_base_hash[0] != 0)
681 fprintf(fp, "Branched from: %s\n", _gmx_central_base_hash);
686 fprintf(fp, "Precision: double\n");
688 fprintf(fp, "Precision: single\n");
690 fprintf(fp, "Memory model: %lu bit\n", 8*sizeof(void *));
692 #ifdef GMX_THREAD_MPI
693 fprintf(fp, "MPI library: thread_mpi\n");
694 #elif defined(GMX_MPI)
695 fprintf(fp, "MPI library: MPI\n");
697 fprintf(fp, "MPI library: none\n");
700 fprintf(fp, "OpenMP support: enabled\n");
702 fprintf(fp, "OpenMP support: disabled\n");
705 fprintf(fp, "GPU support: enabled\n");
707 fprintf(fp, "GPU support: disabled\n");
709 /* A preprocessor trick to avoid duplicating logic from vec.h */
710 #define gmx_stringify2(x) #x
711 #define gmx_stringify(x) gmx_stringify2(x)
712 fprintf(fp, "invsqrt routine: %s\n", gmx_stringify(gmx_invsqrt(x)));
713 fprintf(fp, "CPU acceleration: %s\n", GMX_CPU_ACCELERATION_STRING);
715 /* TODO: Would be nicer to wrap this in a gmx_fft_version() call, but
716 * since that is currently in mdlib, can wait for master. */
717 #ifdef GMX_FFT_FFTPACK
718 fprintf(fp, "FFT library: fftpack (built-in)\n");
719 #elif defined(GMX_FFT_FFTW3) && defined(GMX_NATIVE_WINDOWS)
720 fprintf(fp, "FFT library: %s\n", "fftw3");
721 #elif defined(GMX_FFT_FFTW3) && defined(GMX_DOUBLE)
722 fprintf(fp, "FFT library: %s\n", fftw_version);
723 #elif defined(GMX_FFT_FFTW3)
724 fprintf(fp, "FFT library: %s\n", fftwf_version);
725 #elif defined(GMX_FFT_MKL)
726 fprintf(fp, "FFT library: MKL\n");
728 fprintf(fp, "FFT library: unknown\n");
730 #ifdef GMX_LARGEFILES
731 fprintf(fp, "Large file support: enabled\n");
733 fprintf(fp, "Large file support: disabled\n");
736 fprintf(fp, "RDTSCP usage: enabled\n");
738 fprintf(fp, "RDTSCP usage: disabled\n");
741 fprintf(fp, "Built on: %s\n", BUILD_TIME);
742 fprintf(fp, "Built by: %s\n", BUILD_USER);
743 fprintf(fp, "Build OS/arch: %s\n", BUILD_HOST);
744 fprintf(fp, "Build CPU vendor: %s\n", BUILD_CPU_VENDOR);
745 fprintf(fp, "Build CPU brand: %s\n", BUILD_CPU_BRAND);
746 fprintf(fp, "Build CPU family: %d Model: %d Stepping: %d\n",
747 BUILD_CPU_FAMILY, BUILD_CPU_MODEL, BUILD_CPU_STEPPING);
748 /* TODO: The below strings can be quite long, so it would be nice to wrap
749 * them. Can wait for later, as the master branch has ready code to do all
751 fprintf(fp, "Build CPU features: %s\n", BUILD_CPU_FEATURES);
752 fprintf(fp, "C compiler: %s\n", BUILD_C_COMPILER);
753 fprintf(fp, "C compiler flags: %s\n", BUILD_CFLAGS);
754 if (BUILD_CXX_COMPILER[0] != '\0')
756 fprintf(fp, "C++ compiler: %s\n", BUILD_CXX_COMPILER);
757 fprintf(fp, "C++ compiler flags: %s\n", BUILD_CXXFLAGS);
760 /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
761 fprintf(fp, "Linked with Intel MKL version %d.%d.%d.\n",
762 __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__);
765 gmx_print_version_info_gpu(fp);