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
40 #include <thread_mpi.h>
43 /* This file is completely threadsafe - keep it that way! */
58 static void pr_two(FILE *out,int c,int i)
61 fprintf(out,"%c0%1d",c,i);
63 fprintf(out,"%c%2d",c,i);
66 void pr_difftime(FILE *out,double dt)
68 int ndays,nhours,nmins,nsecs;
69 gmx_bool bPrint,bPrinted;
72 dt = dt-24*3600*ndays;
81 fprintf(out,"%d",ndays);
82 bPrint=bPrint || (nhours > 0);
85 pr_two(out,'d',nhours);
87 fprintf(out,"%d",nhours);
89 bPrinted=bPrinted || bPrint;
90 bPrint=bPrint || (nmins > 0);
93 pr_two(out,'h',nmins);
95 fprintf(out,"%d",nmins);
97 bPrinted=bPrinted || bPrint;
99 pr_two(out,':',nsecs);
101 fprintf(out,"%ds",nsecs);
106 gmx_bool be_cool(void)
108 /* Yes, it is bad to check the environment variable every call,
109 * but we dont call this routine often, and it avoids using
110 * a mutex for locking the variable...
116 return (getenv("GMX_NO_QUOTES") == NULL);
120 void space(FILE *out, int n)
122 fprintf(out,"%*s",n,"");
125 static void sp_print(FILE *out,const char *s)
130 space(out,(80-slen)/2);
131 fprintf(out,"%s\n",s);
134 static void ster_print(FILE *out,const char *s)
139 snprintf(buf,128,":-) %s (-:",s);
141 space(out,(80-slen)/2);
142 fprintf(out,"%s\n",buf);
146 static void pukeit(const char *db,const char *defstring, char *retstring,
147 int retsize, int *cqnum)
154 if (be_cool() && ((fp = low_libopen(db,FALSE)) != NULL)) {
155 nhlp=fget_lines(fp,&help);
156 /* for libraries we can use the low-level close routines */
159 *cqnum=nhlp*rando(&seed);
160 if (strlen(help[*cqnum]) >= STRLEN)
161 help[*cqnum][STRLEN-1] = '\0';
162 strncpy(retstring,help[*cqnum],retsize);
163 for(i=0; (i<nhlp); i++)
168 strncpy(retstring,defstring,retsize);
171 void bromacs(char *retstring, int retsize)
175 pukeit("bromacs.dat",
176 "Groningen Machine for Chemical Simulation",
177 retstring,retsize,&dum);
180 void cool_quote(char *retstring, int retsize, int *cqnum)
191 /* protect audience from explicit lyrics */
192 snew(tmpstr,retsize+1);
193 pukeit("gurgle.dat","Thanx for Using GROMACS - Have a Nice Day",
196 if ((ptr = strchr(tmpstr,'_')) != NULL) {
199 sprintf(retstring,"\"%s\" %s",tmpstr,ptr);
202 strcpy(retstring,tmpstr);
207 void CopyRight(FILE *out,const char *szProgram)
209 /* Dont change szProgram arbitrarily - it must be argv[0], i.e. the
210 * name of a file. Otherwise, we won't be able to find the library dir.
212 #define NCR (int)asize(CopyrightText)
214 #define NGPL 0 /*FAH has an exception permission from GPL to allow digital signatures in Gromacs*/
216 #define NGPL (int)asize(GPLText)
219 char buf[256],tmpstr[1024];
223 set_program_name("Gromacs");
225 set_program_name(szProgram);
228 ster_print(out,"G R O M A C S");
231 bromacs(tmpstr,1023);
232 sp_print(out,tmpstr);
235 ster_print(out,GromacsVersion());
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++)
245 sp_print(out,CopyrightText[i]);
246 for(i=0; (i<NGPL); i++)
247 sp_print(out,GPLText[i]);
251 snprintf(buf,256,"%s",Program());
253 strcat(buf," (double precision)");
265 /* protect the audience from suggestive discussions */
266 cool_quote(cq,1023,&cqnum);
269 fprintf(fp,"\ngcq#%d: %s\n\n",cqnum,cq);
271 fprintf(fp,"\n%s\n\n",cq);
283 void please_cite(FILE *fp,const char *key)
285 static const t_citerec citedb[] = {
287 "M. P. Allen and D. J. Tildesley",
288 "Computer simulation of liquids",
289 "Oxford Science Publications",
292 "H. J. C. Berendsen, D. van der Spoel and R. van Drunen",
293 "GROMACS: A message-passing parallel molecular dynamics implementation",
297 "H. J. C. Berendsen, J. P. M. Postma, A. DiNola and J. R. Haak",
298 "Molecular dynamics with coupling to an external bath",
300 81, 1984, "3684-3690" },
302 "J. P. Ryckaert and G. Ciccotti and H. J. C. Berendsen",
303 "Numerical Integration of the Cartesian Equations of Motion of a System with Constraints; Molecular Dynamics of n-Alkanes",
305 23, 1977, "327-341" },
307 "S. Miyamoto and P. A. Kollman",
308 "SETTLE: An Analytical Version of the SHAKE and RATTLE Algorithms for Rigid Water Models",
310 13, 1992, "952-962" },
312 "D. T. Cromer & J. B. Mann",
313 "X-ray scattering factors computed from numerical Hartree-Fock wave functions",
317 "E. Barth and K. Kuczera and B. Leimkuhler and R. D. Skeel",
318 "Algorithms for Constrained Molecular Dynamics",
320 16, 1995, "1192-1209" },
322 "U. Essmann, L. Perera, M. L. Berkowitz, T. Darden, H. Lee and L. G. Pedersen ",
323 "A smooth particle mesh Ewald method",
325 103, 1995, "8577-8592" },
327 "A. E. Torda and R. M. Scheek and W. F. van Gunsteren",
328 "Time-dependent distance restraints in molecular dynamics simulations",
330 157, 1989, "289-294" },
332 "I. G. Tironi and R. Sperb and P. E. Smith and W. F. van Gunsteren",
333 "Generalized reaction field method for molecular dynamics simulations",
335 102, 1995, "5451-5459" },
337 "B. Hess and H. Bekker and H. J. C. Berendsen and J. G. E. M. Fraaije",
338 "LINCS: A Linear Constraint Solver for molecular simulations",
340 18, 1997, "1463-1472" },
343 "P-LINCS: A Parallel Linear Constraint Solver for molecular simulation",
344 "J. Chem. Theory Comput.",
345 4, 2008, "116-122" },
347 "B. Hess and C. Kutzner and D. van der Spoel and E. Lindahl",
348 "GROMACS 4: Algorithms for highly efficient, load-balanced, and scalable molecular simulation",
349 "J. Chem. Theory Comput.",
350 4, 2008, "435-447" },
352 "J. S. Hub, B. L. de Groot and D. van der Spoel",
353 "g_wham - A free weighted histogram analysis implementation including robust error and autocorrelation estimates",
354 "J. Chem. Theory Comput.",
355 6, 2010, "3713-3720"},
357 "Y. In-Chul and M. L. Berkowitz",
358 "Ewald summation for systems with slab geometry",
360 111, 1999, "3155-3162" },
362 "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",
363 "Prediction of Protein Conformational Freedom From Distance Constrains",
365 29, 1997, "240-251" },
367 "D. van der Spoel and P. J. van Maaren and H. J. C. Berendsen",
368 "A systematic study of water models for molecular simulation. Derivation of models optimized for use with a reaction-field.",
370 108, 1998, "10220-10230" },
372 "D. S. Wishart and A. M. Nip",
373 "Protein Chemical Shift Analysis: A Practical Guide",
374 "Biochem. Cell Biol.",
375 76, 1998, "153-163" },
377 "V. N. Maiorov and G. M. Crippen",
378 "Size-Independent Comparison of Protein Three-Dimensional Structures",
379 "PROTEINS: Struct. Funct. Gen.",
380 22, 1995, "273-283" },
382 "K. A. Feenstra and B. Hess and H. J. C. Berendsen",
383 "Improving Efficiency of Large Time-scale Molecular Dynamics Simulations of Hydrogen-rich Systems",
385 20, 1999, "786-798" },
387 "N. Timneanu and C. Caleman and J. Hajdu and D. van der Spoel",
388 "Auger Electron Cascades in Water and Ice",
390 299, 2004, "277-283" },
392 "T. A. Pascal and S. T. Lin and W. A. Goddard III",
393 "Thermodynamics of liquids: standard molar entropies and heat capacities of common solvents from 2PT molecular dynamics",
394 "Phys. Chem. Chem. Phys.",
395 13, 2011, "169-181" },
397 "C. Caleman and M. Hong and J. S. Hub and L. T. da Costa and P. J. van Maaren and D. van der Spoel",
398 "Force Field Benchmark 1: Density, Heat of Vaporization, Heat Capacity, Surface Tension and Dielectric Constant of 152 Organic Liquids",
402 "E. Lindahl and B. Hess and D. van der Spoel",
403 "GROMACS 3.0: A package for molecular simulation and trajectory analysis",
405 7, 2001, "306-317" },
407 "J. Wang and W. Wang and S. Huo and M. Lee and P. A. Kollman",
408 "Solvation model based on weighted solvent accessible surface area",
410 105, 2001, "5055-5067" },
412 "D. Eisenberg and A. D. McLachlan",
413 "Solvation energy in protein folding and binding",
415 319, 1986, "199-203" },
417 "Frank Eisenhaber and Philip Lijnzaad and Patrick Argos and Chris Sander and Michael Scharf",
418 "The Double Cube Lattice Method: Efficient Approaches to Numerical Integration of Surface Area and Volume and to Dot Surface Contouring of Molecular Assemblies",
420 16, 1995, "273-284" },
422 "B. Hess, H. Saint-Martin and H.J.C. Berendsen",
423 "Flexible constraints: an adiabatic treatment of quantum degrees of freedom, with application to the flexible and polarizable MCDHO model for water",
425 116, 2002, "9602-9610" },
427 "Csaba Hetenyi and David van der Spoel",
428 "Efficient docking of peptides to proteins without prior knowledge of the binding site.",
430 11, 2002, "1729-1737" },
432 "B. Hess and R.M. Scheek",
433 "Orientation restraints in molecular dynamics simulations using time and ensemble averaging",
435 164, 2003, "19-27" },
437 "A. K. Rappe and W. A. Goddard III",
438 "Charge Equillibration for Molecular Dynamics Simulations",
440 95, 1991, "3358-3363" },
442 "Y. Mu, P. H. Nguyen and G. Stock",
443 "Energy landscape of a small peptide revelaed by dihedral angle principal component analysis",
444 "Prot. Struct. Funct. Bioinf.",
447 "T. Okabe and M. Kawata and Y. Okamoto and M. Mikami",
448 "Replica-exchange {M}onte {C}arlo method for the isobaric-isothermal ensemble",
450 335, 2001, "435-439" },
452 "K. Hukushima and K. Nemoto",
453 "Exchange Monte Carlo Method and Application to Spin Glass Simulations",
454 "J. Phys. Soc. Jpn.",
455 65, 1996, "1604-1608" },
458 "Dipolar Relaxation and Nuclear Overhauser effects in nonrigid molecules: The effect of fluctuating internuclear distances",
460 72, 1980, "6035-6043" },
462 "P. Bultinck and W. Langenaeker and P. Lahorte and F. De Proft and P. Geerlings and M. Waroquier and J. P. Tollenaere",
463 "The electronegativity equalization method I: Parametrization and validation for atomic charge calculations",
465 106, 2002, "7887-7894" },
467 "Q. Y. Yang and K. A. Sharp",
468 "Atomic charge parameters for the finite difference Poisson-Boltzmann method using electronegativity neutralization",
469 "J. Chem. Theory Comput.",
470 2, 2006, "1152-1167" },
472 "D. van der Spoel, E. Lindahl, B. Hess, G. Groenhof, A. E. Mark and H. J. C. Berendsen",
473 "GROMACS: Fast, Flexible and Free",
475 26, 2005, "1701-1719" },
477 "D. van der Spoel, P. J. van Maaren, P. Larsson and N. Timneanu",
478 "Thermodynamics of hydrogen bonding in hydrophilic and hydrophobic media",
480 110, 2006, "4393-4398" },
482 "D. van der Spoel and M. M. Seibert",
483 "Protein folding kinetics and thermodynamics from atomistic simulations",
484 "Phys. Rev. Letters",
485 96, 2006, "238102" },
488 "Transverse-current autocorrelation-function calculations of the shear viscosity for molecular liquids",
490 49, 1994, "359-366" },
492 "G. Bussi, D. Donadio and M. Parrinello",
493 "Canonical sampling through velocity rescaling",
495 126, 2007, "014101" },
497 "J. S. Hub and B. L. de Groot",
498 "Does CO2 permeate through Aquaporin-1?",
500 91, 2006, "842-848" },
502 "J. S. Hub and B. L. de Groot",
503 "Mechanism of selectivity in aquaporins and aquaglyceroporins",
505 105, 2008, "1198-1203" },
507 "M. S. Friedrichs, P. Eastman, V. Vaidyanathan, M. Houston, S. LeGrand, A. L. Beberg, D. L. Ensign, C. M. Bruns, and V. S. Pande",
508 "Accelerating Molecular Dynamic Simulation on Graphics Processing Units",
510 30, 2009, "864-872" },
512 "O. Engin, A. Villa, M. Sayar and B. Hess",
513 "Driving Forces for Adsorption of Amphiphilic Peptides to Air-Water Interface",
517 "H. Wang, F. Dommert, C.Holm",
518 "Optimizing working parameters of the smooth particle mesh Ewald algorithm in terms of accuracy and efficiency",
523 "Y. Sugita, Y. Okamoto",
524 "Replica-exchange molecular dynamics method for protein folding",
526 314, 1999, "141-151" },
528 #define NSTR (int)asize(citedb)
533 #define LINE_WIDTH 79
538 for(index=0; (index<NSTR) && (strcmp(citedb[index].key,key) != 0); index++)
541 fprintf(fp,"\n++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++\n");
543 /* Insert newlines */
544 author = wrap_lines(citedb[index].author,LINE_WIDTH,0,FALSE);
545 title = wrap_lines(citedb[index].title,LINE_WIDTH,0,FALSE);
546 fprintf(fp,"%s\n%s\n%s %d (%d) pp. %s\n",
547 author,title,citedb[index].journal,
548 citedb[index].volume,citedb[index].year,
549 citedb[index].pages);
554 fprintf(fp,"Entry %s not found in citation database\n",key);
556 fprintf(fp,"-------- -------- --- Thank You --- -------- --------\n\n");
561 /* Version information generated at compile time. */
564 /* Fall back to statically defined version. */
565 static const char _gmx_ver_string[]="VERSION " VERSION;
568 /* This routine only returns a static (constant) string, so we use a
569 * mutex to initialize it. Since the string is only written to the
570 * first time, there is no risk with multiple calls overwriting the
571 * output for each other.
573 const char *GromacsVersion()
575 return _gmx_ver_string;
579 void gmx_print_version_info(FILE *fp)
581 fprintf(fp, "Version: %s\n", _gmx_ver_string);
583 fprintf(fp, "GIT SHA1 hash: %s\n", _gmx_full_git_hash);
584 /* Only print out the branch information if present.
585 * The generating script checks whether the branch point actually
586 * coincides with the hash reported above, and produces an empty string
588 if (_gmx_central_base_hash[0] != 0)
590 fprintf(fp, "Branched from: %s\n", _gmx_central_base_hash);
595 fprintf(fp, "Precision: double\n");
597 fprintf(fp, "Precision: single\n");
601 fprintf(fp, "Parallellization: thread_mpi\n");
602 #elif defined(GMX_MPI)
603 fprintf(fp, "Parallellization: MPI\n");
605 fprintf(fp, "Parallellization: none\n");
608 #ifdef GMX_FFT_FFTPACK
609 fprintf(fp, "FFT Library: fftpack\n");
610 #elif defined(GMX_FFT_FFTW2)
611 fprintf(fp, "FFT Library: fftw2\n");
612 #elif defined(GMX_FFT_FFTW3)
613 fprintf(fp, "FFT Library: fftw3\n");
614 #elif defined(GMX_FFT_MKL)
615 fprintf(fp, "FFT Library: MKL\n");
617 fprintf(fp, "FFT Library: unknown\n");