Moved copyrite.* to fileio from gmxlib and legacyheaders.
[gromacs.git] / src / gromacs / fileio / copyrite.cpp
blob9a3939474cd5780adeb1b7fe78d53b340bd64378
1 /*
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 * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
37 #include "gmxpre.h"
39 #include "copyrite.h"
41 #include "config.h"
43 #include <cstdio>
44 #include <cstdlib>
45 #include <cstring>
46 #include <ctime>
48 #include <algorithm>
50 #ifdef HAVE_LIBMKL
51 #include <mkl.h>
52 #endif
53 #if HAVE_EXTRAE
54 #include <extrae_user_events.h>
55 #endif
57 /* This file is completely threadsafe - keep it that way! */
59 #include "buildinfo.h"
60 #include "gromacs/fft/fft.h"
61 #include "gromacs/fileio/strdb.h"
62 #include "gromacs/math/vec.h"
63 #include "gromacs/random/random.h"
64 #include "gromacs/utility/arraysize.h"
65 #include "gromacs/utility/baseversion.h"
66 #include "gromacs/utility/cstringutil.h"
67 #include "gromacs/utility/exceptions.h"
68 #include "gromacs/utility/futil.h"
69 #include "gromacs/utility/gmxassert.h"
70 #include "gromacs/utility/programcontext.h"
71 #include "gromacs/utility/smalloc.h"
72 #include "gromacs/utility/stringutil.h"
74 static gmx_bool be_cool(void)
76 /* Yes, it is bad to check the environment variable every call,
77 * but we dont call this routine often, and it avoids using
78 * a mutex for locking the variable...
80 #if GMX_COOL_QUOTES
81 return (getenv("GMX_NO_QUOTES") == NULL);
82 #else
83 /*be uncool*/
84 return FALSE;
85 #endif
88 static void pukeit(const char *db, const char *defstring, char *retstring,
89 int retsize, int *cqnum)
91 FILE *fp;
92 char **help;
93 int i, nhlp;
94 gmx_rng_t rng;
96 if (be_cool() && ((fp = low_libopen(db, FALSE)) != NULL))
98 nhlp = fget_lines(fp, &help);
99 /* for libraries we can use the low-level close routines */
100 gmx_ffclose(fp);
101 rng = gmx_rng_init(gmx_rng_make_seed());
102 *cqnum = static_cast<int>(nhlp*gmx_rng_uniform_real(rng));
103 gmx_rng_destroy(rng);
104 if (std::strlen(help[*cqnum]) >= STRLEN)
106 help[*cqnum][STRLEN-1] = '\0';
108 std::strncpy(retstring, help[*cqnum], retsize);
109 for (i = 0; (i < nhlp); i++)
111 sfree(help[i]);
113 sfree(help);
115 else
117 *cqnum = -1;
118 std::strncpy(retstring, defstring, retsize);
122 void bromacs(char *retstring, int retsize)
124 int dum;
126 pukeit("bromacs.dat",
127 "Groningen Machine for Chemical Simulation",
128 retstring, retsize, &dum);
131 void cool_quote(char *retstring, int retsize, int *cqnum)
133 char *tmpstr;
134 char *ptr;
135 int tmpcq, *p;
137 if (cqnum != NULL)
139 p = cqnum;
141 else
143 p = &tmpcq;
146 /* protect audience from explicit lyrics */
147 snew(tmpstr, retsize+1);
148 pukeit("gurgle.dat", "Thanx for Using GROMACS - Have a Nice Day",
149 tmpstr, retsize-2, p);
151 if ((ptr = std::strchr(tmpstr, '_')) != NULL)
153 *ptr = '\0';
154 ptr++;
155 sprintf(retstring, "\"%s\" %s", tmpstr, ptr);
157 else
159 std::strcpy(retstring, tmpstr);
161 sfree(tmpstr);
164 static int centeringOffset(int width, int length)
166 return std::max(width - length, 0) / 2;
169 static void printCentered(FILE *fp, int width, const char *text)
171 const int offset = centeringOffset(width, std::strlen(text));
172 fprintf(fp, "%*s%s", offset, "", text);
175 static void printCopyright(FILE *fp)
177 static const char * const Contributors[] = {
178 "Emile Apol",
179 "Rossen Apostolov",
180 "Herman J.C. Berendsen",
181 "Par Bjelkmar",
182 "Aldert van Buuren",
183 "Rudi van Drunen",
184 "Anton Feenstra",
185 "Sebastian Fritsch",
186 "Gerrit Groenhof",
187 "Christoph Junghans",
188 "Anca Hamuraru",
189 "Vincent Hindriksen",
190 "Dimitrios Karkoulis",
191 "Peter Kasson",
192 "Jiri Kraus",
193 "Carsten Kutzner",
194 "Per Larsson",
195 "Justin A. Lemkul",
196 "Magnus Lundborg",
197 "Pieter Meulenhoff",
198 "Erik Marklund",
199 "Teemu Murtola",
200 "Szilard Pall",
201 "Sander Pronk",
202 "Roland Schulz",
203 "Alexey Shvetsov",
204 "Michael Shirts",
205 "Alfons Sijbers",
206 "Peter Tieleman",
207 "Teemu Virolainen",
208 "Christian Wennberg",
209 "Maarten Wolf"
211 static const char * const CopyrightText[] = {
212 "Copyright (c) 1991-2000, University of Groningen, The Netherlands.",
213 "Copyright (c) 2001-2015, The GROMACS development team at",
214 "Uppsala University, Stockholm University and",
215 "the Royal Institute of Technology, Sweden.",
216 "check out http://www.gromacs.org for more information."
218 static const char * const LicenseText[] = {
219 "GROMACS is free software; you can redistribute it and/or modify it",
220 "under the terms of the GNU Lesser General Public License",
221 "as published by the Free Software Foundation; either version 2.1",
222 "of the License, or (at your option) any later version."
225 #define NCONTRIBUTORS (int)asize(Contributors)
226 #define NCR (int)asize(CopyrightText)
228 // FAH has an exception permission from LGPL to allow digital signatures in Gromacs.
229 #ifdef GMX_FAHCORE
230 #define NLICENSE 0
231 #else
232 #define NLICENSE (int)asize(LicenseText)
233 #endif
235 printCentered(fp, 78, "GROMACS is written by:");
236 fprintf(fp, "\n");
237 for (int i = 0; i < NCONTRIBUTORS; )
239 for (int j = 0; j < 4 && i < NCONTRIBUTORS; ++j, ++i)
241 const int width = 18;
242 char buf[30];
243 const int offset = centeringOffset(width, strlen(Contributors[i]));
244 GMX_RELEASE_ASSERT(strlen(Contributors[i]) + offset < asize(buf),
245 "Formatting buffer is not long enough");
246 std::fill(buf, buf+width, ' ');
247 std::strcpy(buf+offset, Contributors[i]);
248 fprintf(fp, " %-*s", width, buf);
250 fprintf(fp, "\n");
252 printCentered(fp, 78, "and the project leaders:");
253 fprintf(fp, "\n");
254 printCentered(fp, 78, "Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel");
255 fprintf(fp, "\n\n");
256 for (int i = 0; i < NCR; ++i)
258 fprintf(fp, "%s\n", CopyrightText[i]);
260 fprintf(fp, "\n");
261 for (int i = 0; i < NLICENSE; ++i)
263 fprintf(fp, "%s\n", LicenseText[i]);
268 typedef struct {
269 const char *key;
270 const char *author;
271 const char *title;
272 const char *journal;
273 int volume, year;
274 const char *pages;
275 } t_citerec;
277 void please_cite(FILE *fp, const char *key)
279 static const t_citerec citedb[] = {
280 { "Allen1987a",
281 "M. P. Allen and D. J. Tildesley",
282 "Computer simulation of liquids",
283 "Oxford Science Publications",
284 1, 1987, "1" },
285 { "Berendsen95a",
286 "H. J. C. Berendsen, D. van der Spoel and R. van Drunen",
287 "GROMACS: A message-passing parallel molecular dynamics implementation",
288 "Comp. Phys. Comm.",
289 91, 1995, "43-56" },
290 { "Berendsen84a",
291 "H. J. C. Berendsen, J. P. M. Postma, A. DiNola and J. R. Haak",
292 "Molecular dynamics with coupling to an external bath",
293 "J. Chem. Phys.",
294 81, 1984, "3684-3690" },
295 { "Ryckaert77a",
296 "J. P. Ryckaert and G. Ciccotti and H. J. C. Berendsen",
297 "Numerical Integration of the Cartesian Equations of Motion of a System with Constraints; Molecular Dynamics of n-Alkanes",
298 "J. Comp. Phys.",
299 23, 1977, "327-341" },
300 { "Miyamoto92a",
301 "S. Miyamoto and P. A. Kollman",
302 "SETTLE: An Analytical Version of the SHAKE and RATTLE Algorithms for Rigid Water Models",
303 "J. Comp. Chem.",
304 13, 1992, "952-962" },
305 { "Cromer1968a",
306 "D. T. Cromer & J. B. Mann",
307 "X-ray scattering factors computed from numerical Hartree-Fock wave functions",
308 "Acta Cryst. A",
309 24, 1968, "321" },
310 { "Barth95a",
311 "E. Barth and K. Kuczera and B. Leimkuhler and R. D. Skeel",
312 "Algorithms for Constrained Molecular Dynamics",
313 "J. Comp. Chem.",
314 16, 1995, "1192-1209" },
315 { "Essmann95a",
316 "U. Essmann, L. Perera, M. L. Berkowitz, T. Darden, H. Lee and L. G. Pedersen ",
317 "A smooth particle mesh Ewald method",
318 "J. Chem. Phys.",
319 103, 1995, "8577-8592" },
320 { "Torda89a",
321 "A. E. Torda and R. M. Scheek and W. F. van Gunsteren",
322 "Time-dependent distance restraints in molecular dynamics simulations",
323 "Chem. Phys. Lett.",
324 157, 1989, "289-294" },
325 { "Tironi95a",
326 "I. G. Tironi and R. Sperb and P. E. Smith and W. F. van Gunsteren",
327 "Generalized reaction field method for molecular dynamics simulations",
328 "J. Chem. Phys",
329 102, 1995, "5451-5459" },
330 { "Hess97a",
331 "B. Hess and H. Bekker and H. J. C. Berendsen and J. G. E. M. Fraaije",
332 "LINCS: A Linear Constraint Solver for molecular simulations",
333 "J. Comp. Chem.",
334 18, 1997, "1463-1472" },
335 { "Hess2008a",
336 "B. Hess",
337 "P-LINCS: A Parallel Linear Constraint Solver for molecular simulation",
338 "J. Chem. Theory Comput.",
339 4, 2008, "116-122" },
340 { "Hess2008b",
341 "B. Hess and C. Kutzner and D. van der Spoel and E. Lindahl",
342 "GROMACS 4: Algorithms for highly efficient, load-balanced, and scalable molecular simulation",
343 "J. Chem. Theory Comput.",
344 4, 2008, "435-447" },
345 { "Hub2010",
346 "J. S. Hub, B. L. de Groot and D. van der Spoel",
347 "g_wham - A free weighted histogram analysis implementation including robust error and autocorrelation estimates",
348 "J. Chem. Theory Comput.",
349 6, 2010, "3713-3720"},
350 { "In-Chul99a",
351 "Y. In-Chul and M. L. Berkowitz",
352 "Ewald summation for systems with slab geometry",
353 "J. Chem. Phys.",
354 111, 1999, "3155-3162" },
355 { "DeGroot97a",
356 "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",
357 "Prediction of Protein Conformational Freedom From Distance Constrains",
358 "Proteins",
359 29, 1997, "240-251" },
360 { "Spoel98a",
361 "D. van der Spoel and P. J. van Maaren and H. J. C. Berendsen",
362 "A systematic study of water models for molecular simulation. Derivation of models optimized for use with a reaction-field.",
363 "J. Chem. Phys.",
364 108, 1998, "10220-10230" },
365 { "Wishart98a",
366 "D. S. Wishart and A. M. Nip",
367 "Protein Chemical Shift Analysis: A Practical Guide",
368 "Biochem. Cell Biol.",
369 76, 1998, "153-163" },
370 { "Maiorov95",
371 "V. N. Maiorov and G. M. Crippen",
372 "Size-Independent Comparison of Protein Three-Dimensional Structures",
373 "PROTEINS: Struct. Funct. Gen.",
374 22, 1995, "273-283" },
375 { "Feenstra99",
376 "K. A. Feenstra and B. Hess and H. J. C. Berendsen",
377 "Improving Efficiency of Large Time-scale Molecular Dynamics Simulations of Hydrogen-rich Systems",
378 "J. Comput. Chem.",
379 20, 1999, "786-798" },
380 { "Lourenco2013a",
381 "Tuanan C. Lourenco and Mariny F. C. Coelho and Teodorico C. Ramalho and David van der Spoel and Luciano T. Costa",
382 "Insights on the Solubility of CO2 in 1-Ethyl-3-methylimidazolium Bis(trifluoromethylsulfonyl)imide from the Microscopic Point of View",
383 "Environ. Sci. Technol.",
384 47, 2013, "7421-7429" },
385 { "Timneanu2004a",
386 "N. Timneanu and C. Caleman and J. Hajdu and D. van der Spoel",
387 "Auger Electron Cascades in Water and Ice",
388 "Chem. Phys.",
389 299, 2004, "277-283" },
390 { "Pascal2011a",
391 "T. A. Pascal and S. T. Lin and W. A. Goddard III",
392 "Thermodynamics of liquids: standard molar entropies and heat capacities of common solvents from 2PT molecular dynamics",
393 "Phys. Chem. Chem. Phys.",
394 13, 2011, "169-181" },
395 { "Caleman2008a",
396 "C. Caleman and D. van der Spoel",
397 "Picosecond Melting of Ice by an Infrared Laser Pulse: A Simulation Study",
398 "Angew. Chem. Int. Ed",
399 47, 2008, "1417-1420" },
400 { "Caleman2011b",
401 "C. Caleman and P. J. van Maaren and M. Hong and J. S. Hub and L. T. da Costa and D. van der Spoel",
402 "Force Field Benchmark of Organic Liquids: Density, Enthalpy of Vaporization, Heat Capacities, Surface Tension, Isothermal Compressibility, Volumetric Expansion Coefficient, and Dielectric Constant",
403 "J. Chem. Theo. Comp.",
404 8, 2012, "61" },
405 { "Lindahl2001a",
406 "E. Lindahl and B. Hess and D. van der Spoel",
407 "GROMACS 3.0: A package for molecular simulation and trajectory analysis",
408 "J. Mol. Mod.",
409 7, 2001, "306-317" },
410 { "Wang2001a",
411 "J. Wang and W. Wang and S. Huo and M. Lee and P. A. Kollman",
412 "Solvation model based on weighted solvent accessible surface area",
413 "J. Phys. Chem. B",
414 105, 2001, "5055-5067" },
415 { "Eisenberg86a",
416 "D. Eisenberg and A. D. McLachlan",
417 "Solvation energy in protein folding and binding",
418 "Nature",
419 319, 1986, "199-203" },
420 { "Bondi1964a",
421 "A. Bondi",
422 "van der Waals Volumes and Radii",
423 "J. Phys. Chem.",
424 68, 1964, "441-451" },
425 { "Eisenhaber95",
426 "Frank Eisenhaber and Philip Lijnzaad and Patrick Argos and Chris Sander and Michael Scharf",
427 "The Double Cube Lattice Method: Efficient Approaches to Numerical Integration of Surface Area and Volume and to Dot Surface Contouring of Molecular Assemblies",
428 "J. Comp. Chem.",
429 16, 1995, "273-284" },
430 { "Hess2002",
431 "B. Hess, H. Saint-Martin and H.J.C. Berendsen",
432 "Flexible constraints: an adiabatic treatment of quantum degrees of freedom, with application to the flexible and polarizable MCDHO model for water",
433 "J. Chem. Phys.",
434 116, 2002, "9602-9610" },
435 { "Hetenyi2002b",
436 "Csaba Hetenyi and David van der Spoel",
437 "Efficient docking of peptides to proteins without prior knowledge of the binding site.",
438 "Prot. Sci.",
439 11, 2002, "1729-1737" },
440 { "Hess2003",
441 "B. Hess and R.M. Scheek",
442 "Orientation restraints in molecular dynamics simulations using time and ensemble averaging",
443 "J. Magn. Res.",
444 164, 2003, "19-27" },
445 { "Rappe1991a",
446 "A. K. Rappe and W. A. Goddard III",
447 "Charge Equillibration for Molecular Dynamics Simulations",
448 "J. Phys. Chem.",
449 95, 1991, "3358-3363" },
450 { "Mu2005a",
451 "Y. Mu, P. H. Nguyen and G. Stock",
452 "Energy landscape of a small peptide revelaed by dihedral angle principal component analysis",
453 "Prot. Struct. Funct. Bioinf.",
454 58, 2005, "45-52" },
455 { "Okabe2001a",
456 "T. Okabe and M. Kawata and Y. Okamoto and M. Mikami",
457 "Replica-exchange {M}onte {C}arlo method for the isobaric-isothermal ensemble",
458 "Chem. Phys. Lett.",
459 335, 2001, "435-439" },
460 { "Hukushima96a",
461 "K. Hukushima and K. Nemoto",
462 "Exchange Monte Carlo Method and Application to Spin Glass Simulations",
463 "J. Phys. Soc. Jpn.",
464 65, 1996, "1604-1608" },
465 { "Tropp80a",
466 "J. Tropp",
467 "Dipolar Relaxation and Nuclear Overhauser effects in nonrigid molecules: The effect of fluctuating internuclear distances",
468 "J. Chem. Phys.",
469 72, 1980, "6035-6043" },
470 { "Bultinck2002a",
471 "P. Bultinck and W. Langenaeker and P. Lahorte and F. De Proft and P. Geerlings and M. Waroquier and J. P. Tollenaere",
472 "The electronegativity equalization method I: Parametrization and validation for atomic charge calculations",
473 "J. Phys. Chem. A",
474 106, 2002, "7887-7894" },
475 { "Yang2006b",
476 "Q. Y. Yang and K. A. Sharp",
477 "Atomic charge parameters for the finite difference Poisson-Boltzmann method using electronegativity neutralization",
478 "J. Chem. Theory Comput.",
479 2, 2006, "1152-1167" },
480 { "Spoel2005a",
481 "D. van der Spoel, E. Lindahl, B. Hess, G. Groenhof, A. E. Mark and H. J. C. Berendsen",
482 "GROMACS: Fast, Flexible and Free",
483 "J. Comp. Chem.",
484 26, 2005, "1701-1719" },
485 { "Spoel2006b",
486 "D. van der Spoel, P. J. van Maaren, P. Larsson and N. Timneanu",
487 "Thermodynamics of hydrogen bonding in hydrophilic and hydrophobic media",
488 "J. Phys. Chem. B",
489 110, 2006, "4393-4398" },
490 { "Spoel2006d",
491 "D. van der Spoel and M. M. Seibert",
492 "Protein folding kinetics and thermodynamics from atomistic simulations",
493 "Phys. Rev. Letters",
494 96, 2006, "238102" },
495 { "Palmer94a",
496 "B. J. Palmer",
497 "Transverse-current autocorrelation-function calculations of the shear viscosity for molecular liquids",
498 "Phys. Rev. E",
499 49, 1994, "359-366" },
500 { "Bussi2007a",
501 "G. Bussi, D. Donadio and M. Parrinello",
502 "Canonical sampling through velocity rescaling",
503 "J. Chem. Phys.",
504 126, 2007, "014101" },
505 { "Hub2006",
506 "J. S. Hub and B. L. de Groot",
507 "Does CO2 permeate through Aquaporin-1?",
508 "Biophys. J.",
509 91, 2006, "842-848" },
510 { "Hub2008",
511 "J. S. Hub and B. L. de Groot",
512 "Mechanism of selectivity in aquaporins and aquaglyceroporins",
513 "PNAS",
514 105, 2008, "1198-1203" },
515 { "Friedrich2009",
516 "M. S. Friedrichs, P. Eastman, V. Vaidyanathan, M. Houston, S. LeGrand, A. L. Beberg, D. L. Ensign, C. M. Bruns, and V. S. Pande",
517 "Accelerating Molecular Dynamic Simulation on Graphics Processing Units",
518 "J. Comp. Chem.",
519 30, 2009, "864-872" },
520 { "Engin2010",
521 "O. Engin, A. Villa, M. Sayar and B. Hess",
522 "Driving Forces for Adsorption of Amphiphilic Peptides to Air-Water Interface",
523 "J. Phys. Chem. B",
524 114, 2010, "11093" },
525 { "Fritsch12",
526 "S. Fritsch, C. Junghans and K. Kremer",
527 "Adaptive molecular simulation study on structure formation of toluene around C60 using Gromacs",
528 "J. Chem. Theo. Comp.",
529 8, 2012, "398" },
530 { "Junghans10",
531 "C. Junghans and S. Poblete",
532 "A reference implementation of the adaptive resolution scheme in ESPResSo",
533 "Comp. Phys. Comm.",
534 181, 2010, "1449" },
535 { "Wang2010",
536 "H. Wang, F. Dommert, C.Holm",
537 "Optimizing working parameters of the smooth particle mesh Ewald algorithm in terms of accuracy and efficiency",
538 "J. Chem. Phys. B",
539 133, 2010, "034117" },
540 { "Sugita1999a",
541 "Y. Sugita, Y. Okamoto",
542 "Replica-exchange molecular dynamics method for protein folding",
543 "Chem. Phys. Lett.",
544 314, 1999, "141-151" },
545 { "Kutzner2011",
546 "C. Kutzner and J. Czub and H. Grubmuller",
547 "Keep it Flexible: Driving Macromolecular Rotary Motions in Atomistic Simulations with GROMACS",
548 "J. Chem. Theory Comput.",
549 7, 2011, "1381-1393" },
550 { "Hoefling2011",
551 "M. Hoefling, N. Lima, D. Haenni, C.A.M. Seidel, B. Schuler, H. Grubmuller",
552 "Structural Heterogeneity and Quantitative FRET Efficiency Distributions of Polyprolines through a Hybrid Atomistic Simulation and Monte Carlo Approach",
553 "PLoS ONE",
554 6, 2011, "e19791" },
555 { "Hockney1988",
556 "R. W. Hockney and J. W. Eastwood",
557 "Computer simulation using particles",
558 "IOP, Bristol",
559 1, 1988, "1" },
560 { "Ballenegger2012",
561 "V. Ballenegger, J.J. Cerda, and C. Holm",
562 "How to Convert SPME to P3M: Influence Functions and Error Estimates",
563 "J. Chem. Theory Comput.",
564 8, 2012, "936-947" },
565 { "Garmay2012",
566 "Garmay Yu, Shvetsov A, Karelov D, Lebedev D, Radulescu A, Petukhov M, Isaev-Ivanov V",
567 "Correlated motion of protein subdomains and large-scale conformational flexibility of RecA protein filament",
568 "Journal of Physics: Conference Series",
569 340, 2012, "012094" },
570 { "Kutzner2011b",
571 "C. Kutzner, H. Grubmuller, B. L. de Groot, and U. Zachariae",
572 "Computational Electrophysiology: The Molecular Dynamics of Ion Channel Permeation and Selectivity in Atomistic Detail",
573 "Biophys. J.",
574 101, 2011, "809-817"},
575 { "Lundborg2014",
576 "M. Lundborg, R. Apostolov, D. Spangberg, A. Gardenas, D. van der Spoel and E. Lindahl",
577 "An efficient and extensible format, library, and API for binary trajectory data from molecular simulations",
578 "J. Comput. Chem.",
579 35, 2014, "260-269"},
580 { "Goga2012",
581 "N. Goga and A. J. Rzepiela and A. H. de Vries and S. J. Marrink and H. J. C. Berendsen",
582 "Efficient Algorithms for Langevin and DPD Dynamics",
583 "J. Chem. Theory Comput.",
584 8, 2012, "3637--3649"},
585 { "Pronk2013",
586 "S. Pronk, S. Páll, R. Schulz, P. Larsson, P. Bjelkmar, R. Apostolov, M. R. Shirts, J. C. Smith, P. M. Kasson, D. van der Spoel, B. Hess, and E. Lindahl",
587 "GROMACS 4.5: a high-throughput and highly parallel open source molecular simulation toolkit",
588 "Bioinformatics",
589 29, 2013, "845-54"},
590 { "Pall2015",
591 "S. Páll, M. J. Abraham, C. Kutzner, B. Hess, E. Lindahl",
592 "Tackling Exascale Software Challenges in Molecular Dynamics Simulations with GROMACS",
593 "In S. Markidis & E. Laure (Eds.), Solving Software Challenges for Exascale",
594 8759, 2015, "3-27" },
595 { "Abraham2015",
596 "M. J. Abraham, T. Murtola, R. Schulz, S. Páll, J. C. Smith, B. Hess, E. Lindahl",
597 "GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers",
598 "SoftwareX",
599 1, 2015, "19-25" },
601 #define NSTR (int)asize(citedb)
603 int index;
604 char *author;
605 char *title;
606 #define LINE_WIDTH 79
608 if (fp == NULL)
610 return;
613 for (index = 0; (index < NSTR) && (strcmp(citedb[index].key, key) != 0); index++)
618 fprintf(fp, "\n++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++\n");
619 if (index < NSTR)
621 /* Insert newlines */
622 author = wrap_lines(citedb[index].author, LINE_WIDTH, 0, FALSE);
623 title = wrap_lines(citedb[index].title, LINE_WIDTH, 0, FALSE);
624 fprintf(fp, "%s\n%s\n%s %d (%d) pp. %s\n",
625 author, title, citedb[index].journal,
626 citedb[index].volume, citedb[index].year,
627 citedb[index].pages);
628 sfree(author);
629 sfree(title);
631 else
633 fprintf(fp, "Entry %s not found in citation database\n", key);
635 fprintf(fp, "-------- -------- --- Thank You --- -------- --------\n\n");
636 fflush(fp);
639 extern void gmx_print_version_info_cuda_gpu(FILE *fp);
641 static void gmx_print_version_info(FILE *fp)
643 fprintf(fp, "GROMACS version: %s\n", gmx_version());
644 const char *const git_hash = gmx_version_git_full_hash();
645 if (git_hash[0] != '\0')
647 fprintf(fp, "GIT SHA1 hash: %s\n", git_hash);
649 const char *const base_hash = gmx_version_git_central_base_hash();
650 if (base_hash[0] != '\0')
652 fprintf(fp, "Branched from: %s\n", base_hash);
655 #ifdef GMX_DOUBLE
656 fprintf(fp, "Precision: double\n");
657 #else
658 fprintf(fp, "Precision: single\n");
659 #endif
660 fprintf(fp, "Memory model: %u bit\n", (unsigned)(8*sizeof(void *)));
662 #ifdef GMX_THREAD_MPI
663 fprintf(fp, "MPI library: thread_mpi\n");
664 #elif defined(GMX_MPI)
665 fprintf(fp, "MPI library: MPI\n");
666 #else
667 fprintf(fp, "MPI library: none\n");
668 #endif
669 #ifdef GMX_OPENMP
670 fprintf(fp, "OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = %d)\n", GMX_OPENMP_MAX_THREADS);
671 #else
672 fprintf(fp, "OpenMP support: disabled\n");
673 #endif
674 #ifdef GMX_GPU
675 fprintf(fp, "GPU support: enabled\n");
676 #else
677 fprintf(fp, "GPU support: disabled\n");
678 #endif
679 #if defined(GMX_GPU) && defined(GMX_USE_OPENCL)
680 fprintf(fp, "OpenCL support: enabled\n");
681 #else
682 fprintf(fp, "OpenCL support: disabled\n");
683 #endif
684 /* A preprocessor trick to avoid duplicating logic from vec.h */
685 #define gmx_stringify2(x) #x
686 #define gmx_stringify(x) gmx_stringify2(x)
687 fprintf(fp, "invsqrt routine: %s\n", gmx_stringify(gmx_invsqrt_impl(x)));
688 fprintf(fp, "SIMD instructions: %s\n", GMX_SIMD_STRING);
689 fprintf(fp, "FFT library: %s\n", gmx_fft_get_version_info());
690 #ifdef HAVE_RDTSCP
691 fprintf(fp, "RDTSCP usage: enabled\n");
692 #else
693 fprintf(fp, "RDTSCP usage: disabled\n");
694 #endif
695 #ifdef GMX_USE_TNG
696 fprintf(fp, "TNG support: enabled\n");
697 #else
698 fprintf(fp, "TNG support: disabled\n");
699 #endif
700 #if HAVE_EXTRAE
701 unsigned major, minor, revision;
702 Extrae_get_version(&major, &minor, &revision);
703 fprintf(fp, "Tracing support: enabled. Using Extrae-%d.%d.%d\n", major, minor, revision);
704 #else
705 fprintf(fp, "Tracing support: disabled\n");
706 #endif
709 fprintf(fp, "Built on: %s\n", BUILD_TIME);
710 fprintf(fp, "Built by: %s\n", BUILD_USER);
711 fprintf(fp, "Build OS/arch: %s\n", BUILD_HOST);
712 fprintf(fp, "Build CPU vendor: %s\n", BUILD_CPU_VENDOR);
713 fprintf(fp, "Build CPU brand: %s\n", BUILD_CPU_BRAND);
714 fprintf(fp, "Build CPU family: %d Model: %d Stepping: %d\n",
715 BUILD_CPU_FAMILY, BUILD_CPU_MODEL, BUILD_CPU_STEPPING);
716 /* TODO: The below strings can be quite long, so it would be nice to wrap
717 * them. Can wait for later, as the master branch has ready code to do all
718 * that. */
719 fprintf(fp, "Build CPU features: %s\n", BUILD_CPU_FEATURES);
720 fprintf(fp, "C compiler: %s\n", BUILD_C_COMPILER);
721 fprintf(fp, "C compiler flags: %s\n", BUILD_CFLAGS);
722 fprintf(fp, "C++ compiler: %s\n", BUILD_CXX_COMPILER);
723 fprintf(fp, "C++ compiler flags: %s\n", BUILD_CXXFLAGS);
724 #ifdef HAVE_LIBMKL
725 /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
726 fprintf(fp, "Linked with Intel MKL version %d.%d.%d.\n",
727 __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__);
728 #endif
729 #if defined(GMX_GPU)
730 #ifdef GMX_USE_OPENCL
731 fprintf(fp, "OpenCL include dir: %s\n", OPENCL_INCLUDE_DIR);
732 fprintf(fp, "OpenCL library: %s\n", OPENCL_LIBRARY);
733 fprintf(fp, "OpenCL version: %s\n", OPENCL_VERSION_STRING);
734 #else
735 gmx_print_version_info_cuda_gpu(fp);
736 #endif
737 #endif
740 #ifdef GMX_DOUBLE
741 void gmx_is_double_precision()
743 /* allow precision detection */
745 #else
746 void gmx_is_single_precision()
748 /* allow precision detection */
750 #endif
752 namespace gmx
755 BinaryInformationSettings::BinaryInformationSettings()
756 : bExtendedInfo_(false), bCopyright_(false),
757 bGeneratedByHeader_(false), prefix_(""), suffix_("")
761 void printBinaryInformation(FILE *fp,
762 const IProgramContext &programContext)
764 printBinaryInformation(fp, programContext, BinaryInformationSettings());
767 void printBinaryInformation(FILE *fp,
768 const IProgramContext &programContext,
769 const BinaryInformationSettings &settings)
771 const char *prefix = settings.prefix_;
772 const char *suffix = settings.suffix_;
773 const char *precisionString = "";
774 #ifdef GMX_DOUBLE
775 precisionString = " (double precision)";
776 #endif
777 const char *const name = programContext.displayName();
778 if (settings.bGeneratedByHeader_)
780 fprintf(fp, "%sCreated by:%s\n", prefix, suffix);
782 // TODO: It would be nice to know here whether we are really running a
783 // Gromacs binary or some other binary that is calling Gromacs; we
784 // could then print "%s is part of GROMACS" or some alternative text.
785 std::string title
786 = formatString(":-) GROMACS - %s, %s%s (-:", name, gmx_version(), precisionString);
787 const int indent
788 = centeringOffset(78 - std::strlen(prefix) - std::strlen(suffix), title.length()) + 1;
789 fprintf(fp, "%s%*c%s%s\n", prefix, indent, ' ', title.c_str(), suffix);
790 fprintf(fp, "%s%s\n", prefix, suffix);
791 if (settings.bCopyright_)
793 GMX_RELEASE_ASSERT(prefix[0] == '\0' && suffix[0] == '\0',
794 "Prefix/suffix not supported with copyright");
795 printCopyright(fp);
796 fprintf(fp, "\n");
797 // This line is printed again after the copyright notice to make it
798 // appear together with all the other information, so that it is not
799 // necessary to read stuff above the copyright notice.
800 // The line above the copyright notice puts the copyright notice is
801 // context, though.
802 fprintf(fp, "%sGROMACS: %s, %s%s%s\n", prefix, name,
803 gmx_version(), precisionString, suffix);
805 const char *const binaryPath = programContext.fullBinaryPath();
806 if (!gmx::isNullOrEmpty(binaryPath))
808 fprintf(fp, "%sExecutable: %s%s\n", prefix, binaryPath, suffix);
810 const gmx::InstallationPrefixInfo installPrefix = programContext.installationPrefix();
811 if (!gmx::isNullOrEmpty(installPrefix.path))
813 fprintf(fp, "%sData prefix: %s%s%s\n", prefix, installPrefix.path,
814 installPrefix.bSourceLayout ? " (source tree)" : "", suffix);
816 const char *const commandLine = programContext.commandLine();
817 if (!gmx::isNullOrEmpty(commandLine))
819 fprintf(fp, "%sCommand line:%s\n%s %s%s\n",
820 prefix, suffix, prefix, commandLine, suffix);
822 if (settings.bExtendedInfo_)
824 GMX_RELEASE_ASSERT(prefix[0] == '\0' && suffix[0] == '\0',
825 "Prefix/suffix not supported with extended info");
826 fprintf(fp, "\n");
827 gmx_print_version_info(fp);
831 } // namespace gmx