3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * GROningen Mixture of Alchemy and Childrens' Stories
50 /* This file is completely threadsafe - keep it that way! */
52 #include "gromacs/legacyheaders/futil.h"
53 #include "gromacs/legacyheaders/macros.h"
54 #include "gromacs/legacyheaders/random.h"
55 #include "gromacs/legacyheaders/smalloc.h"
56 #include "gromacs/legacyheaders/statutil.h"
57 #include "gromacs/legacyheaders/strdb.h"
58 #include "gromacs/legacyheaders/string2.h"
59 #include "gromacs/legacyheaders/vec.h"
61 #include "gromacs/fft/fft.h"
63 #include "buildinfo.h"
65 static gmx_bool be_cool(void)
67 /* Yes, it is bad to check the environment variable every call,
68 * but we dont call this routine often, and it avoids using
69 * a mutex for locking the variable...
71 #ifdef GMX_COOL_QUOTES
72 return (getenv("GMX_NO_QUOTES") == NULL);
79 static void space(FILE *out, int n)
81 fprintf(out, "%*s", n, "");
84 static void sp_print(FILE *out, const char *s)
89 space(out, (80-slen)/2);
90 fprintf(out, "%s\n", s);
93 static void ster_print(FILE *out, const char *s)
98 snprintf(buf, 128, ":-) %s (-:", s);
100 space(out, (80-slen)/2);
101 fprintf(out, "%s\n", buf);
105 static void pukeit(const char *db, const char *defstring, char *retstring,
106 int retsize, int *cqnum)
113 if (be_cool() && ((fp = low_libopen(db, FALSE)) != NULL))
115 nhlp = fget_lines(fp, &help);
116 /* for libraries we can use the low-level close routines */
119 *cqnum = static_cast<int>(nhlp*rando(&seed));
120 if (strlen(help[*cqnum]) >= STRLEN)
122 help[*cqnum][STRLEN-1] = '\0';
124 strncpy(retstring, help[*cqnum], retsize);
125 for (i = 0; (i < nhlp); i++)
134 strncpy(retstring, defstring, retsize);
138 void bromacs(char *retstring, int retsize)
142 pukeit("bromacs.dat",
143 "Groningen Machine for Chemical Simulation",
144 retstring, retsize, &dum);
147 void cool_quote(char *retstring, int retsize, int *cqnum)
162 /* protect audience from explicit lyrics */
163 snew(tmpstr, retsize+1);
164 pukeit("gurgle.dat", "Thanx for Using GROMACS - Have a Nice Day",
165 tmpstr, retsize-2, p);
167 if ((ptr = strchr(tmpstr, '_')) != NULL)
171 sprintf(retstring, "\"%s\" %s", tmpstr, ptr);
175 strcpy(retstring, tmpstr);
180 void CopyRight(FILE *out, const char *szProgram)
182 static const char * CopyrightText[] = {
183 "Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,",
184 "Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, ",
185 "Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, ",
186 "Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, ",
187 "Michael Shirts, Alfons Sijbers, Peter Tieleman,\n",
188 "Berk Hess, David van der Spoel, and Erik Lindahl.\n",
189 "Copyright (c) 1991-2000, University of Groningen, The Netherlands.",
190 "Copyright (c) 2001-2010, The GROMACS development team at",
191 "Uppsala University & The Royal Institute of Technology, Sweden.",
192 "check out http://www.gromacs.org for more information.\n"
195 static const char * LicenseText[] = {
196 "This program is free software; you can redistribute it and/or",
197 "modify it under the terms of the GNU Lesser General Public License",
198 "as published by the Free Software Foundation; either version 2.1",
199 "of the License, or (at your option) any later version."
202 /* Dont change szProgram arbitrarily - it must be argv[0], i.e. the
203 * name of a file. Otherwise, we won't be able to find the library dir.
206 #define NCR (int)asize(CopyrightText)
207 /* TODO: Is this exception still needed? */
209 #define NLICENSE 0 /*FAH has an exception permission from LGPL to allow digital signatures in Gromacs*/
211 #define NLICENSE (int)asize(LicenseText)
214 char buf[256], tmpstr[1024];
218 set_program_name("Gromacs");
220 set_program_name(szProgram);
223 ster_print(out, "G R O M A C S");
226 bromacs(tmpstr, 1023);
227 sp_print(out, tmpstr);
230 ster_print(out, GromacsVersion());
233 if (getenv("GMX_NO_CREDITS"))
238 /* fprintf(out,"\n");*/
240 /* sp_print(out,"PLEASE NOTE: THIS IS A BETA VERSION\n");
242 fprintf(out,"\n"); */
244 for (i = 0; (i < NCR); i++)
246 sp_print(out, CopyrightText[i]);
248 for (i = 0; (i < NLICENSE); i++)
250 sp_print(out, LicenseText[i]);
255 snprintf(buf, 256, "%s", Program());
257 strcat(buf, " (double precision)");
259 ster_print(out, buf);
264 void gmx_thanx(FILE *fp)
269 /* protect the audience from suggestive discussions */
270 cool_quote(cq, 1023, &cqnum);
274 fprintf(fp, "\ngcq#%d: %s\n\n", cqnum, cq);
278 fprintf(fp, "\n%s\n\n", cq);
291 void please_cite(FILE *fp, const char *key)
293 static const t_citerec citedb[] = {
295 "M. P. Allen and D. J. Tildesley",
296 "Computer simulation of liquids",
297 "Oxford Science Publications",
300 "H. J. C. Berendsen, D. van der Spoel and R. van Drunen",
301 "GROMACS: A message-passing parallel molecular dynamics implementation",
305 "H. J. C. Berendsen, J. P. M. Postma, A. DiNola and J. R. Haak",
306 "Molecular dynamics with coupling to an external bath",
308 81, 1984, "3684-3690" },
310 "J. P. Ryckaert and G. Ciccotti and H. J. C. Berendsen",
311 "Numerical Integration of the Cartesian Equations of Motion of a System with Constraints; Molecular Dynamics of n-Alkanes",
313 23, 1977, "327-341" },
315 "S. Miyamoto and P. A. Kollman",
316 "SETTLE: An Analytical Version of the SHAKE and RATTLE Algorithms for Rigid Water Models",
318 13, 1992, "952-962" },
320 "D. T. Cromer & J. B. Mann",
321 "X-ray scattering factors computed from numerical Hartree-Fock wave functions",
325 "E. Barth and K. Kuczera and B. Leimkuhler and R. D. Skeel",
326 "Algorithms for Constrained Molecular Dynamics",
328 16, 1995, "1192-1209" },
330 "U. Essmann, L. Perera, M. L. Berkowitz, T. Darden, H. Lee and L. G. Pedersen ",
331 "A smooth particle mesh Ewald method",
333 103, 1995, "8577-8592" },
335 "A. E. Torda and R. M. Scheek and W. F. van Gunsteren",
336 "Time-dependent distance restraints in molecular dynamics simulations",
338 157, 1989, "289-294" },
340 "I. G. Tironi and R. Sperb and P. E. Smith and W. F. van Gunsteren",
341 "Generalized reaction field method for molecular dynamics simulations",
343 102, 1995, "5451-5459" },
345 "B. Hess and H. Bekker and H. J. C. Berendsen and J. G. E. M. Fraaije",
346 "LINCS: A Linear Constraint Solver for molecular simulations",
348 18, 1997, "1463-1472" },
351 "P-LINCS: A Parallel Linear Constraint Solver for molecular simulation",
352 "J. Chem. Theory Comput.",
353 4, 2008, "116-122" },
355 "B. Hess and C. Kutzner and D. van der Spoel and E. Lindahl",
356 "GROMACS 4: Algorithms for highly efficient, load-balanced, and scalable molecular simulation",
357 "J. Chem. Theory Comput.",
358 4, 2008, "435-447" },
360 "J. S. Hub, B. L. de Groot and D. van der Spoel",
361 "g_wham - A free weighted histogram analysis implementation including robust error and autocorrelation estimates",
362 "J. Chem. Theory Comput.",
363 6, 2010, "3713-3720"},
365 "Y. In-Chul and M. L. Berkowitz",
366 "Ewald summation for systems with slab geometry",
368 111, 1999, "3155-3162" },
370 "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",
371 "Prediction of Protein Conformational Freedom From Distance Constrains",
373 29, 1997, "240-251" },
375 "D. van der Spoel and P. J. van Maaren and H. J. C. Berendsen",
376 "A systematic study of water models for molecular simulation. Derivation of models optimized for use with a reaction-field.",
378 108, 1998, "10220-10230" },
380 "D. S. Wishart and A. M. Nip",
381 "Protein Chemical Shift Analysis: A Practical Guide",
382 "Biochem. Cell Biol.",
383 76, 1998, "153-163" },
385 "V. N. Maiorov and G. M. Crippen",
386 "Size-Independent Comparison of Protein Three-Dimensional Structures",
387 "PROTEINS: Struct. Funct. Gen.",
388 22, 1995, "273-283" },
390 "K. A. Feenstra and B. Hess and H. J. C. Berendsen",
391 "Improving Efficiency of Large Time-scale Molecular Dynamics Simulations of Hydrogen-rich Systems",
393 20, 1999, "786-798" },
395 "Tuanan C. Lourenco and Mariny F. C. Coelho and Teodorico C. Ramalho and David van der Spoel and Luciano T. Costa",
396 "Insights on the Solubility of CO2 in 1-Ethyl-3-methylimidazolium Bis(trifluoromethylsulfonyl)imide from the Microscopic Point of View",
397 "Environ. Sci. Technol.",
398 47, 2013, "7421-7429" },
400 "N. Timneanu and C. Caleman and J. Hajdu and D. van der Spoel",
401 "Auger Electron Cascades in Water and Ice",
403 299, 2004, "277-283" },
405 "T. A. Pascal and S. T. Lin and W. A. Goddard III",
406 "Thermodynamics of liquids: standard molar entropies and heat capacities of common solvents from 2PT molecular dynamics",
407 "Phys. Chem. Chem. Phys.",
408 13, 2011, "169-181" },
410 "C. Caleman and P. J. van Maaren and M. Hong and J. S. Hub and L. T. da Costa and D. van der Spoel",
411 "Force Field Benchmark of Organic Liquids: Density, Enthalpy of Vaporization, Heat Capacities, Surface Tension, Isothermal Compressibility, Volumetric Expansion Coefficient, and Dielectric Constant",
412 "J. Chem. Theo. Comp.",
415 "E. Lindahl and B. Hess and D. van der Spoel",
416 "GROMACS 3.0: A package for molecular simulation and trajectory analysis",
418 7, 2001, "306-317" },
420 "J. Wang and W. Wang and S. Huo and M. Lee and P. A. Kollman",
421 "Solvation model based on weighted solvent accessible surface area",
423 105, 2001, "5055-5067" },
425 "D. Eisenberg and A. D. McLachlan",
426 "Solvation energy in protein folding and binding",
428 319, 1986, "199-203" },
431 "van der Waals Volumes and Radii",
433 68, 1964, "441-451" },
435 "Frank Eisenhaber and Philip Lijnzaad and Patrick Argos and Chris Sander and Michael Scharf",
436 "The Double Cube Lattice Method: Efficient Approaches to Numerical Integration of Surface Area and Volume and to Dot Surface Contouring of Molecular Assemblies",
438 16, 1995, "273-284" },
440 "B. Hess, H. Saint-Martin and H.J.C. Berendsen",
441 "Flexible constraints: an adiabatic treatment of quantum degrees of freedom, with application to the flexible and polarizable MCDHO model for water",
443 116, 2002, "9602-9610" },
445 "Csaba Hetenyi and David van der Spoel",
446 "Efficient docking of peptides to proteins without prior knowledge of the binding site.",
448 11, 2002, "1729-1737" },
450 "B. Hess and R.M. Scheek",
451 "Orientation restraints in molecular dynamics simulations using time and ensemble averaging",
453 164, 2003, "19-27" },
455 "A. K. Rappe and W. A. Goddard III",
456 "Charge Equillibration for Molecular Dynamics Simulations",
458 95, 1991, "3358-3363" },
460 "Y. Mu, P. H. Nguyen and G. Stock",
461 "Energy landscape of a small peptide revelaed by dihedral angle principal component analysis",
462 "Prot. Struct. Funct. Bioinf.",
465 "T. Okabe and M. Kawata and Y. Okamoto and M. Mikami",
466 "Replica-exchange {M}onte {C}arlo method for the isobaric-isothermal ensemble",
468 335, 2001, "435-439" },
470 "K. Hukushima and K. Nemoto",
471 "Exchange Monte Carlo Method and Application to Spin Glass Simulations",
472 "J. Phys. Soc. Jpn.",
473 65, 1996, "1604-1608" },
476 "Dipolar Relaxation and Nuclear Overhauser effects in nonrigid molecules: The effect of fluctuating internuclear distances",
478 72, 1980, "6035-6043" },
480 "P. Bultinck and W. Langenaeker and P. Lahorte and F. De Proft and P. Geerlings and M. Waroquier and J. P. Tollenaere",
481 "The electronegativity equalization method I: Parametrization and validation for atomic charge calculations",
483 106, 2002, "7887-7894" },
485 "Q. Y. Yang and K. A. Sharp",
486 "Atomic charge parameters for the finite difference Poisson-Boltzmann method using electronegativity neutralization",
487 "J. Chem. Theory Comput.",
488 2, 2006, "1152-1167" },
490 "D. van der Spoel, E. Lindahl, B. Hess, G. Groenhof, A. E. Mark and H. J. C. Berendsen",
491 "GROMACS: Fast, Flexible and Free",
493 26, 2005, "1701-1719" },
495 "D. van der Spoel, P. J. van Maaren, P. Larsson and N. Timneanu",
496 "Thermodynamics of hydrogen bonding in hydrophilic and hydrophobic media",
498 110, 2006, "4393-4398" },
500 "D. van der Spoel and M. M. Seibert",
501 "Protein folding kinetics and thermodynamics from atomistic simulations",
502 "Phys. Rev. Letters",
503 96, 2006, "238102" },
506 "Transverse-current autocorrelation-function calculations of the shear viscosity for molecular liquids",
508 49, 1994, "359-366" },
510 "G. Bussi, D. Donadio and M. Parrinello",
511 "Canonical sampling through velocity rescaling",
513 126, 2007, "014101" },
515 "J. S. Hub and B. L. de Groot",
516 "Does CO2 permeate through Aquaporin-1?",
518 91, 2006, "842-848" },
520 "J. S. Hub and B. L. de Groot",
521 "Mechanism of selectivity in aquaporins and aquaglyceroporins",
523 105, 2008, "1198-1203" },
525 "M. S. Friedrichs, P. Eastman, V. Vaidyanathan, M. Houston, S. LeGrand, A. L. Beberg, D. L. Ensign, C. M. Bruns, and V. S. Pande",
526 "Accelerating Molecular Dynamic Simulation on Graphics Processing Units",
528 30, 2009, "864-872" },
530 "O. Engin, A. Villa, M. Sayar and B. Hess",
531 "Driving Forces for Adsorption of Amphiphilic Peptides to Air-Water Interface",
533 114, 2010, "11093" },
535 "S. Fritsch, C. Junghans and K. Kremer",
536 "Adaptive molecular simulation study on structure formation of toluene around C60 using Gromacs",
537 "J. Chem. Theo. Comp.",
540 "C. Junghans and S. Poblete",
541 "A reference implementation of the adaptive resolution scheme in ESPResSo",
545 "H. Wang, F. Dommert, C.Holm",
546 "Optimizing working parameters of the smooth particle mesh Ewald algorithm in terms of accuracy and efficiency",
548 133, 2010, "034117" },
550 "Y. Sugita, Y. Okamoto",
551 "Replica-exchange molecular dynamics method for protein folding",
553 314, 1999, "141-151" },
555 "C. Kutzner and J. Czub and H. Grubmuller",
556 "Keep it Flexible: Driving Macromolecular Rotary Motions in Atomistic Simulations with GROMACS",
557 "J. Chem. Theory Comput.",
558 7, 2011, "1381-1393" },
560 "M. Hoefling, N. Lima, D. Haenni, C.A.M. Seidel, B. Schuler, H. Grubmuller",
561 "Structural Heterogeneity and Quantitative FRET Efficiency Distributions of Polyprolines through a Hybrid Atomistic Simulation and Monte Carlo Approach",
565 "R. W. Hockney and J. W. Eastwood",
566 "Computer simulation using particles",
570 "V. Ballenegger, J.J. Cerda, and C. Holm",
571 "How to Convert SPME to P3M: Influence Functions and Error Estimates",
572 "J. Chem. Theory Comput.",
573 8, 2012, "936-947" },
575 "Garmay Yu, Shvetsov A, Karelov D, Lebedev D, Radulescu A, Petukhov M, Isaev-Ivanov V",
576 "Correlated motion of protein subdomains and large-scale conformational flexibility of RecA protein filament",
577 "Journal of Physics: Conference Series",
578 340, 2012, "012094" }
580 #define NSTR (int)asize(citedb)
585 #define LINE_WIDTH 79
592 for (index = 0; (index < NSTR) && (strcmp(citedb[index].key, key) != 0); index++)
597 fprintf(fp, "\n++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++\n");
600 /* Insert newlines */
601 author = wrap_lines(citedb[index].author, LINE_WIDTH, 0, FALSE);
602 title = wrap_lines(citedb[index].title, LINE_WIDTH, 0, FALSE);
603 fprintf(fp, "%s\n%s\n%s %d (%d) pp. %s\n",
604 author, title, citedb[index].journal,
605 citedb[index].volume, citedb[index].year,
606 citedb[index].pages);
612 fprintf(fp, "Entry %s not found in citation database\n", key);
614 fprintf(fp, "-------- -------- --- Thank You --- -------- --------\n\n");
618 #ifdef GMX_GIT_VERSION_INFO
619 /* Version information generated at compile time. */
620 #include "gromacs/utility/gitversion.h"
622 /* Fall back to statically defined version. */
623 static const char _gmx_ver_string[] = "VERSION " VERSION;
626 const char *GromacsVersion()
628 return _gmx_ver_string;
631 void gmx_print_version_info_gpu(FILE *fp);
633 void gmx_print_version_info(FILE *fp)
635 fprintf(fp, "Gromacs version: %s\n", _gmx_ver_string);
636 #ifdef GMX_GIT_VERSION_INFO
637 fprintf(fp, "GIT SHA1 hash: %s\n", _gmx_full_git_hash);
638 /* Only print out the branch information if present.
639 * The generating script checks whether the branch point actually
640 * coincides with the hash reported above, and produces an empty string
642 if (_gmx_central_base_hash[0] != 0)
644 fprintf(fp, "Branched from: %s\n", _gmx_central_base_hash);
649 fprintf(fp, "Precision: double\n");
651 fprintf(fp, "Precision: single\n");
653 fprintf(fp, "Memory model: %lu bit\n", 8*sizeof(void *));
655 #ifdef GMX_THREAD_MPI
656 fprintf(fp, "MPI library: thread_mpi\n");
657 #elif defined(GMX_MPI)
658 fprintf(fp, "MPI library: MPI\n");
660 fprintf(fp, "MPI library: none\n");
663 fprintf(fp, "OpenMP support: enabled\n");
665 fprintf(fp, "OpenMP support: disabled\n");
668 fprintf(fp, "GPU support: enabled\n");
670 fprintf(fp, "GPU support: disabled\n");
672 /* A preprocessor trick to avoid duplicating logic from vec.h */
673 #define gmx_stringify2(x) #x
674 #define gmx_stringify(x) gmx_stringify2(x)
675 fprintf(fp, "invsqrt routine: %s\n", gmx_stringify(gmx_invsqrt(x)));
676 fprintf(fp, "CPU acceleration: %s\n", GMX_CPU_ACCELERATION_STRING);
678 fprintf(fp, "FFT library: %s\n", gmx_fft_get_version_info());
679 #ifdef GMX_LARGEFILES
680 fprintf(fp, "Large file support: enabled\n");
682 fprintf(fp, "Large file support: disabled\n");
685 fprintf(fp, "RDTSCP usage: enabled\n");
687 fprintf(fp, "RDTSCP usage: disabled\n");
690 fprintf(fp, "Built on: %s\n", BUILD_TIME);
691 fprintf(fp, "Built by: %s\n", BUILD_USER);
692 fprintf(fp, "Build OS/arch: %s\n", BUILD_HOST);
693 fprintf(fp, "Build CPU vendor: %s\n", BUILD_CPU_VENDOR);
694 fprintf(fp, "Build CPU brand: %s\n", BUILD_CPU_BRAND);
695 fprintf(fp, "Build CPU family: %d Model: %d Stepping: %d\n",
696 BUILD_CPU_FAMILY, BUILD_CPU_MODEL, BUILD_CPU_STEPPING);
697 /* TODO: The below strings can be quite long, so it would be nice to wrap
698 * them. Can wait for later, as the master branch has ready code to do all
700 fprintf(fp, "Build CPU features: %s\n", BUILD_CPU_FEATURES);
701 fprintf(fp, "C compiler: %s\n", BUILD_C_COMPILER);
702 fprintf(fp, "C compiler flags: %s\n", BUILD_CFLAGS);
703 fprintf(fp, "C++ compiler: %s\n", BUILD_CXX_COMPILER);
704 fprintf(fp, "C++ compiler flags: %s\n", BUILD_CXXFLAGS);
706 /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
707 fprintf(fp, "Linked with Intel MKL version %d.%d.%d.\n",
708 __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__);
711 gmx_print_version_info_gpu(fp);