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,"");
134 static void sp_print(FILE *out,const char *s)
139 space(out,(80-slen)/2);
140 fprintf(out,"%s\n",s);
143 static void ster_print(FILE *out,const char *s)
148 sprintf(buf,":-) %s (-:",s);
150 space(out,(80-slen)/2);
151 fprintf(out,"%s\n",buf);
155 static void pukeit(const char *db,const char *defstring, char *retstring,
156 int retsize, int *cqnum)
163 if (be_cool() && ((fp = low_libopen(db,FALSE)) != NULL)) {
164 nhlp=fget_lines(fp,&help);
165 /* for libraries we can use the low-level close routines */
168 *cqnum=nhlp*rando(&seed);
169 if (strlen(help[*cqnum]) >= STRLEN)
170 help[*cqnum][STRLEN-1] = '\0';
171 strncpy(retstring,help[*cqnum],retsize);
173 for(i=0; (i<nhlp); i++)
178 strncpy(retstring,defstring,retsize);
181 void bromacs(char *retstring, int retsize)
185 pukeit("bromacs.dat",
186 "Groningen Machine for Chemical Simulation",
187 retstring,retsize,&dum);
190 void cool_quote(char *retstring, int retsize, int *cqnum)
201 /* protect audience from explicit lyrics */
202 snew(tmpstr,retsize+1);
203 pukeit("gurgle.dat","Thanx for Using GROMACS - Have a Nice Day",
206 if ((ptr = strchr(tmpstr,'_')) != NULL) {
209 sprintf(retstring,"\"%s\" %s",tmpstr,ptr);
212 strcpy(retstring,tmpstr);
217 void CopyRight(FILE *out,const char *szProgram)
219 /* Dont change szProgram arbitrarily - it must be argv[0], i.e. the
220 * name of a file. Otherwise, we won't be able to find the library dir.
222 #define NCR (int)asize(CopyrightText)
224 #define NGPL 0 /*FAH has an exception permission from GPL to allow digital signatures in Gromacs*/
226 #define NGPL (int)asize(GPLText)
229 char buf[256],tmpstr[1024];
233 set_program_name("Gromacs");
235 set_program_name(szProgram);
238 ster_print(out,"G R O M A C S");
241 bromacs(tmpstr,1023);
242 sp_print(out,tmpstr);
245 ster_print(out,GromacsVersion());
248 /* fprintf(out,"\n");*/
250 /* sp_print(out,"PLEASE NOTE: THIS IS A BETA VERSION\n");
252 fprintf(out,"\n"); */
254 for(i=0; (i<NCR); i++)
255 sp_print(out,CopyrightText[i]);
256 for(i=0; (i<NGPL); i++)
257 sp_print(out,GPLText[i]);
261 sprintf(buf,"%s",Program());
263 strcat(buf," (double precision)");
275 /* protect the audience from suggestive discussions */
276 cool_quote(cq,1023,&cqnum);
279 fprintf(fp,"\ngcq#%d: %s\n\n",cqnum,cq);
281 fprintf(fp,"\n%s\n\n",cq);
293 void please_cite(FILE *fp,const char *key)
295 static const t_citerec citedb[] = {
297 "M. P. Allen and D. J. Tildesley",
298 "Computer simulation of liquids",
299 "Oxford Science Publications",
302 "H. J. C. Berendsen, D. van der Spoel and R. van Drunen",
303 "GROMACS: A message-passing parallel molecular dynamics implementation",
307 "H. J. C. Berendsen, J. P. M. Postma, A. DiNola and J. R. Haak",
308 "Molecular dynamics with coupling to an external bath",
310 81, 1984, "3684-3690" },
312 "J. P. Ryckaert and G. Ciccotti and H. J. C. Berendsen",
313 "Numerical Integration of the Cartesian Equations of Motion of a System with Constraints; Molecular Dynamics of n-Alkanes",
315 23, 1977, "327-341" },
317 "S. Miyamoto and P. A. Kollman",
318 "SETTLE: An Analytical Version of the SHAKE and RATTLE Algorithms for Rigid Water Models",
320 13, 1992, "952-962" },
322 "D. T. Cromer & J. B. Mann",
323 "X-ray scattering factors computed from numerical Hartree-Fock wave functions",
327 "E. Barth and K. Kuczera and B. Leimkuhler and R. D. Skeel",
328 "Algorithms for Constrained Molecular Dynamics",
330 16, 1995, "1192-1209" },
332 "U. Essman, L. Perela, M. L. Berkowitz, T. Darden, H. Lee and L. G. Pedersen ",
333 "A smooth particle mesh Ewald method",
335 103, 1995, "8577-8592" },
337 "A. E. Torda and R. M. Scheek and W. F. van Gunsteren",
338 "Time-dependent distance restraints in molecular dynamics simulations",
340 157, 1989, "289-294" },
342 "I. G. Tironi and R. Sperb and P. E. Smith and W. F. van Gunsteren",
343 "Generalized reaction field method for molecular dynamics simulations",
345 102, 1995, "5451-5459" },
347 "B. Hess and H. Bekker and H. J. C. Berendsen and J. G. E. M. Fraaije",
348 "LINCS: A Linear Constraint Solver for molecular simulations",
350 18, 1997, "1463-1472" },
353 "P-LINCS: A Parallel Linear Constraint Solver for molecular simulation",
354 "J. Chem. Theory Comput.",
355 4, 2008, "116-122" },
357 "B. Hess and C. Kutzner and D. van der Spoel and E. Lindahl",
358 "GROMACS 4: Algorithms for highly efficient, load-balanced, and scalable molecular simulation",
359 "J. Chem. Theory Comput.",
360 4, 2008, "435-447" },
362 "Y. In-Chul and M. L. Berkowitz",
363 "Ewald summation for systems with slab geometry",
365 111, 1999, "3155-3162" },
367 "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",
368 "Prediction of Protein Conformational Freedom From Distance Constrains",
370 29, 1997, "240-251" },
372 "D. van der Spoel and P. J. van Maaren and H. J. C. Berendsen",
373 "A systematic study of water models for molecular simulation. Derivation of models optimized for use with a reaction-field.",
375 108, 1998, "10220-10230" },
377 "D. S. Wishart and A. M. Nip",
378 "Protein Chemical Shift Analysis: A Practical Guide",
379 "Biochem. Cell Biol.",
380 76, 1998, "153-163" },
382 "V. N. Maiorov and G. M. Crippen",
383 "Size-Independent Comparison of Protein Three-Dimensional Structures",
384 "PROTEINS: Struct. Funct. Gen.",
385 22, 1995, "273-283" },
387 "K. A. Feenstra and B. Hess and H. J. C. Berendsen",
388 "Improving Efficiency of Large Time-scale Molecular Dynamics Simulations of Hydrogen-rich Systems",
390 20, 1999, "786-798" },
392 "N. Timneanu and C. Caleman and J. Hajdu and D. van der Spoel",
393 "Auger Electron Cascades in Water and Ice",
395 299, 2004, "277-283" },
397 "E. Lindahl and B. Hess and D. van der Spoel",
398 "GROMACS 3.0: A package for molecular simulation and trajectory analysis",
400 7, 2001, "306-317" },
402 "J. Wang and W. Wang and S. Huo and M. Lee and P. A. Kollman",
403 "Solvation model based on weighted solvent accessible surface area",
405 105, 2001, "5055-5067" },
407 "D. Eisenberg and A. D. McLachlan",
408 "Solvation energy in protein folding and binding",
410 319, 1986, "199-203" },
412 "Frank Eisenhaber and Philip Lijnzaad and Patrick Argos and Chris Sander and Michael Scharf",
413 "The Double Cube Lattice Method: Efficient Approaches to Numerical Integration of Surface Area and Volume and to Dot Surface Contouring of Molecular Assemblies",
415 16, 1995, "273-284" },
417 "B. Hess, H. Saint-Martin and H.J.C. Berendsen",
418 "Flexible constraints: an adiabatic treatment of quantum degrees of freedom, with application to the flexible and polarizable MCDHO model for water",
420 116, 2002, "9602-9610" },
422 "Csaba Hetenyi and David van der Spoel",
423 "Efficient docking of peptides to proteins without prior knowledge of the binding site.",
425 11, 2002, "1729-1737" },
427 "B. Hess and R.M. Scheek",
428 "Orientation restraints in molecular dynamics simulations using time and ensemble averaging",
430 164, 2003, "19-27" },
432 "A. K. Rappe and W. A. Goddard III",
433 "Charge Equillibration for Molecular Dynamics Simulations",
435 95, 1991, "3358-3363" },
437 "Y. Mu, P. H. Nguyen and G. Stock",
438 "Energy landscape of a small peptide revelaed by dihedral angle principal component analysis",
439 "Prot. Struct. Funct. Bioinf.",
442 "T. Okabe and M. Kawata and Y. Okamoto and M. Mikami",
443 "Replica-exchange {M}onte {C}arlo method for the isobaric-isothermal ensemble",
445 335, 2001, "435-439" },
447 "K. Hukushima and K. Nemoto",
448 "Exchange Monte Carlo Method and Application to Spin Glass Simulations",
449 "J. Phys. Soc. Jpn.",
450 65, 1996, "1604-1608" },
453 "Dipolar Relaxation and Nuclear Overhauser effects in nonrigid molecules: The effect of fluctuating internuclear distances",
455 72, 1980, "6035-6043" },
457 "P. Bultinck and W. Langenaeker and P. Lahorte and F. De Proft and P. Geerlings and M. Waroquier and J. P. Tollenaere",
458 "The electronegativity equalization method I: Parametrization and validation for atomic charge calculations",
460 106, 2002, "7887-7894" },
462 "Q. Y. Yang and K. A. Sharp",
463 "Atomic charge parameters for the finite difference Poisson-Boltzmann method using electronegativity neutralization",
464 "J. Chem. Theory Comput.",
465 2, 2006, "1152-1167" },
467 "D. van der Spoel, E. Lindahl, B. Hess, G. Groenhof, A. E. Mark and H. J. C. Berendsen",
468 "GROMACS: Fast, Flexible and Free",
470 26, 2005, "1701-1719" },
472 "D. van der Spoel, P. J. van Maaren, P. Larsson and N. Timneanu",
473 "Thermodynamics of hydrogen bonding in hydrophilic and hydrophobic media",
475 110, 2006, "4393-4398" },
477 "D. van der Spoel and M. M. Seibert",
478 "Protein folding kinetics and thermodynamics from atomistic simulations",
479 "Phys. Rev. Letters",
480 96, 2006, "238102" },
483 "Transverse-current autocorrelation-function calculations of the shear viscosity for molecular liquids",
485 49, 1994, "359-366" },
487 "G. Bussi, D. Donadio and M. Parrinello",
488 "Canonical sampling through velocity rescaling",
490 126, 2007, "014101" },
492 "J. S. Hub and B. L. de Groot",
493 "Does CO2 permeate through Aquaporin-1?",
495 91, 2006, "842-848" },
497 "J. S. Hub and B. L. de Groot",
498 "Mechanism of selectivity in aquaporins and aquaglyceroporins",
500 105, 2008, "1198-1203" },
502 "M. S. Friedrichs, P. Eastman, V. Vaidyanathan, M. Houston, S. LeGrand, A. L. Beberg, D. L. Ensign, C. M. Bruns, and V. S. Pande",
503 "Accelerating Molecular Dynamic Simulation on Graphics Processing Units",
505 30, 2009, "864-872" },
507 "O. Engin, A. Villa, M. Sayar and B. Hess",
508 "Driving Forces for Adsorption of Amphiphilic Peptides to Air-Water Interface",
512 "H. Wang, F. Dommert, C.Holm",
513 "Optimizing working parameters of the smooth particle mesh Ewald algorithm in terms of accuracy and efficiency",
518 #define NSTR (int)asize(citedb)
523 #define LINE_WIDTH 79
528 for(index=0; (index<NSTR) && (strcmp(citedb[index].key,key) != 0); index++)
531 fprintf(fp,"\n++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++\n");
533 /* Insert newlines */
534 author = wrap_lines(citedb[index].author,LINE_WIDTH,0,FALSE);
535 title = wrap_lines(citedb[index].title,LINE_WIDTH,0,FALSE);
536 fprintf(fp,"%s\n%s\n%s %d (%d) pp. %s\n",
537 author,title,citedb[index].journal,
538 citedb[index].volume,citedb[index].year,
539 citedb[index].pages);
544 fprintf(fp,"Entry %s not found in citation database\n",key);
546 fprintf(fp,"-------- -------- --- Thank You --- -------- --------\n\n");
551 /* Version information generated at compile time. */
554 /* Fall back to statically defined version. */
555 static const char _gmx_ver_string[]="VERSION " VERSION;
558 /* This routine only returns a static (constant) string, so we use a
559 * mutex to initialize it. Since the string is only written to the
560 * first time, there is no risk with multiple calls overwriting the
561 * output for each other.
563 const char *GromacsVersion()
565 return _gmx_ver_string;
569 void gmx_print_version_info(FILE *fp)
571 fprintf(fp, "Version: %s\n", _gmx_ver_string);
573 fprintf(fp, "GIT SHA1 hash: %s\n", _gmx_full_git_hash);
574 /* Only print out the branch information if present.
575 * The generating script checks whether the branch point actually
576 * coincides with the hash reported above, and produces an empty string
578 if (_gmx_central_base_hash[0] != 0)
580 fprintf(fp, "Branched from: %s\n", _gmx_central_base_hash);