Merge release-5-0 into master
authorRoland Schulz <roland@utk.edu>
Wed, 16 Apr 2014 15:07:10 +0000 (11:07 -0400)
committerRoland Schulz <roland@utk.edu>
Wed, 16 Apr 2014 19:43:29 +0000 (15:43 -0400)
Conflicts:
CMakeLists.txt

Change-Id: Id9bdc4de634a67c4060bec0e5edf4c358cc6a228

408 files changed:
CMakeLists.txt
doxygen/Doxyfile-common.cmakein
doxygen/doxygen-check.py
doxygen/doxygenxml.py
doxygen/gmxtree.py
doxygen/graphbuilder.py
manual/README
share/top/gurgle.dat
share/top/residuetypes.dat
src/contrib/anaf.c
src/contrib/calcfdev.c
src/contrib/compnl.c
src/contrib/do_multiprot.c
src/contrib/do_shift.c
src/contrib/ehanal.c
src/contrib/ehdata.c
src/contrib/ehole.c
src/contrib/g_anavel.c
src/contrib/gmx_sdf.c
src/contrib/mkice.c
src/contrib/pmetest.c
src/contrib/test.c
src/contrib/test_fatal.c
src/contrib/testfft.c
src/contrib/testlr.c
src/contrib/timefft.c
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/tests/cmdlineprogramcontext.cpp
src/gromacs/essentialdynamics/edsam.c
src/gromacs/essentialdynamics/edsam.h
src/gromacs/fft/fft.c
src/gromacs/fft/fft5d.cpp
src/gromacs/fft/fft_fftpack.c
src/gromacs/fft/fft_fftw3.cpp
src/gromacs/fft/fft_mkl.c
src/gromacs/fft/parallel_3dfft.c
src/gromacs/fileio/CMakeLists.txt
src/gromacs/fileio/confio.c
src/gromacs/fileio/enxio.c
src/gromacs/fileio/filenm.c
src/gromacs/fileio/futil.h [deleted file]
src/gromacs/fileio/gmxfio.c
src/gromacs/fileio/gmxfio.h
src/gromacs/fileio/gmxfio_asc.c
src/gromacs/fileio/gmxfio_bin.c
src/gromacs/fileio/gmxfio_rw.c
src/gromacs/fileio/gmxfio_xdr.c
src/gromacs/fileio/libxdrf.c
src/gromacs/fileio/matio.cpp
src/gromacs/fileio/mdoutf.c
src/gromacs/fileio/pdbio.c
src/gromacs/fileio/pdbio.h
src/gromacs/fileio/strdb.c
src/gromacs/fileio/tests/tngio.cpp
src/gromacs/fileio/timecontrol.c
src/gromacs/fileio/tngio.cpp
src/gromacs/fileio/tngio_for_tools.cpp
src/gromacs/fileio/tpxio.c
src/gromacs/fileio/trajectory_writing.c
src/gromacs/fileio/trnio.c
src/gromacs/fileio/trxio.c
src/gromacs/fileio/vmdio.c
src/gromacs/fileio/writeps.c
src/gromacs/fileio/xdrd.c
src/gromacs/fileio/xtcio.c
src/gromacs/fileio/xvgr.cpp [moved from src/gromacs/gmxlib/xvgr.cpp with 99% similarity]
src/gromacs/fileio/xvgr.h [moved from src/gromacs/legacyheaders/xvgr.h with 96% similarity]
src/gromacs/gmxana/anadih.c
src/gromacs/gmxana/autocorr.c
src/gromacs/gmxana/binsearch.c
src/gromacs/gmxana/cmat.c
src/gromacs/gmxana/dlist.c
src/gromacs/gmxana/edittop.c
src/gromacs/gmxana/eigio.c
src/gromacs/gmxana/expfit.c
src/gromacs/gmxana/fitahx.c
src/gromacs/gmxana/geminate.c
src/gromacs/gmxana/gmx_anadock.c
src/gromacs/gmxana/gmx_anaeig.c
src/gromacs/gmxana/gmx_analyze.c
src/gromacs/gmxana/gmx_angle.c
src/gromacs/gmxana/gmx_bar.c
src/gromacs/gmxana/gmx_bundle.c
src/gromacs/gmxana/gmx_chi.c
src/gromacs/gmxana/gmx_cluster.c
src/gromacs/gmxana/gmx_clustsize.c
src/gromacs/gmxana/gmx_confrms.c
src/gromacs/gmxana/gmx_covar.c
src/gromacs/gmxana/gmx_current.c
src/gromacs/gmxana/gmx_density.c
src/gromacs/gmxana/gmx_densmap.c
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dielectric.c
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.c
src/gromacs/gmxana/gmx_do_dssp.c
src/gromacs/gmxana/gmx_dos.c
src/gromacs/gmxana/gmx_dyecoupl.c
src/gromacs/gmxana/gmx_dyndom.c
src/gromacs/gmxana/gmx_editconf.c
src/gromacs/gmxana/gmx_eneconv.c
src/gromacs/gmxana/gmx_enemat.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_filter.c
src/gromacs/gmxana/gmx_genion.c
src/gromacs/gmxana/gmx_genpr.c
src/gromacs/gmxana/gmx_gyrate.c
src/gromacs/gmxana/gmx_h2order.c
src/gromacs/gmxana/gmx_hbond.c
src/gromacs/gmxana/gmx_helix.c
src/gromacs/gmxana/gmx_helixorient.c
src/gromacs/gmxana/gmx_hydorder.c
src/gromacs/gmxana/gmx_lie.c
src/gromacs/gmxana/gmx_make_edi.c
src/gromacs/gmxana/gmx_make_ndx.c
src/gromacs/gmxana/gmx_mdmat.c
src/gromacs/gmxana/gmx_mindist.c
src/gromacs/gmxana/gmx_mk_angndx.c
src/gromacs/gmxana/gmx_morph.c
src/gromacs/gmxana/gmx_msd.c
src/gromacs/gmxana/gmx_nmeig.c
src/gromacs/gmxana/gmx_nmens.c
src/gromacs/gmxana/gmx_nmtraj.c
src/gromacs/gmxana/gmx_order.c
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxana/gmx_polystat.c
src/gromacs/gmxana/gmx_potential.c
src/gromacs/gmxana/gmx_principal.c
src/gromacs/gmxana/gmx_rama.c
src/gromacs/gmxana/gmx_rdf.c
src/gromacs/gmxana/gmx_rms.c
src/gromacs/gmxana/gmx_rmsdist.c
src/gromacs/gmxana/gmx_rmsf.c
src/gromacs/gmxana/gmx_rotacf.c
src/gromacs/gmxana/gmx_rotmat.c
src/gromacs/gmxana/gmx_saltbr.c
src/gromacs/gmxana/gmx_sans.c
src/gromacs/gmxana/gmx_saxs.c
src/gromacs/gmxana/gmx_sham.c
src/gromacs/gmxana/gmx_sigeps.c
src/gromacs/gmxana/gmx_sorient.c
src/gromacs/gmxana/gmx_spatial.c
src/gromacs/gmxana/gmx_spol.c
src/gromacs/gmxana/gmx_tcaf.c
src/gromacs/gmxana/gmx_traj.c
src/gromacs/gmxana/gmx_trjcat.c
src/gromacs/gmxana/gmx_trjconv.c
src/gromacs/gmxana/gmx_trjorder.c
src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/gmxana/gmx_vanhove.c
src/gromacs/gmxana/gmx_velacc.c
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/gmx_wheel.c
src/gromacs/gmxana/gmx_xpm2ps.c
src/gromacs/gmxana/hxprops.c
src/gromacs/gmxana/nrama.c
src/gromacs/gmxana/nsfactor.c
src/gromacs/gmxana/polynomials.c
src/gromacs/gmxana/powerspect.c
src/gromacs/gmxana/pp2shift.c
src/gromacs/gmxlib/atomprop.c
src/gromacs/gmxlib/bondfree.c
src/gromacs/gmxlib/calcgrid.c
src/gromacs/gmxlib/calch.c
src/gromacs/gmxlib/chargegroup.c
src/gromacs/gmxlib/checkpoint.c
src/gromacs/gmxlib/cinvsqrtdata.c
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/gmxlib/cuda_tools/cudautils.cuh
src/gromacs/gmxlib/cuda_tools/pmalloc_cuda.cu
src/gromacs/gmxlib/disre.c
src/gromacs/gmxlib/ewald_util.c
src/gromacs/gmxlib/gmx_detect_hardware.c
src/gromacs/gmxlib/gmx_omp_nthreads.c
src/gromacs/gmxlib/gmx_thread_affinity.c
src/gromacs/gmxlib/gpu_utils/gpu_utils.cu
src/gromacs/gmxlib/index.c
src/gromacs/gmxlib/inputrec.c
src/gromacs/gmxlib/invblock.c
src/gromacs/gmxlib/main.cpp
src/gromacs/gmxlib/mshift.c
src/gromacs/gmxlib/mtop_util.c
src/gromacs/gmxlib/mvdata.c
src/gromacs/gmxlib/network.c
src/gromacs/gmxlib/nonbonded/nb_free_energy.c
src/gromacs/gmxlib/nonbonded/nb_generic.c
src/gromacs/gmxlib/nonbonded/nb_generic_adress.c
src/gromacs/gmxlib/nonbonded/nb_generic_cg.c
src/gromacs/gmxlib/nonbonded/nb_kernel.c
src/gromacs/gmxlib/nonbonded/nonbonded.c
src/gromacs/gmxlib/nrnb.c
src/gromacs/gmxlib/orires.c
src/gromacs/gmxlib/pbc.c
src/gromacs/gmxlib/rbin.c
src/gromacs/gmxlib/readinp.c
src/gromacs/gmxlib/restcbt.c
src/gromacs/gmxlib/rmpbc.c
src/gromacs/gmxlib/sfactor.c
src/gromacs/gmxlib/sighandler.c
src/gromacs/gmxlib/splitter.c
src/gromacs/gmxlib/symtab.c
src/gromacs/gmxlib/topsort.c
src/gromacs/gmxlib/txtdump.c
src/gromacs/gmxlib/typedefs.c
src/gromacs/gmxlib/viewit.c
src/gromacs/gmxlib/warninp.c
src/gromacs/gmxpreprocess/add_par.c
src/gromacs/gmxpreprocess/calc_verletbuf.c
src/gromacs/gmxpreprocess/convparm.c
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/gen_ad.c
src/gromacs/gmxpreprocess/gen_maxwell_velocities.c
src/gromacs/gmxpreprocess/gen_vsite.c
src/gromacs/gmxpreprocess/genconf.c
src/gromacs/gmxpreprocess/genhydro.c
src/gromacs/gmxpreprocess/gmxcpp.c
src/gromacs/gmxpreprocess/gpp_atomtype.c
src/gromacs/gmxpreprocess/gpp_bond_atomtype.c
src/gromacs/gmxpreprocess/gpp_nextnb.c
src/gromacs/gmxpreprocess/grompp.c
src/gromacs/gmxpreprocess/h_db.c
src/gromacs/gmxpreprocess/h_db.h
src/gromacs/gmxpreprocess/hackblock.c
src/gromacs/gmxpreprocess/hizzie.c
src/gromacs/gmxpreprocess/insert-molecules.cpp
src/gromacs/gmxpreprocess/nm2type.c
src/gromacs/gmxpreprocess/pdb2gmx.c
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/pgutil.c
src/gromacs/gmxpreprocess/protonate.c
src/gromacs/gmxpreprocess/read-conformation.cpp
src/gromacs/gmxpreprocess/readadress.c
src/gromacs/gmxpreprocess/readir.c
src/gromacs/gmxpreprocess/readpull.c
src/gromacs/gmxpreprocess/readrot.c
src/gromacs/gmxpreprocess/resall.c
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/sortwater.c
src/gromacs/gmxpreprocess/ter_db.c
src/gromacs/gmxpreprocess/ter_db.h
src/gromacs/gmxpreprocess/tests/insert-molecules.cpp
src/gromacs/gmxpreprocess/tests/solvate.cpp
src/gromacs/gmxpreprocess/tomorse.c
src/gromacs/gmxpreprocess/topdirs.c
src/gromacs/gmxpreprocess/topio.c
src/gromacs/gmxpreprocess/toppush.c
src/gromacs/gmxpreprocess/topshake.c
src/gromacs/gmxpreprocess/toputil.c
src/gromacs/gmxpreprocess/vsite_parm.c
src/gromacs/gmxpreprocess/x2top.c
src/gromacs/gmxpreprocess/xlate.c
src/gromacs/imd/imd.c
src/gromacs/imd/imdsocket.c
src/gromacs/legacyheaders/chargegroup.h
src/gromacs/legacyheaders/disre.h
src/gromacs/legacyheaders/ebin.h
src/gromacs/legacyheaders/gmx_fatal_collective.h [deleted file]
src/gromacs/legacyheaders/gmx_hash.h
src/gromacs/legacyheaders/gmx_omp_nthreads.h
src/gromacs/legacyheaders/gmx_thread_affinity.h
src/gromacs/legacyheaders/macros.h
src/gromacs/legacyheaders/main.h
src/gromacs/legacyheaders/mdebin.h
src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h
src/gromacs/legacyheaders/network.h
src/gromacs/legacyheaders/ns.h
src/gromacs/legacyheaders/orires.h
src/gromacs/legacyheaders/pbc.h
src/gromacs/legacyheaders/pmalloc_cuda.h
src/gromacs/legacyheaders/rbin.h
src/gromacs/legacyheaders/sysstuff.h [deleted file]
src/gromacs/legacyheaders/typedefs.h
src/gromacs/legacyheaders/types/inputrec.h
src/gromacs/legacyheaders/types/nb_verlet.h
src/gromacs/legacyheaders/types/simple.h
src/gromacs/legacyheaders/vcm.h
src/gromacs/legacyheaders/vec.h
src/gromacs/legacyheaders/viewit.h
src/gromacs/linearalgebra/eigensolver.c
src/gromacs/linearalgebra/matrix.c
src/gromacs/linearalgebra/mtxio.c
src/gromacs/linearalgebra/nrjac.c
src/gromacs/math/3dview.c
src/gromacs/math/do_fit.c
src/gromacs/math/utilities.h
src/gromacs/mdlib/adress.c
src/gromacs/mdlib/calcmu.c
src/gromacs/mdlib/calcvir.c
src/gromacs/mdlib/clincs.c
src/gromacs/mdlib/constr.c
src/gromacs/mdlib/coupling.c
src/gromacs/mdlib/csettle.c
src/gromacs/mdlib/domdec.c
src/gromacs/mdlib/domdec_box.c
src/gromacs/mdlib/domdec_con.c
src/gromacs/mdlib/domdec_top.c
src/gromacs/mdlib/ebin.c
src/gromacs/mdlib/ewald.c
src/gromacs/mdlib/expanded.c
src/gromacs/mdlib/force.c
src/gromacs/mdlib/forcerec.c
src/gromacs/mdlib/genborn.c
src/gromacs/mdlib/genborn_sse2_double.c
src/gromacs/mdlib/genborn_sse2_single.c
src/gromacs/mdlib/init.c
src/gromacs/mdlib/iteratedconstraints.c
src/gromacs/mdlib/mdatom.c
src/gromacs/mdlib/mdebin.c
src/gromacs/mdlib/mdebin_bar.c
src/gromacs/mdlib/minimize.c
src/gromacs/mdlib/nbnxn_atomdata.c
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.c.pre
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.c
src/gromacs/mdlib/nbnxn_search.c
src/gromacs/mdlib/nlistheuristics.c
src/gromacs/mdlib/ns.c
src/gromacs/mdlib/nsgrid.c
src/gromacs/mdlib/pme.c
src/gromacs/mdlib/pme_pp.c
src/gromacs/mdlib/qm_gamess.c
src/gromacs/mdlib/qm_gaussian.c
src/gromacs/mdlib/qm_mopac.c
src/gromacs/mdlib/qm_orca.c
src/gromacs/mdlib/qmmm.c
src/gromacs/mdlib/rf_util.c
src/gromacs/mdlib/shakef.c
src/gromacs/mdlib/shellfc.c
src/gromacs/mdlib/sim_util.c
src/gromacs/mdlib/stat.c
src/gromacs/mdlib/tables.c
src/gromacs/mdlib/tgroup.c
src/gromacs/mdlib/tpi.c
src/gromacs/mdlib/update.c
src/gromacs/mdlib/vsite.c
src/gromacs/mdlib/wall.c
src/gromacs/mdlib/wnblist.c
src/gromacs/options/basicoptions.h
src/gromacs/pulling/pull.c
src/gromacs/pulling/pull_rotation.c
src/gromacs/pulling/pullutil.c
src/gromacs/random/random.h
src/gromacs/selection/centerofmass.cpp
src/gromacs/selection/indexutil.cpp
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/selectioncollection.cpp
src/gromacs/simd/impl_reference/impl_reference.h
src/gromacs/simd/simd.h
src/gromacs/simd/tests/base.h
src/gromacs/simd/tests/bootstrap_loadstore.cpp
src/gromacs/swap/swapcoords.c
src/gromacs/timing/wallcycle.c
src/gromacs/timing/walltime_accounting.c
src/gromacs/timing/walltime_accounting.h
src/gromacs/tools/check.c
src/gromacs/tools/compare.c
src/gromacs/tools/convert_tpr.c
src/gromacs/tools/dump.c
src/gromacs/trajectoryanalysis/modules/sasa.cpp
src/gromacs/utility.h
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/basedefinitions.h [new file with mode: 0644]
src/gromacs/utility/basenetwork.cpp [new file with mode: 0644]
src/gromacs/utility/basenetwork.h [moved from src/gromacs/legacyheaders/shift.h with 50% similarity]
src/gromacs/utility/cstringutil.c
src/gromacs/utility/cstringutil.h
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/fatalerror.cpp [moved from src/gromacs/gmxlib/gmx_fatal.c with 62% similarity]
src/gromacs/utility/fatalerror.h [moved from src/gromacs/legacyheaders/gmx_fatal.h with 85% similarity]
src/gromacs/utility/futil.cpp [moved from src/gromacs/fileio/futil.cpp with 95% similarity]
src/gromacs/utility/futil.h [new file with mode: 0644]
src/gromacs/utility/gmxomp.cpp
src/gromacs/utility/gmxomp.h
src/gromacs/utility/path.cpp [moved from src/gromacs/fileio/path.cpp with 99% similarity]
src/gromacs/utility/path.h [moved from src/gromacs/fileio/path.h with 97% similarity]
src/gromacs/utility/smalloc.c
src/programs/mdrun/md.c
src/programs/mdrun/mdrun.cpp
src/programs/mdrun/membed.c
src/programs/mdrun/membed.h
src/programs/mdrun/pme_loadbal.c
src/programs/mdrun/repl_ex.c
src/programs/mdrun/runner.c
src/programs/mdrun/tests/moduletest.cpp
src/programs/mdrun/tests/replicaexchange.cpp
src/programs/view/buttons.cpp
src/programs/view/dialogs.cpp
src/programs/view/fgrid.cpp
src/programs/view/filter.cpp
src/programs/view/logo.cpp
src/programs/view/manager.cpp
src/programs/view/molps.cpp
src/programs/view/nmol.cpp
src/programs/view/view.cpp
src/programs/view/x11.cpp
src/programs/view/xdlg.cpp
src/programs/view/xdlghi.cpp
src/programs/view/xdlgitem.cpp
src/programs/view/xmb.cpp
src/testutils/refdata.cpp
src/testutils/testfilemanager.cpp
tests/CppCheck.cmake

index 03f24b6f0ca6e056031a86d5cb99dc4e9dff8f43..d5ba67ab89627283aec0bb67db1706348d0276e1 100644 (file)
@@ -54,7 +54,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 # NOTE: when releasing the "-dev" suffix needs to be stripped off!
 # REGRESSIONTEST_VERSION and REGRESSIONTEST_BRANCH should always be
 # defined.
-set(PROJECT_VERSION "5.0-rc1-dev")
+set(PROJECT_VERSION "5.1-dev")
 # If this is a released tarball, "-dev" will not be present in
 # PROJECT_VERSION, and REGRESSIONTEST_VERSION specifies the version
 # number of the regressiontest tarball against which the code tarball
@@ -64,7 +64,7 @@ set(REGRESSIONTEST_VERSION "5.0-rc1")
 # PROJECT_VERSION, and REGRESSIONTEST_BRANCH specifies the name of the
 # gerrit.gromacs.org branch whose HEAD can test this code, *if* this
 # code contains all recent fixes from the corresponding code branch.
-set(REGRESSIONTEST_BRANCH "refs/heads/release-5-0")
+set(REGRESSIONTEST_BRANCH "refs/heads/master")
 
 set(CUSTOM_VERSION_STRING ""
     CACHE STRING "Custom version string (if empty, use hard-coded default)")
@@ -76,7 +76,7 @@ set(LIBRARY_SOVERSION 0)
 set(LIBRARY_VERSION ${LIBRARY_SOVERSION}.0.0)
 # It is a bit irritating, but this has to be set separately for now!
 SET(CPACK_PACKAGE_VERSION_MAJOR "5")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
 #SET(CPACK_PACKAGE_VERSION_PATCH "0")
 
 # The numerical gromacs version. It is 40600 for 4.6.0.
index 344173026f4fdf01f0bec29d7ffc6eeeacd7179f..b82710da300ae2b1e81d1cbcd3c27154a44f1228 100644 (file)
@@ -17,6 +17,7 @@ EXCLUDE                = @CMAKE_SOURCE_DIR@/doxygen/examples \
                          @CMAKE_SOURCE_DIR@/src/gromacs/selection/parser.h \
                          @CMAKE_SOURCE_DIR@/src/gromacs/selection/scanner.cpp @NB_KERNEL_DIRS_TO_IGNORE_IN_DOXYGEN@
 EXCLUDE_SYMBOLS        = YY* yy* _gmx_sel_yy*
+EXCLUDE_SYMBOLS       += __STDC*
 EXCLUDE_SYMBOLS       += TEST TEST_F TEST_P TYPED_TEST_CASE TYPED_TEST INSTANTIATE_TEST_CASE_P
 EXCLUDE_SYMBOLS       += MOCK_METHOD* MOCK_CONST_METHOD*
 FULL_PATH_NAMES        = YES
index f292b85abedb06194a0934b8aee968dd7d9b491b..e2c30a59be5b3f12566c80a499c5db2d3f872f0d 100755 (executable)
@@ -68,7 +68,7 @@ def check_file(fileobj, reporter):
         # TODO: Add rule to exclude examples from this check
         if fileobj.is_installed():
             reporter.file_error(fileobj, "source file is installed")
-        if fileobj.get_documentation_type() != DocType.internal:
+        if fileobj.get_doc_type() != DocType.internal:
             reporter.file_error(fileobj,
                     "source file documentation appears outside full documentation")
         elif fileobj.get_api_type() != DocType.internal:
@@ -76,19 +76,19 @@ def check_file(fileobj, reporter):
     elif fileobj.is_test_file() and fileobj.is_installed():
         reporter.file_error(fileobj, "test file is installed")
     elif fileobj.is_installed():
-        if fileobj.get_documentation_type() != DocType.public:
+        if fileobj.get_doc_type() != DocType.public:
             reporter.file_error(fileobj,
                     "public header has non-public documentation")
-    elif fileobj.get_documentation_type() == DocType.public:
+    elif fileobj.get_doc_type() == DocType.public:
         reporter.file_error(fileobj,
                 "non-installed header has public documentation")
     elif fileobj.get_api_type() == DocType.public:
         reporter.file_error(fileobj,
                 "non-installed header specified as part of public API")
-    elif fileobj.get_documentation_type() < fileobj.get_api_type():
+    elif fileobj.get_doc_type() < fileobj.get_api_type():
         reporter.file_error(fileobj,
                 "API type ({0}) conflicts with documentation visibility ({1})"
-                .format(fileobj.get_api_type(), fileobj.get_documentation_type()))
+                .format(fileobj.get_api_type(), fileobj.get_doc_type()))
 
     if not fileobj.has_brief_description():
         reporter.file_error(fileobj,
@@ -132,14 +132,13 @@ def check_include(fileobj, includedfile, reporter):
         filemodule = fileobj.get_module()
         othermodule = otherfile.get_module()
         if fileobj.is_documented() and otherfile.is_documented():
-            filetype = fileobj.get_documentation_type()
-            othertype = otherfile.get_documentation_type()
+            filetype = fileobj.get_doc_type()
+            othertype = otherfile.get_doc_type()
             if filetype > othertype:
                 reporter.code_issue(includedfile,
                         "{0} file includes {1} file {2}"
                         .format(filetype, othertype, includedfile))
-        check_api = (othermodule and othermodule.is_documented() and
-                filemodule != othermodule)
+        check_api = (otherfile.api_type_is_reliable() and filemodule != othermodule)
         if check_api and otherfile.get_api_type() < DocType.library:
             reporter.code_issue(includedfile,
                     "included file {0} is not documented as exposed outside its module"
@@ -156,8 +155,8 @@ def check_class(classobj, reporter):
     """Check documentation for a class/struct/union."""
     check_entity(classobj, reporter)
     if classobj.is_documented():
-        classtype = classobj.get_documentation_type()
-        filetype = classobj.get_file_documentation_type()
+        classtype = classobj.get_doc_type()
+        filetype = classobj.get_file_doc_type()
         if classtype == DocType.public and not classobj.is_in_installed_file():
             reporter.doc_error(classobj,
                     "has public documentation, but is not in installed header")
@@ -166,12 +165,11 @@ def check_class(classobj, reporter):
                     "is in {0} file(s), but appears in {1} documentation"
                     .format(filetype, classtype))
 
-def check_member(member, reporter):
+def check_member(member, reporter, check_ignored):
     """Check documentation for a generic member."""
     check_entity(member, reporter)
     if member.is_documented():
-        if not member.is_visible():
-            # TODO: This is triggered by members in anonymous namespaces.
+        if check_ignored and not member.is_visible():
             reporter.doc_note(member,
                     "is documented, but is ignored by Doxygen, because its scope is not documented")
         if member.has_inbody_description():
@@ -191,7 +189,7 @@ def main():
     parser.add_option('--ignore',
                       help='Set file with patterns for messages to ignore')
     parser.add_option('--check-ignored', action='store_true',
-                      help='Check documentation ignored by Doxygen')
+                      help='Issue notes for comments ignored by Doxygen')
     parser.add_option('-q', '--quiet', action='store_true',
                       help='Do not write status messages')
     options, args = parser.parse_args()
@@ -231,8 +229,7 @@ def main():
         check_class(classobj, reporter)
 
     for memberobj in tree.get_members():
-        if memberobj.is_visible() or options.check_ignored:
-            check_member(memberobj, reporter)
+        check_member(memberobj, reporter, options.check_ignored)
 
     reporter.write_pending()
     reporter.report_unused_filters()
index f26ad9cdbdf6102913fd8bed6760aefc60a9f120..49de76261c8bf72c27930099ecbd9499dbfd97b3 100755 (executable)
@@ -370,6 +370,10 @@ class Member(Entity):
     def __init__(self, name, refid):
         Entity.__init__(self, name, refid)
         self._parents = set()
+        self._class = None
+        self._namespace = None
+        self._files = set()
+        self._group = None
         self._location = None
         self._alternates = set()
         self._loaded = False
@@ -379,38 +383,31 @@ class Member(Entity):
     def add_parent_compound(self, compound):
         """Add a compound that contains this member."""
         self._parents.add(compound)
+        if isinstance(compound, Class):
+            assert self._class is None
+            self._class = compound
+        elif isinstance(compound, Namespace):
+            assert self._namespace is None
+            self._namespace = compound
+        elif isinstance(compound, File):
+            self._files.add(compound)
+        elif isinstance(compound, Group):
+            assert self._group is None
+            self._group = compound
+        else:
+            assert False
 
-    def _get_raw_location(self):
-        """Returns the BodyLocation object associated with this member.
+    def merge_definition(self, definition):
+        """Merge another member into this.
 
-        This is necessary so that EnumValue can override it report a non-empty
-        location: Doxygen doesn't provide any location for <enumvalue>.
+        See DocumentationSet.merge_duplicates().
         """
-        return self._location
-
-    def get_parent_compounds(self):
-        return self._parents
-
-    def get_inherited_visibility(self):
-        return max([parent.get_visibility() for parent in self._parents])
-
-    def is_visible(self):
-        return self.get_inherited_visibility() != DocType.none
-
-    def has_same_body_location(self):
-        return self._get_raw_location().has_same_body_location()
-
-    def get_reporter_location(self):
-        return self._get_raw_location().get_reporter_location()
-
-    def get_location(self):
-        return self._get_raw_location().get_location()
-
-    def get_body_location(self):
-        return self._get_raw_location().get_body_location()
-
-    def merge_definition(self, definition):
+        assert self._class is None
+        assert definition._class is None
+        assert self._group == definition._group
+        assert self._namespace == definition._namespace
         self._parents.update(definition._parents)
+        self._files.update(definition._files)
         self._alternates.add(definition)
 
     def load_details_from_element(self, rootelem, xmlpath):
@@ -465,8 +462,50 @@ class Member(Entity):
         """
         return False
 
+    def _get_raw_location(self):
+        """Returns the BodyLocation object associated with this member.
+
+        This is necessary so that EnumValue can override it report a non-empty
+        location: Doxygen doesn't provide any location for <enumvalue>.
+        """
+        return self._location
+
+    def get_reporter_location(self):
+        return self._get_raw_location().get_reporter_location()
+
+    def get_location(self):
+        """Return main location for the member.
+
+        This typically corresponds to the declaration.
+        """
+        return self._get_raw_location().get_location()
+
+    def get_body_location(self):
+        """Return location of the body for the member.
+
+        Some types of members do not have a body location, in which case this
+        returns None.
+        """
+        return self._get_raw_location().get_body_location()
+
+    def has_same_body_location(self):
+        """Check whether the main location is the same as body location."""
+        return self._get_raw_location().has_same_body_location()
+
+    def get_namespace(self):
+        return self._namespace
+
+    def get_parent_compounds(self):
+        return self._parents
+
+    def get_inherited_visibility(self):
+        return max([parent.get_visibility() for parent in self._parents])
+
     def show(self):
         self.show_base()
+        if self._alternates:
+            idlist = [x.get_id() for x in self._alternates]
+            print 'Alt. IDs:   {0}'.format(', '.join(idlist))
         print 'Parent vis: {0}'.format(self.get_inherited_visibility())
         print 'Location:   {0}'.format(self.get_location().get_full_string())
         print 'Body loc:   {0}'.format(self.get_body_location().get_full_string())
@@ -539,6 +578,7 @@ class Compound(Entity):
     contains references to contained compounds, and details of all members
     within the compound.
     """
+
     def __init__(self, name, refid):
         Entity.__init__(self, name, refid)
         self._members = dict()
@@ -891,6 +931,9 @@ class Namespace(Compound):
     def get_reporter_location(self):
         return self._doclocation.get_reporter_location()
 
+    def is_anonymous(self):
+        return 'anonymous_namespace{' in self.get_name()
+
     def show(self):
         self.show_base()
         print 'Doc. loc.: {0}'.format(self._doclocation.get_full_string())
@@ -1093,9 +1136,9 @@ class DocumentationSet(object):
     def merge_duplicates(self):
         """Merge duplicate member definitions based on body location.
 
-        At least for functions that are declared in a header, but have their
-        body in a source file, Doxygen seems to create two different IDs, but
-        the contents of the members are the same, except for the location
+        At least for some functions that are declared in a header, but have
+        their body in a source file, Doxygen seems to create two different IDs,
+        but the contents of the members are the same, except for the location
         attribute.  This method merges members that have identical name and
         body location into a single member that keeps the information from both
         instances (they should only differ in the location attribute and in
@@ -1190,8 +1233,11 @@ class DocumentationSet(object):
     def get_groups(self, name):
         return self.get_compounds(Group, lambda x: x.get_name() in name)
 
-    def get_namespaces(self, name):
-        return self.get_compounds(Namespace, lambda x: x.get_name() in name)
+    def get_namespaces(self, name=None):
+        if name:
+            return self.get_compounds(Namespace, lambda x: x.get_name() in name)
+        else:
+            return self.get_compounds(Namespace)
 
     def get_classes(self, name=None):
         if name:
index 6a8d602a244c3c1c17e5eb721978fed15f0ab5f8..e196da3d65a62b90598ac54a2bd5a2c5833dddb8 100644 (file)
@@ -196,7 +196,7 @@ class File(object):
     def get_name(self):
         return os.path.basename(self._abspath)
 
-    def get_documentation_type(self):
+    def get_doc_type(self):
         if not self._rawdoc:
             return DocType.none
         return self._rawdoc.get_visibility()
@@ -204,6 +204,22 @@ class File(object):
     def get_api_type(self):
         return self._apitype
 
+    def api_type_is_reliable(self):
+        if self._apitype > DocType.internal:
+            return True
+        module = self.get_module()
+        return module and module.is_documented()
+
+    def is_public(self):
+        if self.api_type_is_reliable():
+            return self.get_api_type() == DocType.public
+        return self.get_api_type() == DocType.public or self.is_installed()
+
+    def is_module_internal(self):
+        if self.is_source_file():
+            return True
+        return not self.is_installed() and self.get_api_type() <= DocType.internal
+
     def get_expected_module(self):
         return self._dir.get_module()
 
@@ -352,6 +368,15 @@ class Module(object):
     def get_group(self):
         return self._group
 
+class Namespace(object):
+
+    """Namespace in the GROMACS source code."""
+
+    def __init__(self, rawdoc):
+        self._rawdoc = rawdoc
+
+    def is_anonymous(self):
+        return self._rawdoc.is_anonymous()
 
 class Class(object):
 
@@ -376,19 +401,66 @@ class Class(object):
     def has_brief_description(self):
         return self._rawdoc.has_brief_description()
 
-    def get_documentation_type(self):
+    def get_doc_type(self):
+        """Return documentation type (visibility) for the class.
+
+        In addition to the actual code, this encodes GROMACS-specific logic
+        of setting EXTRACT_LOCAL_CLASSES=YES only for the full documentation.
+        Local classes never appear outside the full documentation, no matter
+        what is their visibility.
+        """
         if not self.is_documented():
             return DocType.none
         if self._rawdoc.is_local():
             return DocType.internal
         return self._rawdoc.get_visibility()
 
-    def get_file_documentation_type(self):
-        return max([fileobj.get_documentation_type() for fileobj in self._files])
+    def get_file_doc_type(self):
+        return max([fileobj.get_doc_type() for fileobj in self._files])
 
     def is_in_installed_file(self):
         return any([fileobj.is_installed() for fileobj in self._files])
 
+class Member(object):
+
+    """Member (in Doxygen terminology) in the GROMACS source tree.
+
+    Currently, modeling is limited to the minimal set of properties that the
+    checker uses.
+    """
+
+    def __init__(self, rawdoc, namespace):
+        self._rawdoc = rawdoc
+        self._namespace = namespace
+
+    def get_name(self):
+        return self._rawdoc.get_name()
+
+    def get_reporter_location(self):
+        return self._rawdoc.get_reporter_location()
+
+    def is_documented(self):
+        return self._rawdoc.is_documented()
+
+    def has_brief_description(self):
+        return self._rawdoc.has_brief_description()
+
+    def has_inbody_description(self):
+        return self._rawdoc.has_inbody_description()
+
+    def is_visible(self):
+        """Return whether the member is visible in Doxygen documentation.
+
+        Doxygen ignores members whose parent compounds are not documented.
+        However, when EXTRACT_ANON_NPACES=ON (which is set for our full
+        documentation), members of anonymous namespaces are extracted even if
+        the namespace is the only parent and is not documented.
+        """
+        if self._namespace and self._namespace.is_anonymous():
+            return True
+        return self._rawdoc.get_inherited_visibility() != DocType.none
+
+
 class GromacsTree(object):
 
     """Root object for navigating the GROMACS source tree.
@@ -423,6 +495,8 @@ class GromacsTree(object):
         self._files = dict()
         self._modules = dict()
         self._classes = set()
+        self._namespaces = set()
+        self._members = set()
         self._walk_dir(os.path.join(self._source_root, 'src'))
         rootdir = self._get_dir(os.path.join('src', 'gromacs'))
         for subdir in rootdir.get_subdirectories():
@@ -503,7 +577,9 @@ class GromacsTree(object):
         self._load_modules()
         self._load_files()
         if not only_files:
+            self._load_namespaces()
             self._load_classes()
+            self._load_members()
 
     def _load_dirs(self):
         """Load Doxygen XML directory information."""
@@ -568,6 +644,14 @@ class GromacsTree(object):
             fileobj.set_doc_xml(filedoc, self)
             self._docmap[filedoc] = fileobj
 
+    def _load_namespaces(self):
+        """Load Doxygen XML namespace information."""
+        nsdocs = self._docset.get_namespaces()
+        for nsdoc in nsdocs:
+            nsobj = Namespace(nsdoc)
+            self._docmap[nsdoc] = nsobj
+            self._namespaces.add(nsobj)
+
     def _load_classes(self):
         """Load Doxygen XML class information."""
         classdocs = self._docset.get_classes()
@@ -577,6 +661,16 @@ class GromacsTree(object):
             self._docmap[classdoc] = classobj
             self._classes.add(classobj)
 
+    def _load_members(self):
+        """Load Doxygen XML member information."""
+        memberdocs = self._docset.get_members()
+        for memberdoc in memberdocs:
+            nsdoc = memberdoc.get_namespace()
+            nsobj = self.get_object(nsdoc)
+            memberobj = Member(memberdoc, nsobj)
+            self._docmap[memberdoc] = memberobj
+            self._members.add(memberobj)
+
     def _get_dir(self, relpath):
         """Get directory object for a path relative to source tree root."""
         return self._dirs.get(relpath)
@@ -609,6 +703,8 @@ class GromacsTree(object):
 
     def get_object(self, docobj):
         """Get tree object for a Doxygen XML object."""
+        if docobj is None:
+            return None
         return self._docmap.get(docobj)
 
     def get_files(self):
@@ -625,5 +721,4 @@ class GromacsTree(object):
 
     def get_members(self):
         """Get iterable for all members (in Doxygen terms) in the source tree."""
-        # TODO: Add wrappers to solve some issues.
-        return self._docset.get_members()
+        return self._members
index 47f1f70be8ce9c08c429e9ac3cb03353c265ff69..f67d115cecd1c067e03f058364a7bbc5158eb603 100755 (executable)
@@ -343,10 +343,10 @@ class GraphBuilder(object):
         gmxtree.
         """
         intramodule = (fromfile.get_module() == tofile.get_module())
-        is_legacy = not tofile.get_module().is_documented()
+        is_legacy = not tofile.api_type_is_reliable()
         if fromfile.get_module() == tofile.get_module():
             edgetype = EdgeType.intramodule
-        elif tofile.get_api_type() == DocType.internal:
+        elif tofile.get_api_type() == DocType.internal and not tofile.is_public():
             if is_legacy:
                 edgetype = EdgeType.legacy
             else:
@@ -355,30 +355,30 @@ class GraphBuilder(object):
             edgetype = EdgeType.test
         elif tofile.is_test_file():
             edgetype = EdgeType.undocumented
-        elif fromfile.is_source_file() or \
-                (fromfile.get_api_type() <= DocType.internal and \
-                not fromfile.is_installed()):
-            if tofile.get_api_type() == DocType.public:
+        elif fromfile.is_module_internal():
+            if tofile.is_public():
                 edgetype = EdgeType.pubimpl
             elif tofile.get_api_type() == DocType.library:
                 edgetype = EdgeType.libimpl
-            elif is_legacy or not tofile.is_documented():
+            elif is_legacy:
                 edgetype = EdgeType.legacy
+            elif not tofile.is_documented():
+                edgetype = EdgeType.undocumented
             else:
                 raise ValueError('Unknown edge type between {0} and {1}'
-                        .format(fromfile.path, tofile.path))
+                        .format(fromfile.get_relpath(), tofile.get_relpath()))
         elif fromfile.get_api_type() == DocType.library:
             edgetype = EdgeType.library
-        elif fromfile.get_api_type() == DocType.public or fromfile.is_installed():
-            if tofile.get_api_type() == DocType.public or \
-                    tofile.get_documentation_type() == DocType.public or \
-                    (tofile.is_installed() and not tofile.is_documented()):
+        elif fromfile.is_public() or fromfile.is_installed():
+            if tofile.is_public() or tofile.is_installed():
                 edgetype = EdgeType.public
             else:
                 edgetype = EdgeType.undocumented
+        elif is_legacy:
+            edgetype = EdgeType.legacy
         else:
             raise ValueError('Unknown edge type between {0} and {1}'
-                    .format(fromfile.path, tofile.path))
+                    .format(fromfile.get_relpath(), tofile.get_relpath()))
         return Edge(filenodes[fromfile], filenodes[tofile], edgetype)
 
     def _create_file_edges(self, filenodes):
@@ -397,6 +397,17 @@ class GraphBuilder(object):
                     edges.append(edge)
         return edges
 
+    def _get_module_color(self, modulegroup):
+        if modulegroup == 'legacy':
+            return 'fillcolor=grey75'
+        elif modulegroup == 'analysismodules':
+            return 'fillcolor="0 .2 1"'
+        elif modulegroup == 'utilitymodules':
+            return 'fillcolor=".08 .2 1"'
+        elif modulegroup == 'mdrun':
+            return 'fillcolor=".75 .2 1"'
+        return None
+
     def _create_module_node(self, module, filenodes):
         """Create node for a module.
 
@@ -408,17 +419,12 @@ class GraphBuilder(object):
         properties.append('shape=ellipse')
         properties.append('URL="\\ref module_{0}"'.format(module.get_name()))
         if not module.is_documented():
+            fillcolor = self._get_module_color('legacy')
+        else:
+            fillcolor = self._get_module_color(module.get_group())
+        if fillcolor:
             style.append('filled')
-            properties.append('fillcolor=grey75')
-        elif module.get_group() == 'analysismodules':
-            style.append('filled')
-            properties.append('fillcolor="0 .2 1"')
-        elif module.get_group() == 'utilitymodules':
-            style.append('filled')
-            properties.append('fillcolor=".08 .2 1"')
-        elif module.get_group() == 'mdrun':
-            style.append('filled')
-            properties.append('fillcolor=".75 .2 1"')
+            properties.append(fillcolor)
         rootdir = module.get_root_dir()
         if rootdir.has_installed_files():
             properties.append('color=".66 .5 1"')
@@ -430,6 +436,20 @@ class GraphBuilder(object):
             node.add_child(self._create_file_node(childfile, filenodes))
         return node
 
+    def _create_legend_node(self, label, modulegroup):
+        if modulegroup:
+            nodename = 'legend_' + modulegroup
+            fillcolor = self._get_module_color(modulegroup)
+        else:
+            nodename = 'legend_' + label
+            fillcolor = None
+        style = []
+        properties = []
+        if fillcolor:
+            style.append('filled')
+            properties.append(fillcolor)
+        return Node(nodename, label, style, properties)
+
     def create_modules_graph(self):
         """Create module dependency graph."""
         filenodes = dict()
@@ -445,6 +465,15 @@ class GraphBuilder(object):
                 nodes.append(node)
             modulenodes.append(node)
         edges = self._create_file_edges(filenodes)
+        # TODO: Consider adding invisible edges to order the nodes better.
+        # TODO: Consider adding legend for the edge types as well.
+        legendnode = Node('legend', 'legend')
+        legendnode.add_child(self._create_legend_node('legacy', 'legacy'))
+        legendnode.add_child(self._create_legend_node('analysis', 'analysismodules'))
+        legendnode.add_child(self._create_legend_node('utility', 'utilitymodules'))
+        legendnode.add_child(self._create_legend_node('mdrun', 'mdrun'))
+        legendnode.add_child(Node('legend_installed', 'installed', properties=['color=".66 .5 1"', 'penwidth=3']))
+        nodes.append(legendnode)
         graph = Graph(nodes, edges)
         for node in modulenodes:
             graph.collapse_node(node)
index 74bc93d515ae4378afafe80221c0983c5bae1440..38a07a50e016a1dd7102902da7d0bab36c31ad95 100644 (file)
@@ -1,7 +1,7 @@
 So, you want to build the manual? This is now easy.
 
 1. Configure the main GROMACS repo with GMX_BUILD_MANUAL=on
-2. cmake will run some detection about whetehr this is possible
+2. cmake will run some detection about whether this is possible
 3. Later, use "make manual," which will build GROMACS in the
    usual way, and use the generated binaries to build the manual.
 
index 21b53702bb0d6b7741b688ddac3fee3592cf5fde..9e997a1d981a0c7b31023b646d9294f02bc69b53 100644 (file)
@@ -1,4 +1,4 @@
-398
+399
 If You Want Something Done You Have to Do It Yourself_(Highlander II)
 I Live the Life They Wish They Did_(Tricky)
 Jesus Built My Hotrod_(Ministry)
@@ -397,3 +397,4 @@ Restraint! What possible restraint?_(Joseph Conrad)
 It was something to at least have a choice of nightmares_(Joseph Conrad)
 You fight, work, sweat, nearly kill yourself, sometimes you do kill yourself, trying to accomplish something - and you can't._(Joseph Conrad)
 And after some more talk we agreed that the wisdom of rats had been grossly overrated, being in fact no greater than that of men_(Joseph Conrad)
+It's an easy game, just don't let the ball past!_(Szilard Pall)
index 22943e384bf668d4714733bf68d838a9a948f998..173d1bc1ce1dd8454df642f25052b2ebdece10e5 100644 (file)
@@ -188,7 +188,7 @@ T3H Water
 K      Ion
 NA     Ion
 CA     Ion
-MK     Ion
+MG     Ion
 CL     Ion
 ZN     Ion
 CU1    Ion
index c71140f3b97bbb7020ea6489137e090e2eee1b71..023137cbdb74da76933c73d61a0150c41fcd8d59 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
-#include "main.h"
+
 #include "macros.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
-#include "sysstuff.h"
 #include "txtdump.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/utility/smalloc.h"
index 371156f7ee24ea4053201ccff219411d82f9a61b..d9188037f7ef70c2c6f3b6cea5a166771e226685 100644 (file)
@@ -37,7 +37,6 @@
 #endif
 
 #include "typedefs.h"
-#include "main.h"
 #include "vec.h"
 #include "txtdump.h"
 
index 923319e4e3652e491783b1f930ce185d6578c08b..fc0bc797fe7f3b0a4e72f95acd83819a400826e1 100644 (file)
@@ -39,7 +39,7 @@
 #include "ns.h"
 #include "gromacs/utility/smalloc.h"
 #include "wnblist.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
index 23459e1c55ea603e7a8b287fbf7273bd105cbea4..e041d004436878a5403e50c7b30b6cedd7774102 100644 (file)
@@ -39,7 +39,6 @@
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
@@ -47,8 +46,8 @@
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/fileio/matio.h"
 #include "index.h"
 #include "gstat.h"
index d99072f1b90102c6afb9d40e54c132b99b0124eb..0f6b3c4c74c0b56e2c599594a5fedf2ab1c26265 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <stdlib.h>
 #include "errno.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/cstringutil.h"
 #include "macros.h"
@@ -47,8 +46,8 @@
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gstat.h"
 #include "index.h"
 #include "gromacs/fileio/pdbio.h"
index bd625ce29b4bd314c387cc1a63c527bce6168293..95f4ab9a0d2fda0c60b199591afc0d30fc4be277 100644 (file)
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "random.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "physics.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "vec.h"
 #include "names.h"
 #include "ehdata.h"
index f0f5d2c85ecb74896b7f3b5a9c31492635ff2342..513a4a34d3ff6d4fb20f108874b92e985a4d433a 100644 (file)
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "random.h"
 #include "gromacs/fileio/strdb.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "physics.h"
 #include "ehdata.h"
 
index 39ac52b22e92bec7f82bf2ac4c64f5aaa57c65b1..0f4f23700281a77f2bb795c79fa1eb9c8043b66a 100644 (file)
 #include "macros.h"
 #include "copyrite.h"
 #include "gromacs/commandline/pargs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "random.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "physics.h"
-#include "xvgr.h"
 #include "vec.h"
 #include "names.h"
 #include "ehdata.h"
index 175b95cce4247bb8e7a5e6d5d8e4543d87447200..5f3f1f36a1b0dd015194d99b3425553857f47631 100644 (file)
@@ -36,7 +36,6 @@
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
@@ -45,9 +44,8 @@
 #include "gromacs/fileio/matio.h"
 #include "physics.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "copyrite.h"
-#include "xvgr.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
 
index 03bbf17d5c3f198aabf0765717ed3eacddd73ff2..e6bb88d60f2bdee4cbe256bf475bf35b6a0631be 100644 (file)
 
 #include <math.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
 #include "rmpbc.h"
 #include "copyrite.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/tpxio.h"
 #include "index.h"
@@ -35,7 +34,7 @@
 #include "nrnb.h"
 #include "gstat.h"
 #include "gromacs/fileio/matio.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 #define G_REF1      0
index 91fb0657ab5e47c6c73632dc3fd39700979405fd..d90fb3f0226cc029afc312cf9545563e02ea3240 100644 (file)
@@ -41,7 +41,7 @@
 #include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/pdbio.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
index 3f03bb7d067aab63d4fd6462a7546e23c470f901..a5e9f80f0d7e8e10aec456c54f51158f243ee175 100644 (file)
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
 #include "copyrite.h"
-#include "main.h"
 #include "nrnb.h"
 #include "txtdump.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "mdatoms.h"
 #include "coulomb.h"
@@ -54,7 +53,7 @@
 #include "rmpbc.h"
 #include "pme.h"
 #include "force.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "pbc.h"
 
 #include "gromacs/utility/gmxmpi.h"
index 3bea84f5d96fe1da230d6d2de07681ea1d8b88b8..7f9583afb0e35f04ba2f4de158d5b26bb3c4ef46 100644 (file)
@@ -41,8 +41,9 @@
 #include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gromacs/fileio/pdbio.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
index b2e52fe23dca5452144fd81e9d10cdc5b5eb1b3a..c7f2849314adaa097ab13e7b4c0ae087812e270f 100644 (file)
@@ -1,4 +1,4 @@
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 void my_func(char *msg)
 {
index b97146db75b4b265a3a16d2621d00df88623c347..1f2f4936ac1fb2ea590c9e78a4bb543108145f59 100644 (file)
@@ -37,7 +37,7 @@
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "complex.h"
 #include "fftgrid.h"
 #include "mdrun.h"
index 247a7cd85334864e48957f91a84cb3b002a57ef8..4018195d6ba3ee0b3d98cdb17779f86f3f656360 100644 (file)
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/writeps.h"
 #include "copyrite.h"
-#include "xvgr.h"
 #include "minvert.h"
 #include "pppm.h"
 #include "readinp.h"
-#include "main.h"
 #include "force.h"
 #include "nrnb.h"
 #include "coulomb.h"
index 017604b6152ea7f6c395fd08dc088bf84bfb32c0..55fd5fb3940023f82ad40630b7b5d51350eb80db 100644 (file)
@@ -39,7 +39,7 @@
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "copyrite.h"
 #include "mdrun.h"
 #include "main.h"
index ca66a1fdf75716ed9b2fa210f05570b4c2264ebe..7b0f0b20e31050152dec42bdc7ed4ef7261d6913 100644 (file)
 
 #include "gromacs/legacyheaders/oenv.h"
 #include "gromacs/legacyheaders/vec.h"
-#include "gromacs/legacyheaders/xvgr.h"
 
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/options/timeunitmanager.h"
index e723e00b0e7b268f54f63f47cefd6b0e2b76a580..569cca5f9e9925e6030f0db4f54ec4e5a5393f5e 100644 (file)
@@ -47,7 +47,6 @@
 #include <utility>
 
 #include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/network.h"
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinehelpmodule.h"
@@ -58,6 +57,7 @@
 #include "gromacs/commandline/cmdlineprogramcontext.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
index 0a24deacbd517cecdb26403f9c8cf9f868c95092..0f3ce6c383458e8a9e3913a98a500e45f1c80be5 100644 (file)
 
 #include "thread_mpi/mutex.h"
 
-#include "gromacs/fileio/path.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/stringutil.h"
 
 namespace gmx
index e7236740c4f1d7666f01d81bf4e1719e75d461b9..6b240668b872dc400e2f4c509059399ba231c7ef 100644 (file)
@@ -52,9 +52,7 @@
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
 #include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/network.h"
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinehelpwriter.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
 #include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
@@ -684,7 +684,6 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
             }
         }
     }
-    debug_gmx();
 
     /* Check ALL the flags ... */
     max_pa = NPCA_PA + EXTRA_PA + npargs+1;
index befb5c991f4e2fbadc9e11713b293bdd0e3dc6b8..4fb136f52c2624f62cfc127c6648f3682a2ae793 100644 (file)
@@ -45,8 +45,8 @@
 #include <gtest/gtest.h>
 
 #include "gromacs/commandline/cmdlineprogramcontext.h"
-#include "gromacs/fileio/path.h"
 #include "gromacs/utility/common.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/uniqueptr.h"
 
 #include "testutils/cmdlinetest.h"
index 8c63fdf3514a7649aa0a61b471b0555a4681055c..028e9f9636dcb252a933eaf744f8b0d0540e54ce 100644 (file)
 #include "mtop_util.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/mdlib/groupcoord.h"
 
 #include "gromacs/linearalgebra/nrjac.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* We use the same defines as in mvdata.c here */
 #define  block_bc(cr,   d) gmx_bcast(     sizeof(d),     &(d), (cr))
index 9a1c410ba53753e3fd8b9f87e23d6a0224c05a21..5d5fa155d3af12a25c9963436ea6d929f9701e34 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -49,6 +49,7 @@
 #define GMX_ESSENTIALDYNAMICS_EDSAM_H
 
 #include "typedefs.h"
+#include "gromacs/fileio/filenm.h"
 
 #ifdef __cplusplus
 extern "C" {
index 591ff87e708fd9f4fedbcf4e239f65ef137f6ff7..b55aaef95fe8172df63f31d8f6b77d94b2deafb8 100644 (file)
@@ -43,7 +43,7 @@
 #include <errno.h>
 
 #include "types/simple.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fft/fft.h"
 #include "gromacs/math/gmxcomplex.h"
 
index 06e0826a7dd7de6484fe353a422e72537eb0558a..4c7f40c235e97555bdfbcea6f51a1e35cde54362 100644 (file)
@@ -76,7 +76,7 @@
 FILE* debug = 0;
 #endif
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 #ifdef GMX_FFT_FFTW3
index f56f40d0b0ba9492a68639e7234e57c7d59723c9..954870f3e712e8ee052c0d9675b28bf7cd390018 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,7 +44,7 @@
 
 #include "gromacs/fft/fft.h"
 #include "gromacs/legacyheaders/types/simple.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #include "external/fftpack/fftpack.h"
 
index 16900074fa1e117f318a96a6ca658195b71f85bd..81af1fe85c2de1df4647b8bb1059f0da1ce052dd 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,7 +43,7 @@
 #include <fftw3.h>
 
 #include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #ifdef GMX_DOUBLE
 #define FFTWPREFIX(name) fftw_ ## name
index e142c84d3bfbcd117bd6bf933584c88e7a76927b..1a12c280fef249e1b0961000868b3ce5c4a2da8b 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,7 +44,7 @@
 #include <mkl_service.h>
 
 #include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 /* For MKL version (<10.0), we should define MKL_LONG. */
index 7312cbedc79309abdb6fb5b3b9fc31ac0ed91766..0e3c4ef19887fba9ef4e8b5db0979156e8c95663 100644 (file)
@@ -47,7 +47,7 @@
 #include "gromacs/utility/gmxmpi.h"
 
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #include "fft5d.h"
 
index 18078dee8149bf6f8e5f3ee7d912ef2c39c04f73..21d6422150a4b7170852301799beb86e64ab08fa 100644 (file)
@@ -46,7 +46,6 @@ set(FILEIO_PUBLIC_HEADERS
     confio.h
     enxio.h
     filenm.h
-    futil.h
     gmxfio.h
     matio.h
     mdoutf.h
@@ -58,6 +57,7 @@ set(FILEIO_PUBLIC_HEADERS
     trxio.h
     xdr_datatype.h
     xtcio.h
+    xvgr.h
     )
 gmx_install_headers(fileio ${FILEIO_PUBLIC_HEADERS})
 
index 18cf7a1c5936996849a5ced67aceba01d340679b..e023771a00324d5e2e79086c52a02e507cdbd215 100644 (file)
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include <errno.h>
 #include "macros.h"
 #include "gromacs/utility/cstringutil.h"
 #include "confio.h"
 #include "vec.h"
 #include "symtab.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "xdrf.h"
 #include "filenm.h"
 #include "pdbio.h"
 #include "tpxio.h"
 #include "trxio.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "copyrite.h"
 #include "pbc.h"
 #include "mtop_util.h"
index 1a7585f3fbaf2141c44f9bcf68682ade01a883d8..70718363dfbb94a87c48717543d880d594b914b5 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
-#include "futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "gmxfio.h"
 #include "enxio.h"
@@ -110,31 +111,31 @@ static void enxsubblock_free(t_enxsubblock *sb)
 {
     if (sb->fval_alloc)
     {
-        free(sb->fval);
+        sfree(sb->fval);
         sb->fval_alloc = 0;
         sb->fval       = NULL;
     }
     if (sb->dval_alloc)
     {
-        free(sb->dval);
+        sfree(sb->dval);
         sb->dval_alloc = 0;
         sb->dval       = NULL;
     }
     if (sb->ival_alloc)
     {
-        free(sb->ival);
+        sfree(sb->ival);
         sb->ival_alloc = 0;
         sb->ival       = NULL;
     }
     if (sb->lval_alloc)
     {
-        free(sb->lval);
+        sfree(sb->lval);
         sb->lval_alloc = 0;
         sb->lval       = NULL;
     }
     if (sb->cval_alloc)
     {
-        free(sb->cval);
+        sfree(sb->cval);
         sb->cval_alloc = 0;
         sb->cval       = NULL;
     }
@@ -146,10 +147,10 @@ static void enxsubblock_free(t_enxsubblock *sb)
         {
             if (sb->sval[i])
             {
-                free(sb->sval[i]);
+                sfree(sb->sval[i]);
             }
         }
-        free(sb->sval);
+        sfree(sb->sval);
         sb->sval_alloc = 0;
         sb->sval       = NULL;
     }
@@ -231,7 +232,7 @@ static void enxblock_free(t_enxblock *eb)
         {
             enxsubblock_free(&(eb->sub[i]));
         }
-        free(eb->sub);
+        sfree(eb->sub);
         eb->nsub_alloc = 0;
         eb->sub        = NULL;
     }
@@ -265,7 +266,7 @@ void free_enxframe(t_enxframe *fr)
     {
         enxblock_free(&(fr->block[b]));
     }
-    free(fr->block);
+    sfree(fr->block);
 }
 
 void add_blocks_enxframe(t_enxframe *fr, int n)
index 62f4521d86fc3b3e9b664dac290d898e73f0e6f5..3c8c2fff8944b8acb284f8da4dcbf50c0d306414 100644 (file)
@@ -44,8 +44,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
diff --git a/src/gromacs/fileio/futil.h b/src/gromacs/fileio/futil.h
deleted file mode 100644 (file)
index ddaaef1..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_FILEIO_FUTIL_H
-#define GMX_FILEIO_FUTIL_H
-
-#include <stdio.h>
-#include "../legacyheaders/typedefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-/* Native windows uses backslash path separators.
- * Cygwin and everybody else in the world use slash.
- */
-#include "../utility/gmx_header_config.h"
-#ifdef GMX_NATIVE_WINDOWS
-#define DIR_SEPARATOR '\\'
-#else
-#define DIR_SEPARATOR '/'
-#endif
-
-/* Now get the maximum path size. */
-#ifdef PATH_MAX
-#  define GMX_PATH_MAX PATH_MAX
-#elif defined MAX_PATH
-#  define GMX_PATH_MAX MAX_PATH
-#else
-#  define GMX_PATH_MAX 4096
-#endif
-
-typedef gmx_int64_t    gmx_off_t;
-
-void no_buffers(void);
-/* Turn off buffering of files (which is default) for debugging purposes */
-
-gmx_bool gmx_fexist(const char *fname);
-/* Return TRUE when fname exists, FALSE otherwise */
-
-gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr);
-/* Return TRUE when fname exists, FALSE otherwise, bcast from master to others */
-
-gmx_bool gmx_eof(FILE *fp);
-/* Return TRUE on end-of-file, FALSE otherwise */
-
-gmx_bool is_pipe(FILE *fp);
-/* Check whether the file (opened by gmx_ffopen) is a pipe */
-
-/*  Make a backup of file if necessary.
-    Return false if there was a problem.
- */
-gmx_bool make_backup(const char * file);
-
-FILE *gmx_ffopen(const char *file, const char *mode);
-/* Return a valid file pointer when successful, exits otherwise
- * If the file is in compressed format, open a pipe which uncompresses
- * the file! Therefore, files must be closed with gmx_ffclose (see below)
- */
-
-int gmx_ffclose(FILE *fp);
-/* Close files or pipes */
-
-
-void frewind(FILE *fp);
-/* Does not rewind pipes, but does so for normal files */
-
-#define rewind frewind
-
-
-int gmx_fseek(FILE *stream, gmx_off_t offset, int whence);
-/* OS-independent fseek. 64-bit when available */
-
-gmx_off_t gmx_ftell(FILE *stream);
-/* OS-independent fseek. 64-bit when available. */
-
-
-gmx_bool is_pipe(FILE *fp);
-
-char *gmxlibfn(const char *file);
-/* allocates and returns a string with the full file name for a library file */
-
-FILE *libopen(const char *file);
-/* Open a library file for reading. This looks in the current directory
- * first, and then in the library directory. If the file is not found,
- * it terminates with a fatal_error
- */
-
-/* Opaque data type to list directories */
-typedef struct gmx_directory *
-    gmx_directory_t;
-
-/* Open a directory for reading. The first argument should be a pointer
- * to a declared gmx_directory_t variable. Returns 0 on success.
- */
-int
-gmx_directory_open(gmx_directory_t *p_gmxdir, const char *dirname);
-
-
-/* Given an initialized gmx_directory_t, if there are more files in
- * the directory this routine returns 0 and write the next name
- * into the USER-PROVIDED buffer name. The last argument is the max
- * number of characters that will be written. Just as strncpy, the
- * string will NOT be terminated it it is longer than maxlength_name.
- */
-int
-gmx_directory_nextfile(gmx_directory_t gmxdir, char *name, int maxlength_name);
-
-/* Release all data for a directory structure */
-int
-gmx_directory_close(gmx_directory_t gmxdir);
-
-
-char *low_gmxlibfn(const char *file, gmx_bool bAddCWD, gmx_bool bFatal);
-
-FILE *low_libopen(const char *file, gmx_bool bFatal);
-/* The same as the above, but does not terminate if (!bFatal) */
-
-/* Create unique name for temp file (wrapper around mkstemp).
- * Buf should be at least 7 bytes long
- */
-void gmx_tmpnam(char *buf);
-
-/* truncte the file to the specified length */
-int gmx_truncatefile(char *path, gmx_off_t length);
-
-/* rename/move the file (atomically, if the OS makes that available) oldname
-   to newname */
-int gmx_file_rename(const char *oldname, const char *newname);
-
-/* copy the file (data only) oldname to newname. if copy_if_empty==FALSE,
-   the file won't be copied if it's empty.*/
-int gmx_file_copy(const char *oldname, const char *newname, gmx_bool copy_if_empty);
-
-/* do an fsync() on an open file pointer.
-   Only use this during checkpointing! */
-int gmx_fsync(FILE *fp);
-
-void gmx_chdir(const char *directory);
-void gmx_getcwd(char *buffer, size_t size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* GMX_FILEIO_FUTIL_H */
index ab627936dc5dea208bea37df04a73c6cadbfb808..0d87a47c71889cd7e5a0aa39adb14461e5b3c444 100644 (file)
 
 #include "thread_mpi/threads.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "filenm.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gmxfio.h"
index 021d6eec8ffe7b41de148f3c88ce0168c94c183d..93f0d7bf76ef6bf3146124a18ddc68df3c14287d 100644 (file)
@@ -2,8 +2,8 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_FILEIO_GMXFIO_H
 
 #include <stdio.h>
+
 #include "../legacyheaders/typedefs.h"
-#include "futil.h"
+#include "../utility/cstringutil.h"
+#include "../utility/futil.h"
 
 #ifdef __cplusplus
 extern "C" {
index f27756aa49e06186ec259548a2f23ebb7905e53d..e44dffed2cad170d4f3bbe922aba9caf25920ee7 100644 (file)
 #include <io.h>
 #endif
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "filenm.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gmxfio.h"
index 7cc1c559386046c3b9b4ef3d5067d56f6c41527b..c7f05009b28eb97c0ea932dd4a1162989aecace7 100644 (file)
@@ -47,7 +47,7 @@
 
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "filenm.h"
 #include "gmxfio.h"
 #include "md5.h"
index e1b7031ed3f6f6b2ede3595a4e3b4951f6ac5445..f4b38811550cf32cb5d4ac9acb5b599cc8411905 100644 (file)
@@ -46,7 +46,7 @@
 
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "filenm.h"
 #include "gmxfio.h"
 #include "md5.h"
index 47ad3ca59c3c9a37592d6a9293a37720caea027b..59f811736cdfeddcd403c1ee92898575463acdcd 100644 (file)
 #include <io.h>
 #endif
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "filenm.h"
 #include "gmxfio.h"
 #include "md5.h"
index 219e64ead90b2e339e186640d2250d39b820eaa5..758c348ed6b9817331f7242cd380a69bc823c02c 100644 (file)
@@ -46,7 +46,7 @@
 
 #include "xdrf.h"
 #include "xdr_datatype.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 
 /* This is just for clarity - it can never be anything but 4! */
 #define XDR_INT_SIZE 4
index 0adabce0269e1217adf51793c754c5ed7e84eb1f..04625c407099a1616db3b07f0d299cf9f07013fb 100644 (file)
 
 #include <algorithm>
 
-#include "sysstuff.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/cstringutil.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "matio.h"
 #include "gmxfio.h"
 #include "gromacs/math/utilities.h"
index 4b50c2a6c08302a9646fa1a96852a4769a4704e9..bb820b6290121ad4308ef6ef5c197ea838fc18a9 100644 (file)
@@ -34,7 +34,6 @@
  */
 #include "mdoutf.h"
 
-#include "gromacs/legacyheaders/xvgr.h"
 #include "gromacs/legacyheaders/mdrun.h"
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/legacyheaders/mvdata.h"
@@ -46,7 +45,8 @@
 #include "checkpoint.h"
 #include "copyrite.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 struct gmx_mdoutf {
index 16fa4a23dba0b04afd903b9d02e6520116a5ea18..1d3dc922ee2d8acb4ce3494c0df7bc910ba22166 100644 (file)
@@ -39,9 +39,9 @@
 #endif
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/cstringutil.h"
 #include "vec.h"
 #include "gromacs/utility/smalloc.h"
 #include "pdbio.h"
 #include "vec.h"
 #include "copyrite.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "atomprop.h"
 #include "physics.h"
 #include "pbc.h"
 #include "gmxfio.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct {
     int ai, aj;
index 18745d2c87b8971da088822ea34f2bb2ae94dbfa..7b152c6b354dacff7268a167469d142d86eb10f9 100644 (file)
@@ -2,8 +2,8 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,8 @@
 #ifndef GMX_FILEIO_PDBIO_H
 #define GMX_FILEIO_PDBIO_H
 
-#include "../legacyheaders/sysstuff.h"
+#include <stdio.h>
+
 #include "../legacyheaders/typedefs.h"
 #include "../legacyheaders/symtab.h"
 #include "../legacyheaders/atomprop.h"
index d46168b576a313c2360c3e51a27244cc1f80b287..d1cb52aa7536614a367de8a23943f825a893dcdb 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 
 gmx_bool get_a_line(FILE *fp, char line[], int n)
 {
index a215baa297e9b4b6dff7f52d2013e773bb7f5ac0..6fa34d8f8c23fb583c19933f58853db580f71462 100644 (file)
@@ -42,9 +42,9 @@
 #include <gtest/gtest.h>
 #include <string>
 
-#include "gromacs/fileio/path.h"
 #include "gromacs/fileio/tngio.h"
 #include "gromacs/fileio/tngio_for_tools.h"
+#include "gromacs/utility/path.h"
 
 #include "testutils/testfilemanager.h"
 
index 062a771665a1fb0dce1f2be6150288ee9f910d5c..c4618e69ed40f34f476e69d326f2c75ace6bd8bc 100644 (file)
@@ -43,7 +43,7 @@
 #include "thread_mpi/threads.h"
 
 #include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* The source code in this file should be thread-safe.
          Please keep it that way. */
index c8854a3db762d410deff2c30df26a502fb9e7bff..89620eb7daa354106fe517f5a79688e12588714f 100644 (file)
 #endif
 
 #include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/main.h"
 #include "gromacs/legacyheaders/physics.h"
+
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/math/utilities.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/common.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
-#include "gmxfio.h"
 
 static const char *modeToVerb(char mode)
 {
index 3d7954d1365c6806f0eb337751d8eb532d5cf5a1..d8fae47a14d65440bd54dee499f341d2929fce40 100644 (file)
@@ -49,9 +49,9 @@
 
 #include "gromacs/legacyheaders/types/atoms.h"
 #include "gromacs/legacyheaders/physics.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
 
 #include "gromacs/utility/common.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 void gmx_prepare_tng_writing(const char              *filename,
index 0fdb93aad232ad294dcbff7889c45db0b123dce9..338b99edb758a93f813a6a833cff53580401c139 100644 (file)
 
 /* This file is completely threadsafe - keep it that way! */
 
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "names.h"
 #include "symtab.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "filenm.h"
 #include "gmxfio.h"
 #include "tpxio.h"
index 699b482022db3bec73c038e07ff2bb36f5948d6b..3f90db4cf218474db331647bf56fbba34381e64b 100644 (file)
@@ -38,7 +38,6 @@
 
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "vec.h"
 #include "sim_util.h"
 #include "mdrun.h"
index 91634ce09acf1d3074dec4a721fab2e2de0c54d4..0e2d99ed4cc21587059da4fecea6763aa609a671 100644 (file)
 #endif
 
 #include <string.h>
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "txtdump.h"
 #include "names.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "trnio.h"
 #include "gmxfio.h"
 
index 25d3dd1fa4f57088401873eb716e39251bf9f23b..95cfc24dc591dc06ac8e639f8017bf58a0cfbe8f 100644 (file)
@@ -43,7 +43,6 @@
 #include <assert.h>
 #include <math.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #ifdef GMX_USE_PLUGINS
 #include "vmdio.h"
@@ -58,7 +57,7 @@
 #include "tngio_for_tools.h"
 #include "names.h"
 #include "vec.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "xtcio.h"
 #include "pdbio.h"
 #include "confio.h"
@@ -66,7 +65,7 @@
 #include "xdrf.h"
 
 #include "gromacs/fileio/timecontrol.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* defines for frame counter output */
 #define SKIP1   10
index 3fd42702d2ac914a165b652f311adff74a5a00c2..9a4a0ecd6c97cae8f46866da07f474b5bdb1a2a5 100644 (file)
 #include <shlobj.h>
 #endif
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
 #include "vmdio.h"
 
 
index dba6c5c15eb6dc57338160bd98eb033dc8bbf7fc..d9b3e52479ae803d34d460a38352f7fc532f6e29 100644 (file)
 
 #include <stdio.h>
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/gmxfio.h"
 
 const char *fontnm[efontNR] = {
index e48afd19bbe2acb1e05c82e3a6203aed8a4b88fe..e05cbdd4fd84a16ed4cd9c7b28b240163074eca5 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "typedefs.h"
 #include "xdrf.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 int xdr_real(XDR *xdrs, real *r)
index da52ac6bc24cb12c78b909bc1f953158c3ef2ae7..7ca5141139b808e21522418a0c0b8580699c5d19 100644 (file)
@@ -45,8 +45,8 @@
 #include "xtcio.h"
 #include "gromacs/utility/smalloc.h"
 #include "vec.h"
-#include "futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define XTC_MAGIC 1995
 
similarity index 99%
rename from src/gromacs/gmxlib/xvgr.cpp
rename to src/gromacs/fileio/xvgr.cpp
index 11e362ebeb5a7a3db4876dde9a4a0577d569c9c0..37836b6821511ebe20c2c5955522a5c5cae6dfc4 100644 (file)
@@ -34,6 +34,8 @@
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#include "gromacs/fileio/xvgr.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include <sys/time.h>
 #endif
 
-#include "sysstuff.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/futil.h"
-#include "copyrite.h"
-#include "oenv.h"
-#include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
-#include "viewit.h"
-#include "vec.h"
-#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/vec.h"
 
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
 
 gmx_bool output_env_get_print_xvgr_codes(const output_env_t oenv)
 {
similarity index 96%
rename from src/gromacs/legacyheaders/xvgr.h
rename to src/gromacs/fileio/xvgr.h
index 22123bdd0441be5c86cc108d698225a18138a236..d7fd73868982ba42cc3e4f0c0d34d27d952af004 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#ifndef GMX_FILEIO_XVGR_H
+#define GMX_FILEIO_XVGR_H
 
-#ifndef _xvgr_h
-#define _xvgr_h
+#include <stdio.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "viewit.h"
+#include "../legacyheaders/types/oenv.h"
+#include "../legacyheaders/types/simple.h"
+#include "../utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -191,4 +192,4 @@ real **read_xvg_time(const char *fn,
 }
 #endif
 
-#endif  /* _xvgr_h */
+#endif
index a9d28823e8d8af3d6cfd1a4054d8ae3191ef7f65..78db627e41dd3c38ff8dd94ef8bf333618f373e3 100644 (file)
 #include "macros.h"
 #include "txtdump.h"
 #include "bondf.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "typedefs.h"
 #include "vec.h"
 #include "gstat.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/trxio.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 void print_one(const output_env_t oenv, const char *base, const char *name,
                const char *title, const char *ylabel, int nf, real time[],
index 5aca984fc62c2d03de44757fb8fdc1ddba03964c..7645f15d98d95e321194799422e2b10f4ae366f6 100644 (file)
 #include "typedefs.h"
 #include "physics.h"
 #include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/utility/futil.h"
 #include "gstat.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "correl.h"
 
index 5e273a0bc01f8172f893e405a42fcf776711bcd8..f68522095c656c5ec7b54dd060d7d9d83f83b4b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -37,7 +37,7 @@
 #endif
 #include <stdio.h>
 #include "types/simple.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*Make range-array (Permutation identity) for sorting */
 void rangeArray(int *ar, int size)
index 7eb7155eedb0134a0d6aedf22216045738260590..9c2bb517c601216e33cefd263d36abff92242bdd 100644 (file)
@@ -42,9 +42,9 @@
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/fileio/matio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 
 t_mat *init_mat(int n1, gmx_bool b1D)
 {
index 11ee4eaea02e047789b1a88be26da662a4fa3cbc..3f86100cbe6562910a6498c5568b77d4e6ba0419 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "gromacs/utility/smalloc.h"
 #include "gstat.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "index.h"
 
 t_dlist *mk_dlist(FILE *log,
index 973660bdc8654ad10f65c819274892ef285f93ec..50dd7731c7308d9f2eb2c4395dbdab8212479811 100644 (file)
@@ -39,7 +39,7 @@
 #endif
 
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "symtab.h"
 
 void replace_atom(t_topology *top, int inr, char *anm, char *resnm,
index 2d555dc274572e1d05f76e3bcb22e81e41b478b3..be4982b0665be9669ee4c201d4071fd399d5539e 100644 (file)
@@ -43,7 +43,7 @@
 #include "eigio.h"
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 
 void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
                        rvec **xref, gmx_bool *bDMR,
index 406f5a36b184476784bb2ce3aba394b7d16d8f18..80ba9ee55b85d7324f96ae84f82bf9e608646160 100644 (file)
 
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/utility/futil.h"
 #include "gstat.h"
 #include "vec.h"
 #include "index.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 const int   nfp_ffn[effnNR] = { 0, 1, 2, 3, 2, 5, 7, 9, 4, 3};
 
index 7ee4bf867cb51ed0ac2df7b43e14c9dbd5bf01e2..ebf5b50f6b84da3332e54c74374c4b876294de59 100644 (file)
@@ -42,7 +42,7 @@
 #include "vec.h"
 
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 static void my_calc_xcm(int nbb, atom_id bbind[], rvec x[], rvec xcm)
index 79dc949fd34513b316c3684b7de219dde6fb8751..7d00997b1cfa5e943b4ea037cbda075807b3560c 100644 (file)
 #endif
 
 #include <math.h>
+#include <stdlib.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "vec.h"
 #include "geminate.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
 
 static void missing_code_message()
index 67bb1e7c6c339fe5c684fa8d0ec629c658c35bb9..dc7304ac88c857da72509a2cd69c11566c00ce4b 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
 #include "gromacs/fileio/confio.h"
 #include "copyrite.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
 #include "vec.h"
 #include "gromacs/statistics/statistics.h"
 #include "gromacs/commandline/pargs.h"
 #include "typedefs.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "macros.h"
 
 static const char *etitles[] = { "E-docked", "Free Energy" };
index f59b1130d807e8be4ecea627030dfd60ed670c1a..b47274b950f63632ebbf06e13ad5d570e9c28ec5 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/confio.h"
@@ -55,7 +57,8 @@
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/matio.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "rmpbc.h"
 #include "txtdump.h"
 #include "eigio.h"
index 494e19e3e0dca82b5429ccf6c1e89ebdb47c75f4..fd6a7548e9dda0dfccdd5e634c19c068b3ee5250 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "copyrite.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "readinp.h"
 #include "txtdump.h"
 #include "gstat.h"
 #include "gromacs/statistics/statistics.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gmx_ana.h"
 #include "geminate.h"
 
index 65bfad1cc58973aa04ece639ec9bfd9ca565ae55..3354d787df65683dc3bf5608618940811148bb17 100644 (file)
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "physics.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
 #include "vec.h"
 #include "index.h"
 #include "macros.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gstat.h"
 #include "gromacs/fileio/trnio.h"
 #include "gmx_ana.h"
index b692574685521ae180bb371b745bac9f53bb77d4..18881595743e8a461cd6277b9e5836d42a80eb91 100644 (file)
 #include <config.h>
 #endif
 
-#include <math.h>
-#include <string.h>
 #include <ctype.h>
-#include <math.h>
 #include <float.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "macros.h"
 #include "gromacs/fileio/enxio.h"
 #include "physics.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gmx_ana.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/utility/cstringutil.h"
index 263ed985e4c7f30acafff0542b98f696ec0c68da..3c40ffd893381887e27f2872accac32f749e41cd 100644 (file)
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "rmpbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
 #include "physics.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define MAX_ENDS 3
 
index be8f57e5d75bfeaee8a27283c6d7adbe94304f1a..2198a1439cd80ffd356a0ca697491594e77ceed9 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <stdio.h>
+
 #include <math.h>
+#include <stdio.h>
+#include <string.h>
 
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gstat.h"
 #include "macros.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/tpxio.h"
-#include <string.h>
-#include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gromacs/fileio/matio.h"
 #include "gmx_ana.h"
 
index 1e5a9e6d5a96f092eb579d24b147657a9e2c65be..98bf273f159b21c08ba41a6e0db776bdafee9ac2 100644 (file)
@@ -39,6 +39,7 @@
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "macros.h"
@@ -54,8 +55,8 @@
 #include "gromacs/random/random.h"
 #include "pbc.h"
 #include "rmpbc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/matio.h"
 #include "cmat.h"
 #include "gromacs/fileio/trnio.h"
@@ -64,7 +65,7 @@
 
 #include "gromacs/linearalgebra/eigensolver.h"
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* print to two file pointers at once (i.e. stderr and log) */
 static gmx_inline
index d84c79c2d82050fd6f2605cb30371ed03228d608..93a09cc4441899bf363b80b080076de247aab99a 100644 (file)
 
 #include <math.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
 #include "rmpbc.h"
 #include "gromacs/commandline/pargs.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
 #include "index.h"
@@ -63,7 +62,7 @@
 #include "mtop_util.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void clust_size(const char *ndx, const char *trx, const char *xpm,
                        const char *xpmw, const char *ncl, const char *acl,
index 4b9391fd1f6f8317cf888c12fbb32eeb8403c582..20927b5f5ac4b5af7ca284567a3e55dd1737a92f 100644 (file)
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "typedefs.h"
-#include "xvgr.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/tpxio.h"
 #include "vec.h"
 #include "index.h"
 #include "pbc.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/pdbio.h"
 #include "txtdump.h"
index 501597e9acb7addff70ca18cbb79a2a8eb22395d..9e4b5fc1eb6e50a0ca9f96cfee5b2242f7fa6353 100644 (file)
 #endif
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/trnio.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "rmpbc.h"
 #include "txtdump.h"
 #include "gromacs/fileio/matio.h"
@@ -70,7 +69,7 @@
 
 #include "gromacs/linearalgebra/eigensolver.h"
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 int gmx_covar(int argc, char *argv[])
 {
index c706b40be5b1c35159b77c012b2c4ca38f57ba81..8381843303852c7d686465c9cdbc1bd847744460 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
+
 #include "gromacs/commandline/pargs.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "vec.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "rmpbc.h"
 #include "pbc.h"
 #include "physics.h"
@@ -51,7 +53,7 @@
 #include "gmx_ana.h"
 #include "macros.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define SQR(x) (pow(x, 2.0))
 #define EPSI0 (EPSILON0*E_CHARGE*E_CHARGE*AVOGADRO/(KILO*NANO)) /* EPSILON0 in SI units */
index a6b89c7b05e074c228e6e87e16d2198365bc5b50..2c7b839e38137cf3d47058e1c864e6772361e6db 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <math.h>
-#include <ctype.h>
 
-#include "sysstuff.h"
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/utility/cstringutil.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gstat.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
@@ -59,7 +61,7 @@
 #include "gmx_ana.h"
 #include "macros.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct {
     char *atomname;
index 8675a164358a603785d9e9a8ea62142a87c59c8e..556014479b4e8bb6867b53f6263427799184ca80 100644 (file)
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "mshift.h"
-#include "xvgr.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "txtdump.h"
 #include "gstat.h"
 #include "gromacs/fileio/matio.h"
 #include "pbc.h"
+#include "viewit.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 int gmx_densmap(int argc, char *argv[])
 {
index 16f98c0c035d9847f0415367981008f04c0803d1..13af8726ac978fdb5977fc3acbe12b83cfb44046 100644 (file)
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/cstringutil.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gstat.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
@@ -63,7 +62,7 @@
 #include "copyrite.h"
 
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/programcontext.h"
 
 #ifdef GMX_DOUBLE
index 13faf8be965e79c4c2a521c47af13d2ab36635d6..79abfc3aede96dc7c98234cca1e0665940a950db 100644 (file)
 #include "gstat.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "correl.h"
 #include "gmx_ana.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/math/gmxcomplex.h"
 #include "gromacs/math/utilities.h"
 
index 11c2328b6c884522b376f2175cd5b7f3b1f206b3..0b4b1c7fc486516ab464ba8bf79e553f2550a1d1 100644 (file)
 
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "vec.h"
 #include "pbc.h"
 #include "bondf.h"
-#include "gromacs/fileio/futil.h"
-#include "xvgr.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "txtdump.h"
 #include "gromacs/statistics/statistics.h"
 #include "gstat.h"
@@ -67,7 +67,7 @@
 
 #include "gromacs/linearalgebra/nrjac.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/programcontext.h"
 
 #define e2d(x) ENM2DEBYE*(x)
index eb41e318998920a109c8c1f9b59103afc72e481a..85623881a34c3968d8e9e045efd1e06d1a440482 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "typedefs.h"
 #include "macros.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "vec.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/utility/smalloc.h"
@@ -65,7 +68,7 @@
 #include "gmx_ana.h"
 
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct {
     int  n;
index 9f9901065376dec55e7dfa39a39e60133f4c643e..d3fdbb995224fddf4b88ea273c0248b2734b3c18 100644 (file)
@@ -38,7 +38,8 @@
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
+#include <stdlib.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/fileio/strdb.h"
@@ -47,8 +48,8 @@
 #include "mshift.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/fileio/matio.h"
 #include "index.h"
 #include "gstat.h"
@@ -56,7 +57,6 @@
 #include "gromacs/fileio/trxio.h"
 #include "viewit.h"
 
-
 static int strip_dssp(char *dsspfile, int nres,
                       gmx_bool bPhobres[], real t,
                       real *acc, FILE *fTArea,
index 8d5438c3fb980ff29c877e8611eccd45b7229467..31ce324c77fa707271b912b1c7b8b8a3c2d45d83 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <stdio.h>
+
 #include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #include "gromacs/fileio/confio.h"
 #include "copyrite.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gstat.h"
 #include "macros.h"
 #include "gromacs/math/utilities.h"
 #include "index.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "correl.h"
 #include "gmx_ana.h"
 #include "gromacs/fft/fft.h"
index 5eebeb12320eae0bac99a2ff48b77554efdd08dc..ee42cbe9a9a65ae8c0c99a9ecbf58433d9f094a5 100644 (file)
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/fileio/trxio.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 int gmx_dyecoupl(int argc, char *argv[])
 {
index 65de201a1b6284567932f364b18bb7a34d93fc47..7b1b6c7a1ab2fd3f8c15915e8f78bbfd08fb10bd 100644 (file)
@@ -43,7 +43,7 @@
 #include "gromacs/utility/smalloc.h"
 #include "index.h"
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "physics.h"
 #include "gmx_ana.h"
index 28adc9e5a2f4a6f1c706b6b74f8255f0087f7ef9..b4ca3a376ac07273ffde5dc4850a1f3b25040cea 100644 (file)
@@ -63,7 +63,7 @@
 #include "rmpbc.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct
 {
index b0ad9f342eadd5d9d0658cb580608afe36ae8f55..ef2a219e541a4ce98ce3fcf99e4e2c2fac0a48b3 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <string.h>
+
 #include <math.h>
+#include <stdlib.h>
+#include <string.h>
 
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
@@ -46,7 +48,7 @@
 #include "disre.h"
 #include "names.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/enxio.h"
 #include "vec.h"
 #include "gmx_ana.h"
index f0c7730eb74f6f1373f2cdf893977bd6676745c8..694c1418f4aebd58641e06ebc9c599b293fef0b5 100644 (file)
 
 #include "gromacs/utility/cstringutil.h"
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/commandline/pargs.h"
 #include "names.h"
 #include "macros.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gstat.h"
 #include "physics.h"
 #include "gromacs/fileio/matio.h"
index 38555952e0896c1953d68a11e801dc4337a9b014..d7ad5505a9b65c42fc80a4c853adc50bf0b5d41a 100644 (file)
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
@@ -51,7 +52,7 @@
 #include "names.h"
 #include "copyrite.h"
 #include "macros.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gstat.h"
 #include "physics.h"
 #include "gromacs/fileio/tpxio.h"
index 98c4c69a5d4aed4f688be5dfc6448bb0b69893af..67e9acbf68f3476dac4c268eba87f4270d8f9e6c 100644 (file)
@@ -41,7 +41,6 @@
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
index 7e7fbfa5f923d15d79ed1694de9215b6e1bbc1dd..34cbf38a9a3c3492d3d7e35124fb25e95b62259c 100644 (file)
 #endif
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/commandline/pargs.h"
 #include "pbc.h"
 #include "force.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/math/utilities.h"
 #include "macros.h"
 #include "vec.h"
 #include "gromacs/fileio/tpxio.h"
 #include "mdrun.h"
-#include "main.h"
 #include "gromacs/random/random.h"
 #include "index.h"
 #include "mtop_util.h"
index 6257f6a6742d7f6b081e5dc79d56268455531a77..18479927897817bb62613a6dfe9b6cbeb3962c84 100644 (file)
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
-#include "gromacs/commandline/pargs.h"
 #include <string.h>
+
+#include "gromacs/commandline/pargs.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "macros.h"
 #include "vec.h"
 #include "index.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gmx_ana.h"
 
 int gmx_genpr(int argc, char *argv[])
index 9ffb8f10512e19797b723fdba28223980fbfcbbd..573a33c0962eab221a728a7bab665f82a6273f7f 100644 (file)
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "txtdump.h"
@@ -60,7 +60,7 @@
 #include "gstat.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 real calc_gyro(rvec x[], int gnx, atom_id index[], t_atom atom[], real tm,
                rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans)
index 697fb54d7c9041e5e1b94e3825f49c438f1edb69..b6a56a94bd9034b78bbaa232e6c7b7f2a1056ca2 100644 (file)
 #endif
 
 #include <math.h>
-
-#include "sysstuff.h"
 #include <string.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /****************************************************************************/
 /* This program calculates the ordering of water molecules across a box, as */
index a9b8942786282e4042d0503e49fcd67695cb66c7..7a6ef9561f056e110ec2319035e14ac016cfb98b 100644 (file)
 
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
-#include "sysstuff.h"
 #include "txtdump.h"
 #include "physics.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "index.h"
 #include "gromacs/utility/smalloc.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gstat.h"
 #include "gromacs/utility/cstringutil.h"
 #include "pbc.h"
@@ -59,7 +59,7 @@
 #include "gmx_ana.h"
 #include "geminate.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
index 78a020004815d4aac163e3af608a195c1f9f4711..a5490e110babe86307d031fef4fa64cbe36f554e 100644 (file)
 #endif
 
 #include <math.h>
+#include <string.h>
 
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "fitahx.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gstat.h"
 #include "hxprops.h"
 #include "macros.h"
 #include "index.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gmx_ana.h"
 
 int gmx_helix(int argc, char *argv[])
index 981047233635dbfe8007f3317d04e3cc8b26a245..f1b32bf0d717f2f5ad68fd23eb911ed2a5191675 100644 (file)
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/commandline/pargs.h"
 #include "vec.h"
 #include "index.h"
 #include "pbc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gstat.h"
 #include "pbc.h"
 #include "gmx_ana.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/math/do_fit.h"
 
index d9bbed9bada1b394ae047064d232bd3b46148ffb..b2909d15d323c4c7d5219c746e5c4a8caa365810 100644 (file)
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gstat.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
@@ -57,7 +56,7 @@
 #include "binsearch.h"
 #include "powerspect.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* Print name of first atom in all groups in index file */
 static void print_types(atom_id index[], atom_id a[], int ngrps,
index 3e29541e9eeda3cb426f9ed9e196542b02827d22..4e0c08bebd61d634e0a1286a45b8a6725d9c888c 100644 (file)
 #include <config.h>
 #endif
 
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "txtdump.h"
 #include "gromacs/fileio/enxio.h"
 #include "gstat.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
 
index ace4812aec2ea8696fb905111b29477df92d19ca..4d70280c4a9bb99d08c85e1924e44c3120a2712a 100644 (file)
 #include <string.h>
 #include "readinp.h"
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/matio.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "rmpbc.h"
 #include "txtdump.h"
 #include "eigio.h"
index 7c8f276f9721ecae0c9e9e40e942dfeaf27de03e..45a7e6f421a30422aadfd8948ef0e8f15c2e3f26 100644 (file)
@@ -41,8 +41,7 @@
 #include <ctype.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "macros.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/commandline/pargs.h"
@@ -53,7 +52,7 @@
 #include "vec.h"
 #include "index.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define MAXNAMES 30
 #define NAME_LEN 30
index 09900e1ff4e0dafcc67534f0c320cf13f5593c42..66bbbff6d1538245df4ad82fd28c45b9f926e544 100644 (file)
 
 #include "macros.h"
 #include "vec.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/fileio/matio.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
index 2ec58643ef35908043df659bd21c36d58905c1b3..f42e7934c793dbc3c87b5f8c32e62f480a091324 100644 (file)
 
 #include <math.h>
 #include <stdlib.h>
-
-#include "sysstuff.h"
 #include <string.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
index 9e684f300d7c22f945d9aebbe6c5d2b4b99a1e07..6715755e670114c04b87a001cea7e317871e520e 100644 (file)
@@ -43,8 +43,8 @@
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
 #include "macros.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/trxio.h"
 
 static int calc_ntype(int nft, int *ft, t_idef *idef)
index 38c4fa11439ee8deb11101120d57e5306eade527..6ad9c8fe793e2078212a27ed20e7799ddb3e8e57 100644 (file)
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gromacs/fileio/confio.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "index.h"
 #include "gmx_ana.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/trxio.h"
 
 #include "gromacs/math/do_fit.h"
index d73f262606000225400d80864de904f7c1171ba2..9570957ebaf15c5c25ac83487eb68e93408e12b5 100644 (file)
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/math/utilities.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "typedefs.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gstat.h"
 #include "gromacs/statistics/statistics.h"
 #include "gromacs/fileio/tpxio.h"
@@ -59,7 +59,7 @@
 #include "gromacs/fileio/confio.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define FACTOR  1000.0  /* Convert nm^2/ps to 10e-5 cm^2/s */
 /* NORMAL = total diffusion coefficient (default). X,Y,Z is diffusion
index 1d7d786c6dc1150be9215e2ea498d2326354fdfc..953e4eae5fc7ca2236b86a04762bb9b810c79cfb 100644 (file)
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
 #include "copyrite.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gstat.h"
 #include "txtdump.h"
 #include "eigio.h"
 #include "mtop_util.h"
 #include "physics.h"
-#include "main.h"
 #include "gmx_ana.h"
 
 #include "gromacs/linearalgebra/eigensolver.h"
index e41ca0dd41494a0095702e31118ce9e64660c8fa..c0736502a7a5310b80d52a29ac93f1865a3b5519 100644 (file)
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tpxio.h"
index 10ec827609d8e295166074f68aa8fb1e33bdd460..625f7f8f407a6384a96af5173e6ec78ce367b31d 100644 (file)
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tpxio.h"
index 98dd1865990695ba0fadb60397112ce05d23e4a4..e081648e5a47e63ac85b98e624ba4e9786ab62d3 100644 (file)
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gstat.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
@@ -58,7 +58,7 @@
 #include "cmat.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /****************************************************************************/
 /* This program calculates the order parameter per atom for an interface or */
index 3d4766ca1a3db311715affc5404faab1699e5c6c..e079ba526d44f8e12e394974ac1e2dc3be1df2fb 100644 (file)
@@ -54,7 +54,7 @@
 #include "main.h"
 #include "macros.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* We use the same defines as in mvdata.c here */
 #define  block_bc(cr,   d) gmx_bcast(     sizeof(d),     &(d), (cr))
index 41d9eaf07761fa8c5b28fd20737bfab499b95bfb..5e99951784919ed0a4cf68993659f038383666a9 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "physics.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "vec.h"
 #include "index.h"
 #include "macros.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "rmpbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
index 29fa31584bbb98ccb8df4ab23f7bb44eb72243b4..dd480a914b387f7854f36576ad871d630f6d04b7 100644 (file)
 #include <config.h>
 #endif
 
-#include <math.h>
 #include <ctype.h>
-
-#include "sysstuff.h"
+#include <math.h>
 #include <string.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "gmx_ana.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/fileio/trxio.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define EPS0 8.85419E-12
 #define ELC 1.60219E-19
index daa2425c231d8ddea331bf33dcb93994e8b6ba10..5bde12760da3645ef307b1bca5af154de74d8789 100644 (file)
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "mshift.h"
-#include "xvgr.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "txtdump.h"
index b544a6a897dbb0878ddcbc914edab0a3f583fabd..13258038794128390b987f4ac84ecda41bf09ce8 100644 (file)
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
 #include <string.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "physics.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "nrama.h"
index 22234f91cc6485c0009d21c452408c60b2c9d672..c611cc21d5411af6f1aa5738cf8235f4b0b903b0 100644 (file)
 
 #include <math.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
@@ -62,7 +62,7 @@
 #include "gmx_ana.h"
 #include "names.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void check_box_c(matrix box)
 {
index 13aeb6c807a88773a68b382568b3ee7dbaf598c3..b37459d105dfd9f9abda6beef7430f5595db8fd1 100644 (file)
 #include <config.h>
 #endif
 
-#include "gromacs/utility/smalloc.h"
 #include <math.h>
+#include <stdlib.h>
+
+#include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "typedefs.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "copyrite.h"
 #include "gromacs/commandline/pargs.h"
 #include "vec.h"
 #include "index.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "gromacs/fileio/matio.h"
index a28f241f45b269f66febead85eca4fa465c415e0..2b3ac376e681404e4a8302c31bee40701360411d 100644 (file)
@@ -52,8 +52,9 @@
 #include "macros.h"
 #include "index.h"
 #include "pbc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/matio.h"
 #include "gmx_ana.h"
 
index 97180622e4ad1935c6885fb79ad304f295a05e39..88126529c1fed892918fe931fc2c969c28a8b5b4 100644 (file)
 #include <config.h>
 #endif
 
-#include "gromacs/utility/smalloc.h"
 #include <math.h>
+
+#include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "typedefs.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gromacs/commandline/pargs.h"
 #include "vec.h"
 #include "index.h"
@@ -50,7 +52,7 @@
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "gromacs/fileio/confio.h"
index b540f38d2c3dd96fb9387c4de40b4e5256c5b379..884e591d8c5d20b1f91e3a81d05f14da4ea57855 100644 (file)
 
 #include <math.h>
 #include <string.h>
-#include "sysstuff.h"
+
 #include "physics.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "macros.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gstat.h"
 #include "vec.h"
+#include "viewit.h"
 #include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
 
index 891a3bf9f5e8d4760c35998385062c3e1491e851..05f7e715ce07924be1fefa97da054e456b309248 100644 (file)
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "rmpbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
index 90c69cdf323dd38a2a31a001267792ce41ac2689..e56491c626b7e850fe7033459ab99a7b9646151b 100644 (file)
 
 #include "macros.h"
 #include "vec.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "pbc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct {
     char *label;
index 68904bcdca163d8e3b1b3f1eda7841fe5cacd7a5..d0b64b17651de62b822cc7bb5c9332f6ac74dccd 100644 (file)
 #endif
 
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "copyrite.h"
 #include "gromacs/commandline/pargs.h"
 #include "index.h"
 #include "gmx_ana.h"
 #include "nsfactor.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
 
 int gmx_sans(int argc, char *argv[])
index 5f35524e1c8439ea7e656c480639f3a17564e927..a0fe58f6d043c09ed8557c45870fed56ca254c09 100644 (file)
 
 #include <math.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "xvgr.h"
 #include "copyrite.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/tpxio.h"
 #include "physics.h"
index 9d670c4897bb8706eb4941b82417df63a7f84a7a..4e0989174849d78756772d3a93daa4c4057f3640 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "readinp.h"
 #include "txtdump.h"
 #include "gstat.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "physics.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/matio.h"
index c002ddeb76e330fce7da214bd86f6ffa2482bbc5..d6fe0b7187a24ed7e20f9d886cd22a6ddd75d23f 100644 (file)
 #include <config.h>
 #endif
 
-#include <stdio.h>
 #include <math.h>
+#include <stdio.h>
 
 #include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gromacs/fileio/pdbio.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
index 8ad45f3f3880112267b873f2ba884a7f70e3c874..ab037919d4ba290929407d959c7b9e800e310bf5 100644 (file)
 #include "gromacs/utility/smalloc.h"
 #include "gstat.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
 #include "gmx_ana.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
                          atom_id index[], rvec xref, gmx_bool bPBC)
index 32d2fefc36a505d920248932576fae3736b94d4d..7e881f4e226dd1aff74369953427d7ba99314555 100644 (file)
@@ -36,7 +36,8 @@
 #include <config.h>
 #endif
 
-
+#include <math.h>
+#include <stdlib.h>
 
 #include "gromacs/commandline/pargs.h"
 #include "typedefs.h"
 #include "vec.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include <math.h>
 #include "index.h"
 #include "pbc.h"
 #include "rmpbc.h"
 #include "gmx_ana.h"
 #include "macros.h"
 
-
 static const double bohr = 0.529177249;  /* conversion factor to compensate for VMD plugin conversion... */
 
-static void mequit(void)
-{
-    printf("Memory allocation error\n");
-    exit(1);
-}
-
 int gmx_spatial(int argc, char *argv[])
 {
     const char     *desc[] = {
@@ -218,25 +211,13 @@ int gmx_spatial(int argc, char *argv[])
         MINBIN[i] -= (double)iNAB*rBINWIDTH;
         nbin[i]    = (long)ceil((MAXBIN[i]-MINBIN[i])/rBINWIDTH);
     }
-    bin = (long ***)malloc(nbin[XX]*sizeof(long **));
-    if (!bin)
-    {
-        mequit();
-    }
+    snew(bin, nbin[XX]);
     for (i = 0; i < nbin[XX]; ++i)
     {
-        bin[i] = (long **)malloc(nbin[YY]*sizeof(long *));
-        if (!bin[i])
-        {
-            mequit();
-        }
+        snew(bin[i], nbin[YY]);
         for (j = 0; j < nbin[YY]; ++j)
         {
-            bin[i][j] = (long *)calloc(nbin[ZZ], sizeof(long));
-            if (!bin[i][j])
-            {
-                mequit();
-            }
+            snew(bin[i][j], nbin[ZZ]);
         }
     }
     copy_mat(box, box_pbc);
index b4734d79d50d597dca24575ee180c1596eb22b40..d2277e56628b65fd5765aa84cce2f6dad73139dd 100644 (file)
@@ -43,7 +43,8 @@
 #include "gromacs/utility/smalloc.h"
 #include "gstat.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
 #include "index.h"
 #include "gromacs/fileio/tpxio.h"
@@ -51,7 +52,7 @@
 #include "physics.h"
 #include "gmx_ana.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
                          atom_id index[], rvec xref, int ePBC)
index 15738d8c4fbce2b48742d28e6df2fcd8844ffa42..6086a5b47dd8728f7aa1c8d14f77ec348fc59487 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <stdio.h>
 
 #include <math.h>
+#include <stdio.h>
+#include <string.h>
+
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gstat.h"
 #include "macros.h"
 #include "gromacs/math/utilities.h"
 #include "index.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "pbc.h"
 #include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
index 29f1bd49c329cd940e231d8f4181ddc5ae78e680..814dda66eea600709edd5d2e9f387484aed89d5c 100644 (file)
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
 #include "rmpbc.h"
@@ -59,7 +61,7 @@
 #include "gmx_ana.h"
 
 #include "gromacs/linearalgebra/nrjac.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void low_print_data(FILE *fp, real time, rvec x[], int n, atom_id *index,
                            gmx_bool bDim[], const char *sffmt)
index 629f221d0b6dc4ad02fb2d560860845d9e0587a6..3cef9b92ea3abf37378f65dc5f571d125a9446d1 100644 (file)
 #include <config.h>
 #endif
 
-#include <string.h>
 #include <math.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macros.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "gromacs/fileio/gmxfio.h"
@@ -51,7 +52,7 @@
 #include "gromacs/fileio/tngio.h"
 #include "gromacs/fileio/tngio_for_tools.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/confio.h"
 #include "names.h"
 #include "gromacs/fileio/xtcio.h"
 #include "rmpbc.h"
 #include "pbc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gmx_ana.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define TIME_EXPLICIT 0
 #define TIME_CONTINUE 1
index 48f4560bd1bf85f463caf40d36e8aa4c55c2e883..041959c9973bf251024adf05674ce8c292190d32 100644 (file)
 #include <config.h>
 #endif
 
-#include <string.h>
 #include <math.h>
+#include <stdlib.h>
+#include <string.h>
 
 #include "copyrite.h"
 #include "macros.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "gromacs/fileio/gmxfio.h"
@@ -52,7 +52,7 @@
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/tngio_for_tools.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/confio.h"
 #include "names.h"
 #include "rmpbc.h"
 #include "pbc.h"
 #include "viewit.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gmx_ana.h"
 
 #include "gromacs/math/do_fit.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 6b357e1b801515098dcaab03cdb253c60cc5cc86..98638cdd74456d223cb45afa638ade014014dff3 100644 (file)
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "princ.h"
 #include "rmpbc.h"
 #include "txtdump.h"
@@ -58,7 +59,7 @@
 #include "gromacs/fileio/trxio.h"
 #include "gmx_ana.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct {
     atom_id i;
index e76d32518e287bfa7ab09d4ef908358f4429aa4b..9090d1acfd6005eec338da81b7aa54ca18481061 100644 (file)
@@ -36,6 +36,7 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <time.h>
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
@@ -60,7 +61,7 @@
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/math/utilities.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* Enum for situations that can occur during log file parsing, the
  * corresponding string entries can be found in do_the_tests() in
@@ -143,29 +144,6 @@ static void cleandata(t_perf *perfdata, int test_nr)
 }
 
 
-static gmx_bool is_equal(real a, real b)
-{
-    real diff, eps = 1.0e-7;
-
-
-    diff = a - b;
-
-    if (diff < 0.0)
-    {
-        diff = -diff;
-    }
-
-    if (diff < eps)
-    {
-        return TRUE;
-    }
-    else
-    {
-        return FALSE;
-    }
-}
-
-
 static void remove_if_exists(const char *fn)
 {
     if (gmx_fexist(fn))
@@ -553,8 +531,9 @@ static gmx_bool analyze_data(
     fprintf(fp, "\n");
 
     /* Only mention settings if they were modified: */
-    bRefinedCoul = !is_equal(info->rcoulomb[k_win], info->rcoulomb[0]);
-    bRefinedVdW  = !is_equal(info->rvdw[k_win], info->rvdw[0]    );
+    bRefinedCoul = !gmx_within_tol(info->rcoulomb[k_win], info->rcoulomb[0], GMX_REAL_EPS);
+    bRefinedCoul = !gmx_within_tol(info->rcoulomb[k_win], info->rcoulomb[0], GMX_REAL_EPS);
+    bRefinedVdW  = !gmx_within_tol(info->rvdw[k_win], info->rvdw[0], GMX_REAL_EPS);
     bRefinedGrid = !(info->nkx[k_win] == info->nkx[0] &&
                      info->nky[k_win] == info->nky[0] &&
                      info->nkz[k_win] == info->nkz[0]);
@@ -981,11 +960,11 @@ static void make_benchmark_tprs(
         {
             /* Determine which Coulomb radii rc to use in the benchmarks */
             add = (rmax-rmin)/(*ntprs-1);
-            if (is_equal(rmin, info->rcoulomb[0]))
+            if (gmx_within_tol(rmin, info->rcoulomb[0], GMX_REAL_EPS))
             {
                 ir->rcoulomb = rmin + j*add;
             }
-            else if (is_equal(rmax, info->rcoulomb[0]))
+            else if (gmx_within_tol(rmax, info->rcoulomb[0], GMX_REAL_EPS))
             {
                 ir->rcoulomb = rmin + (j-1)*add;
             }
@@ -1082,8 +1061,8 @@ static void make_benchmark_tprs(
         fprintf(fp, "  %-14s\n", fn_bench_tprs[j]);
 
         /* Make it clear to the user that some additional settings were modified */
-        if (!is_equal(ir->rvdw, info->rvdw[0])
-            || !is_equal(ir->rlistlong, info->rlistlong[0]) )
+        if (!gmx_within_tol(ir->rvdw, info->rvdw[0], GMX_REAL_EPS)
+            || !gmx_within_tol(ir->rlistlong, info->rlistlong[0], GMX_REAL_EPS) )
         {
             bNote = TRUE;
         }
@@ -1645,13 +1624,13 @@ static void check_input(
     /* Add test scenarios if rmin or rmax were set */
     if (*ntprs <= 2)
     {
-        if (!is_equal(*rmin, rcoulomb) && (*ntprs == 1) )
+        if (!gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) && (*ntprs == 1) )
         {
             (*ntprs)++;
             fprintf(stderr, "NOTE: Setting -rmin to %g changed -ntpr to %d\n",
                     *rmin, *ntprs);
         }
-        if (!is_equal(*rmax, rcoulomb) && (*ntprs == 1) )
+        if (!gmx_within_tol(*rmax, rcoulomb, GMX_REAL_EPS) && (*ntprs == 1) )
         {
             (*ntprs)++;
             fprintf(stderr, "NOTE: Setting -rmax to %g changed -ntpr to %d\n",
@@ -1660,13 +1639,13 @@ static void check_input(
     }
     old = *ntprs;
     /* If one of rmin, rmax is set, we need 2 tpr files at minimum */
-    if (!is_equal(*rmax, rcoulomb) || !is_equal(*rmin, rcoulomb) )
+    if (!gmx_within_tol(*rmax, rcoulomb, GMX_REAL_EPS) || !gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) )
     {
         *ntprs = max(*ntprs, 2);
     }
 
     /* If both rmin, rmax are set, we need 3 tpr files at minimum */
-    if (!is_equal(*rmax, rcoulomb) && !is_equal(*rmin, rcoulomb) )
+    if (!gmx_within_tol(*rmax, rcoulomb, GMX_REAL_EPS) && !gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) )
     {
         *ntprs = max(*ntprs, 3);
     }
@@ -1678,7 +1657,7 @@ static void check_input(
 
     if (*ntprs > 1)
     {
-        if (is_equal(*rmin, rcoulomb) && is_equal(rcoulomb, *rmax)) /* We have just a single rc */
+        if (gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) && gmx_within_tol(rcoulomb, *rmax, GMX_REAL_EPS)) /* We have just a single rc */
         {
             fprintf(stderr, "WARNING: Resetting -ntpr to 1 since no Coulomb radius scaling is requested.\n"
                     "Please set rmin < rmax to test Coulomb radii in the [rmin, rmax] interval\n"
index e3f14fa84fa94deca5bf347e6039391ae87c9dc7..eb13aa1883f0ac107f7afc6c2072ad12171278d9 100644 (file)
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/math/utilities.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "typedefs.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gstat.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
index 77fe30fc3a0dad877bacc0708b4d3c7067f21b5b..72440bbdb0f146db11569a1b76ced583797238c0 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <stdio.h>
+
 #include <math.h>
+#include <stdio.h>
+#include <string.h>
 
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gstat.h"
 #include "macros.h"
 #include "gromacs/math/utilities.h"
 #include "index.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gmx_ana.h"
 #include "gromacs/fft/fft.h"
 #include "gromacs/fileio/trxio.h"
index 6e63e7a5c0372dfb6035c40f218e61c87dbf5538..817213c459d51b81faf98a2b30890f73ac0ed258 100644 (file)
@@ -63,9 +63,9 @@
 #include "gmx_ana.h"
 #include "macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 //! longest file names allowed in input files
 #define WHAM_MAXFILELEN 2048
index d33ebf1abb97f20850c8e1fe4ab65deb113729f3..549568317646d9a18524bb85b8c2bfc7b35153f1 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "physics.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
-#include "xvgr.h"
 #include "pbc.h"
 #include "pbc.h"
 #include "index.h"
 #include "gstat.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gmx_ana.h"
 
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/strdb.h"
 #include "gromacs/fileio/writeps.h"
 
index 064e667c3c4806806378c1011f6440aae18874f3..9c3ae9b00df399c482d811c83792c382161f0d1d 100644 (file)
 #include <math.h>
 #include "typedefs.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "viewit.h"
 #include "gmx_ana.h"
 
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/writeps.h"
index ee949e9c4db9ae5c2e7461181976ae7250e06882..531aa92c3fc4f6dad9db1c610887242247bc20fd 100644 (file)
@@ -50,7 +50,7 @@
 #include "gromacs/utility/smalloc.h"
 #include "bondf.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 real ellipticity(int nres, t_bb bb[])
 {
index e20501f7df862fff4bd2ab67b033f9be9cadede3..1a4145892981b6eea1c7d2f83b3d250af060134c 100644 (file)
 #include <config.h>
 #endif
 
-#include "nrama.h"
 #include <math.h>
-#include "sysstuff.h"
+#include <stdlib.h>
+
+#include "nrama.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "bondf.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "rmpbc.h"
 
 static const char *pp_pat[] = { "C", "N", "CA", "C", "N" };
index 4b15a573c91f7ef6cec75ec8e0b59e7b66294e90..e5a17e5d8b97a4ec9c895c5f7d7bc215c87e62bc 100644 (file)
 
 #include <string.h>
 
-#include "gromacs/random/random.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "vec.h"
 #include "nsfactor.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/strdb.h"
-#include "gmx_fatal.h"
+#include "gromacs/random/random.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 void check_binwidth(real binwidth)
 {
index de47f1aa7ad2880dd5c159d7fcb97bc06892ffba..4b739cc29f7c24235f61dad374a95076554ad390 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include <math.h>
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gstat.h"
 
 real LegendreP(real x, unsigned long m)
index 06e7d94caec5060d51609446ea6d4de20e574489..571646f259be7884944c57959775ad3566de8dd6 100644 (file)
@@ -39,8 +39,8 @@
 
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "interf.h"
 #include "powerspect.h"
 
@@ -73,7 +73,6 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
 /*Prepare data structures for FFT, with time averaging of power spectrum*/
     if ( (status = gmx_fft_init_2d_real(&fftp, xbins, ybins, GMX_FFT_FLAG_NONE) ) != 0)
     {
-        free(fftp);
         gmx_fatal(status, __FILE__, __LINE__, "Error allocating FFT");
     }
 
@@ -113,8 +112,8 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
     gmx_ffclose(datfile1);
     gmx_ffclose(datfile2);
 
-    free(ftspect1);
-    free(ftspect2);
+    sfree(ftspect1);
+    sfree(ftspect2);
 
 }
 
index 85e29ac4eb8f10c3d4c00e5f63ba1b0d9e6afc7c..fea240e9e351cb2eb1554b212dcbec6600cf04c6 100644 (file)
 #include <stdlib.h>
 #include <math.h>
 #include "typedefs.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "macros.h"
 #include "physics.h"
 #include "gromacs/utility/smalloc.h"
 #include "gstat.h"
 #include "gromacs/fileio/matio.h"
 #include "copyrite.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct {
     int    nx, ny;
index c899adceaaa26a54b51da4eb97a5233d432c7ee2..aeba61ce9b4b5673fa04b551e84f5173e255b39e 100644 (file)
 #include <ctype.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "atomprop.h"
 #include "macros.h"
 #include "index.h"
 #include "copyrite.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/strdb.h"
 #include "gromacs/math/utilities.h"
 
index 6d696e93f7ade05a3c9d51543dcef58109ea999e..0cfdafe0efd374e01cad1fb44eeda5eb734bbf2c 100644 (file)
@@ -50,9 +50,8 @@
 #include "ns.h"
 #include "macros.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "mshift.h"
-#include "main.h"
 #include "disre.h"
 #include "orires.h"
 #include "force.h"
index 3d1e70d909ef0bb0932bbd80df9cd12976c46120..f9f16ccff19f7f74893a3f64aaecf1d3e15fb70c 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "calcgrid.h"
 
 /* The grid sizes below are based on timing of a 3D cubic grid in fftw
index 397ab2dba87f198807e7fb6b4141b67e3ff8deb6..b28411a5dce96514e6efcb4edd442738d523fe77 100644 (file)
@@ -44,7 +44,7 @@
 #include "vec.h"
 #include "physics.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define xAI xa[0]
 #define xAJ xa[1]
index 93df8e1a1d9587037fa45c8f4ed4f10f8f3ac9df..83aad0d9a0b880d8c2370eab466889b074cfdafd 100644 (file)
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "vec.h"
 #include "pbc.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "chargegroup.h"
 
 
index 1dd000c09eb9573876d7cffe64693afd91e9864f..3651f026ee0e1e1c164dbc8310fa53d88cb8cfce 100644 (file)
 #include <config.h>
 #endif
 
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
+#include <fcntl.h>
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 #include "vec.h"
 #include "network.h"
 #include "checkpoint.h"
-#include "main.h"
 #include "gromacs/utility/cstringutil.h"
-#include <fcntl.h>
 
 #include "gromacs/fileio/filenm.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xdrf.h"
 #include "gromacs/fileio/xdr_datatype.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/baseversion.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #include "buildinfo.h"
 
index 77ca8d35720972a0c37f11ead5277cf3423ffbd5..429764eecc47814f0eba188ae28f9f9f9ee33cf0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,8 +42,8 @@
 
 struct gmx_invsqrtdata
 {
-    unsigned int    exptab[256];    /*!< Exponential lookup table */
-    unsigned int    fracttab[4096]; /*!< Mantissa lookup table    */
+    unsigned int    exptab[256];    /**< Exponential lookup table */
+    unsigned int    fracttab[4096]; /**< Mantissa lookup table    */
 };
 
 
index dfc50b90d6c34171de9cbcca438744822b8d634b..04012442d7043a1ea5a1080da2ca4c1dc5162e63 100644 (file)
 #include "gromacs/legacyheaders/vec.h"
 
 #include "gromacs/fft/fft.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/strdb.h"
 #include "gromacs/random/random.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
index 2cccc16c6714da4ead8366567f5d4089529decc3..b48dc29d701bc30f1142aee0be3d90ad6e3c730a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,7 @@
 
 #include <stdio.h>
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* CUDA library and hardware related defines */
 /* TODO list some constants instead that can be used for consistency checks to
index 8c6b2cb8d438f3d0a90d2b92a90c0342424866c1..50ffadad74ce07654ab4490bbcaf3f4f9b6a8d81 100644 (file)
@@ -38,6 +38,8 @@
 #include "cudautils.cuh"
 #include "pmalloc_cuda.h"
 
+#include "gromacs/utility/cstringutil.h"
+
 /*! Allocates nbytes of page-locked memory.
  *  This memory should always be freed using pfree (or with the page-locked
  *  free functions provied by the CUDA library).
index 061521d9f218c6ed4c6766fcf01866ec7001ec42..f8dd337a5a819316ec97ff47e58c780ffcb4b606 100644 (file)
 #endif
 
 #include <math.h>
+#include <stdlib.h>
+
 #include "typedefs.h"
 #include "types/commrec.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "xvgr.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "bondf.h"
 #include "copyrite.h"
 #include "disre.h"
index b6af0d607b11b4d92bb2851d7ddc6183be666d0f..83ac5891ad7fbac4ea49ad15aeeb8ba94bee1926 100644 (file)
@@ -48,7 +48,7 @@
 #include "gromacs/utility/smalloc.h"
 #include "physics.h"
 #include "txtdump.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "names.h"
 #include "macros.h"
 
index 9aa1105bb3193e79912e57e8aa9b45e714356b6f..f3400d33818bb3ff6144addc0c2e9b3f77df7e0e 100644 (file)
@@ -36,8 +36,9 @@
 #include <config.h>
 #endif
 
-#include <stdlib.h>
 #include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 
 #ifdef HAVE_UNISTD_H
 #include "types/enums.h"
 #include "types/hw_info.h"
 #include "types/commrec.h"
-#include "gmx_fatal.h"
-#include "gmx_fatal_collective.h"
+#include "network.h"
 #include "md_logging.h"
 #include "gmx_cpuid.h"
-#include "gromacs/utility/smalloc.h"
 #include "gpu_utils.h"
 #include "copyrite.h"
 #include "gmx_detect_hardware.h"
-#include "main.h"
 #include "md_logging.h"
-#include "gromacs/utility/gmxomp.h"
+
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 #include "thread_mpi/threads.h"
 
index 4ba916002121835a6d233733a882f79c080c5121..65d1f1bcbf82e4fc607a0a0afdcebdd2ffcbc20e 100644 (file)
 #include <config.h>
 #endif
 
-#include "gmx_fatal.h"
 #include "typedefs.h"
+#include "types/commrec.h"
 #include "macros.h"
 #include "network.h"
 #include "copyrite.h"
 #include "gmx_omp_nthreads.h"
 #include "md_logging.h"
 
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
 
 /** Structure with the number of threads for each OpenMP multi-threaded
index 9752fb0295c6c4066b9b8cb8c6ee6111c98fba28..02363e230502374b1088b3dca026a22c8fe0a731 100644 (file)
 #include "md_logging.h"
 #include "gmx_thread_affinity.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 static int
 get_thread_affinity_layout(FILE *fplog,
@@ -368,18 +371,53 @@ gmx_set_thread_affinity(FILE                *fplog,
  * Note that this will only work on Linux as we use a GNU feature.
  */
 void
-gmx_check_thread_affinity_set(FILE            gmx_unused *fplog,
-                              const t_commrec gmx_unused *cr,
-                              gmx_hw_opt_t    gmx_unused *hw_opt,
-                              int             gmx_unused  ncpus,
-                              gmx_bool        gmx_unused  bAfterOpenmpInit)
+gmx_check_thread_affinity_set(FILE            *fplog,
+                              const t_commrec *cr,
+                              gmx_hw_opt_t    *hw_opt,
+                              int  gmx_unused  ncpus,
+                              gmx_bool         bAfterOpenmpInit)
 {
 #ifdef HAVE_SCHED_GETAFFINITY
     cpu_set_t mask_current;
     int       i, ret, cpu_count, cpu_set;
     gmx_bool  bAllSet;
+#endif
 
     assert(hw_opt);
+    if (!bAfterOpenmpInit)
+    {
+        /* Check for externally set OpenMP affinity and turn off internal
+         * pinning if any is found. We need to do this check early to tell
+         * thread-MPI whether it should do pinning when spawning threads.
+         * TODO: the above no longer holds, we should move these checks later
+         */
+        if (hw_opt->thread_affinity != threadaffOFF)
+        {
+            char *message;
+            if (!gmx_omp_check_thread_affinity(&message))
+            {
+                /* TODO: with -pin auto we should only warn when using all cores */
+                md_print_warn(cr, fplog, "%s", message);
+                sfree(message);
+                hw_opt->thread_affinity = threadaffOFF;
+            }
+        }
+
+        /* With thread-MPI this is needed as pinning might get turned off,
+         * which needs to be known before starting thread-MPI.
+         * With thread-MPI hw_opt is processed here on the master rank
+         * and passed to the other ranks later, so we only do this on master.
+         */
+        if (!SIMMASTER(cr))
+        {
+            return;
+        }
+#ifndef GMX_THREAD_MPI
+        return;
+#endif
+    }
+
+#ifdef HAVE_SCHED_GETAFFINITY
     if (hw_opt->thread_affinity == threadaffOFF)
     {
         /* internal affinity setting is off, don't bother checking process affinity */
index d626214d5cfee2055eb4ed53757c4b38629b4558..16a9dd964ee120c99addb591fb34ddf711d03826 100644 (file)
 #include <stdlib.h>
 #include <assert.h>
 
-#include "gromacs/utility/smalloc.h"
 #include "types/hw_info.h"
 
 #include "gpu_utils.h"
 #include "../cuda_tools/cudautils.cuh"
 #include "memtestG80_core.h"
 
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
+
 /** Amount of memory to be used in quick memtest. */
 #define QUICK_MEM       250
 /** Bit flag with type of tests to run in quick memtest. */
index 1ac6062a0b12652b029106200c1a2d3b8e91dd7f..5557c157f52c7b2b1c1b9c19f96edd049d6ee937 100644 (file)
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
-#include <assert.h>
-#include "sysstuff.h"
+
 #include "macros.h"
 #include "names.h"
-#include "gromacs/utility/cstringutil.h"
-#include "main.h"
 #include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
 #include "invblock.h"
 #include "macros.h"
 #include "index.h"
 #include "txtdump.h"
 
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/strdb.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 const char gmx_residuetype_undefined[] = "Other";
 
index 1ba89ef3aa71f9a140f550dacd0c49bf60f05e67..c600bd189d5304803ee0aab15c80fec302ca2989 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "macros.h"
 #include "inputrec.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 /* The minimum number of integration steps required for reasonably accurate
index 235a1f6c2a4768c9b35fefb5ead9e16bf908e1ea..0d9326e3ee41894d6802fa1207ac8a105b83847a 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "invblock.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 atom_id *make_invblock(const t_block *block, int nr)
 {
index 170c606ac69f89bc35705254ca6919b886e4f0e9..5b6a658bf53ad4b490ad41852f6578f56687a6c3 100644 (file)
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef GMX_NATIVE_WINDOWS
+#include <process.h>
+#endif
 
-#include "gromacs/utility/smalloc.h"
 #include "types/commrec.h"
-#include "gmx_fatal.h"
 #include "network.h"
 #include "main.h"
 #include "macros.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "gromacs/utility/cstringutil.h"
 #include "copyrite.h"
 
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
 
 /* The source code in this file should be thread-safe.
          Please keep it that way. */
 
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef GMX_NATIVE_WINDOWS
-#include <process.h>
-#endif
-
 #define BUFSIZE 1024
 
-
 static void par_fn(char *base, int ftp, const t_commrec *cr,
                    gmx_bool bAppendSimId, gmx_bool bAppendNodeId,
                    char buf[], int bufsize)
@@ -223,26 +220,6 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
 }
 
 
-int gmx_gethostname(char *name, size_t len)
-{
-    if (len < 8)
-    {
-        gmx_incons("gmx_gethostname called with len<8");
-    }
-#if defined(HAVE_UNISTD_H) && !defined(__native_client__)
-    if (gethostname(name, len-1) != 0)
-    {
-        strncpy(name, "unknown", 8);
-        return -1;
-    }
-    return 0;
-#else
-    strncpy(name, "unknown", 8);
-    return -1;
-#endif
-}
-
-
 void gmx_log_open(const char *lognm, const t_commrec *cr, gmx_bool bMasterOnly,
                   gmx_bool bAppendFiles, FILE** fplog)
 {
index 6b6ad831a216389af6ef77e2d2aa5557b398382f..0918cff50a2d04ab973cd4c9f2e2f1c51351ce23 100644 (file)
 
 #include <string.h>
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "mshift.h"
-#include "main.h"
 #include "pbc.h"
 
 /************************************************************
index 83c615634ea71e672df443ae5ac7fb5d144d4c93..7fd56a6e19c9cb6c20e513af6d6ab6cc5a4d6d9f 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "mtop_util.h"
 #include "topsort.h"
 #include "symtab.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static int gmx_mtop_maxresnr(const gmx_mtop_t *mtop, int maxres_renum)
 {
index 62b88991556b53c4ed3f7f836941cec56736f78b..329631ae26e76bc411c26cbfe9dc103bab826802 100644 (file)
@@ -47,7 +47,7 @@
 #include "types/commrec.h"
 #include "network.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "symtab.h"
 #include "vec.h"
 #include "tgroup.h"
index 346f8cff30f38f83e0a30b72a7770684b74dda6f..b683c97ec459bc03d33cdffdf5d6636c476a1e97 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#include "network.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdlib.h>
 #include <string.h>
-#include "gmx_fatal.h"
-#include "main.h"
-#include "gromacs/utility/smalloc.h"
+
 #include "types/commrec.h"
-#include "network.h"
 #include "copyrite.h"
-#include <ctype.h>
 #include "macros.h"
-#include "gromacs/utility/cstringutil.h"
 
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxmpi.h"
-
+#include "gromacs/utility/smalloc.h"
 
 /* The source code in this file should be thread-safe.
       Please keep it that way. */
 
-gmx_bool gmx_mpi_initialized(void)
-{
-    int n;
-#ifndef GMX_MPI
-    return 0;
-#else
-    MPI_Initialized(&n);
-
-    return n;
-#endif
-}
-
 void gmx_fill_commrec_from_mpi(t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
@@ -144,161 +136,6 @@ t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
 #endif
 }
 
-int  gmx_node_num(void)
-{
-#ifndef GMX_MPI
-    return 1;
-#else
-    int i;
-    (void) MPI_Comm_size(MPI_COMM_WORLD, &i);
-    return i;
-#endif
-}
-
-int gmx_node_rank(void)
-{
-#ifndef GMX_MPI
-    return 0;
-#else
-    int i;
-    (void) MPI_Comm_rank(MPI_COMM_WORLD, &i);
-    return i;
-#endif
-}
-
-#if defined GMX_LIB_MPI && defined GMX_TARGET_BGQ
-#include <spi/include/kernel/location.h>
-#endif
-
-int gmx_physicalnode_id_hash(void)
-{
-    int hash_int;
-
-#ifndef GMX_LIB_MPI
-    /* We have a single physical node */
-    hash_int = 0;
-#else
-    int  resultlen;
-    char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
-
-    /* This procedure can only differentiate nodes with different names.
-     * Architectures where different physical nodes have identical names,
-     * such as IBM Blue Gene, should use an architecture specific solution.
-     */
-    MPI_Get_processor_name(mpi_hostname, &resultlen);
-
-    /* The string hash function returns an unsigned int. We cast to an int.
-     * Negative numbers are converted to positive by setting the sign bit to 0.
-     * This makes the hash one bit smaller.
-     * A 63-bit hash (with 64-bit int) should be enough for unique node hashes,
-     * even on a million node machine. 31 bits might not be enough though!
-     */
-    hash_int =
-        (int)gmx_string_fullhash_func(mpi_hostname, gmx_string_hash_init);
-    if (hash_int < 0)
-    {
-        hash_int -= INT_MIN;
-    }
-#endif
-
-    return hash_int;
-}
-
-/* TODO: this function should be fully replaced by gmx_physicalnode_id_hash */
-int gmx_hostname_num()
-{
-#ifndef GMX_MPI
-    return 0;
-#else
-#ifdef GMX_THREAD_MPI
-    /* thread-MPI currently puts the thread number in the process name,
-     * we might want to change this, as this is inconsistent with what
-     * most MPI implementations would do when running on a single node.
-     */
-    return 0;
-#else
-    int  resultlen, hostnum, i, j;
-    char mpi_hostname[MPI_MAX_PROCESSOR_NAME], hostnum_str[MPI_MAX_PROCESSOR_NAME];
-
-    MPI_Get_processor_name(mpi_hostname, &resultlen);
-#ifdef GMX_TARGET_BGQ
-    Personality_t personality;
-    Kernel_GetPersonality(&personality, sizeof(personality));
-    /* Each MPI rank has a unique coordinate in a 6-dimensional space
-       (A,B,C,D,E,T), with dimensions A-E corresponding to different
-       physical nodes, and T within each node. Each node has sixteen
-       physical cores, each of which can have up to four hardware
-       threads, so 0 <= T <= 63 (but the maximum value of T depends on
-       the confituration of ranks and OpenMP threads per
-       node). However, T is irrelevant for computing a suitable return
-       value for gmx_hostname_num().
-     */
-    hostnum  = personality.Network_Config.Acoord;
-    hostnum *= personality.Network_Config.Bnodes;
-    hostnum += personality.Network_Config.Bcoord;
-    hostnum *= personality.Network_Config.Cnodes;
-    hostnum += personality.Network_Config.Ccoord;
-    hostnum *= personality.Network_Config.Dnodes;
-    hostnum += personality.Network_Config.Dcoord;
-    hostnum *= personality.Network_Config.Enodes;
-    hostnum += personality.Network_Config.Ecoord;
-#else
-    /* This procedure can only differentiate nodes with host names
-     * that end on unique numbers.
-     */
-    i = 0;
-    j = 0;
-    /* Only parse the host name up to the first dot */
-    while (i < resultlen && mpi_hostname[i] != '.')
-    {
-        if (isdigit(mpi_hostname[i]))
-        {
-            hostnum_str[j++] = mpi_hostname[i];
-        }
-        i++;
-    }
-    hostnum_str[j] = '\0';
-    if (j == 0)
-    {
-        hostnum = 0;
-    }
-    else
-    {
-        /* Use only the last 9 decimals, so we don't overflow an int */
-        hostnum = strtol(hostnum_str + max(0, j-9), NULL, 10);
-    }
-#endif
-
-    if (debug)
-    {
-        fprintf(debug, "In gmx_hostname_num: hostname '%s', hostnum %d\n",
-                mpi_hostname, hostnum);
-#ifdef GMX_TARGET_BGQ
-        fprintf(debug,
-                "Torus ID A: %d / %d B: %d / %d C: %d / %d D: %d / %d E: %d / %d\nNode ID T: %d / %d core: %d / %d hardware thread: %d / %d\n",
-                personality.Network_Config.Acoord,
-                personality.Network_Config.Anodes,
-                personality.Network_Config.Bcoord,
-                personality.Network_Config.Bnodes,
-                personality.Network_Config.Ccoord,
-                personality.Network_Config.Cnodes,
-                personality.Network_Config.Dcoord,
-                personality.Network_Config.Dnodes,
-                personality.Network_Config.Ecoord,
-                personality.Network_Config.Enodes,
-                Kernel_ProcessorCoreID(),
-                16,
-                Kernel_ProcessorID(),
-                64,
-                Kernel_ProcessorThreadID(),
-                4);
-#endif
-    }
-    return hostnum;
-#endif
-#endif
-}
-
 void gmx_setup_nodecomm(FILE gmx_unused *fplog, t_commrec *cr)
 {
     gmx_nodecomm_t *nc;
@@ -481,33 +318,6 @@ void gmx_barrier(const t_commrec gmx_unused *cr)
 #endif
 }
 
-void gmx_abort(int gmx_unused noderank, int gmx_unused nnodes, int gmx_unused errorno)
-{
-#ifndef GMX_MPI
-    gmx_call("gmx_abort");
-#else
-#ifdef GMX_THREAD_MPI
-    fprintf(stderr, "Halting program %s\n", ShortProgram());
-    gmx_thanx(stderr);
-    exit(1);
-#else
-    if (nnodes > 1)
-    {
-        fprintf(stderr, "Halting parallel program %s on CPU %d out of %d\n",
-                ShortProgram(), noderank, nnodes);
-    }
-    else
-    {
-        fprintf(stderr, "Halting program %s\n", ShortProgram());
-    }
-
-    gmx_thanx(stderr);
-    MPI_Abort(MPI_COMM_WORLD, errorno);
-    exit(1);
-#endif
-#endif
-}
-
 void gmx_bcast(int gmx_unused nbytes, void gmx_unused *b, const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
@@ -889,3 +699,47 @@ void gmx_sumli_sim(int gmx_unused nr, gmx_int64_t gmx_unused r[], const gmx_mult
 #endif
 #endif
 }
+
+gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr)
+{
+    gmx_bool bExist;
+
+    if (SIMMASTER(cr))
+    {
+        bExist = gmx_fexist(fname);
+    }
+    if (PAR(cr))
+    {
+        gmx_bcast(sizeof(bExist), &bExist, cr);
+    }
+    return bExist;
+}
+
+void gmx_fatal_collective(int f_errno, const char *file, int line,
+                          const t_commrec *cr, gmx_domdec_t *dd,
+                          const char *fmt, ...)
+{
+    va_list  ap;
+    gmx_bool bMaster, bFinalize;
+#ifdef GMX_MPI
+    int      result;
+    /* Check if we are calling on all processes in MPI_COMM_WORLD */
+    if (cr != NULL)
+    {
+        MPI_Comm_compare(cr->mpi_comm_mysim, MPI_COMM_WORLD, &result);
+    }
+    else
+    {
+        MPI_Comm_compare(dd->mpi_comm_all, MPI_COMM_WORLD, &result);
+    }
+    /* Any result except MPI_UNEQUAL allows us to call MPI_Finalize */
+    bFinalize = (result != MPI_UNEQUAL);
+#else
+    bFinalize = TRUE;
+#endif
+    bMaster = (cr != NULL && MASTER(cr)) || (dd != NULL && DDMASTER(dd));
+
+    va_start(ap, fmt);
+    gmx_fatal_mpi_va(f_errno, file, line, bMaster, bFinalize, fmt, ap);
+    va_end(ap);
+}
index 4ed5663833054212993d9d897eb59ac7bb0614d9..fe4bd270fc851f0d23a033d572b5915bea3c95d0 100644 (file)
@@ -48,7 +48,7 @@
 #include "macros.h"
 #include "nb_free_energy.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 void
 gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
index 4f29311deaa61d044f465093dd9dd9c998e0639a..db837244eae392545f61160b56f6a97feb175c34 100644 (file)
@@ -46,7 +46,7 @@
 #include "nb_generic.h"
 #include "nrnb.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #include "nonbonded.h"
 #include "nb_kernel.h"
index 10b687b020b39713f5c25c59537ab4471dc798f5..97873b8498bcdde739763c607c905e4e4f0b5976 100644 (file)
@@ -46,7 +46,7 @@
 #include "nb_generic_adress.h"
 #include "nrnb.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #include "nonbonded.h"
 #include "nb_kernel.h"
index 61198647eab34d78b89c3f6d1fee08a31bfa197a..6d1cfae43548242f0a0ca2927c2b86e6953ab01b 100644 (file)
@@ -48,7 +48,7 @@
 #include "nb_kernel.h"
 #include "nrnb.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 void
 gmx_nb_generic_cg_kernel(t_nblist *                nlist,
index b983e314c30eb508cefb1a5130e88bc02f822398..d69c4c09e0d688879ed32141939b8da09f1cffd3 100644 (file)
@@ -43,7 +43,7 @@
 #include "nb_kernel.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 /* Static data structures to find kernels */
index 95cc2d57202414b51988acd462b220e1205bcb30..8df440f068a403635a2896a43e34c4f8983cbc89 100644 (file)
@@ -53,9 +53,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "force.h"
 #include "names.h"
-#include "main.h"
-#include "xvgr.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "physics.h"
 #include "force.h"
 #include "bondf.h"
index d0d118d8d93297a9a932ae62f8e498b8b6b56c1c..afa12f55c8e10619d5df49dc4c9668885a2a97f1 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
+
 #include "types/commrec.h"
-#include "sysstuff.h"
 #include "names.h"
 #include "macros.h"
 #include "nrnb.h"
-#include "main.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct {
index da920db11dc0952780397f8a216dd9e60e9faf8d..2741240abc38e02a243f5f4c869c48d5f85d2766 100644 (file)
@@ -51,7 +51,7 @@
 
 #include "gromacs/linearalgebra/nrjac.h"
 #include "gromacs/math/do_fit.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
                  rvec xref[],
index c96eba4f063ba40dcfd3ca446584b0442838406b..a26adfcb6ae0909eda9349dd3247142371551931 100644 (file)
 #include <math.h>
 #include <assert.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "vec.h"
 #include "gromacs/math/utilities.h"
-#include "main.h"
 #include "pbc.h"
 #include "gromacs/utility/smalloc.h"
 #include "txtdump.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "names.h"
 #include "macros.h"
 #include "gmx_omp_nthreads.h"
index 35435d663207d19a2702e09624e9be9be03c8d76..be40ab54ce30d7074842170ab45db86dcabb26d2 100644 (file)
@@ -40,7 +40,6 @@
 #endif
 
 #include "typedefs.h"
-#include "main.h"
 #include "network.h"
 #include "rbin.h"
 #include "gromacs/utility/smalloc.h"
index e7cef773eda608b88d20cc2f5bea7280eabd9613..28afed300d1e05b5c91956e6ace6629c87ab25a8 100644 (file)
 #include <stdlib.h>
 #include "typedefs.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 #include "readinp.h"
 #include "macros.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "names.h"
 #include "warninp.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 t_inpfile *read_inpfile(const char *fn, int *ninp,
                         warninp_t wi)
index e474ebb690eabb64e96a34bff271827fb484b2cf..9181ec514466cf0f59333befb3952790799df367 100644 (file)
@@ -48,7 +48,6 @@
 #include "macros.h"
 #include "names.h"
 #include "mshift.h"
-#include "main.h"
 #include "disre.h"
 #include "orires.h"
 #include "force.h"
index 1c0e0c9acff32da4ce714f96ded71ea260274325..e717a591dc451cd141fe51c18ab06be68c5ea3fa 100644 (file)
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "mshift.h"
 #include "pbc.h"
 #include "rmpbc.h"
 #include "vec.h"
 
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct {
index 1684a5490b16f91b920c60cba5c0e5fa688bee5b..d186fa2ca46b46faf05439c62b571ddc2f563a33 100644 (file)
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/math/utilities.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "macros.h"
 #include "index.h"
@@ -52,7 +51,7 @@
 #include "typedefs.h"
 #include "oenv.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/fileio/matio.h"
 #include "names.h"
 #include "sfactor.h"
@@ -135,21 +134,9 @@ extern t_complex *** rc_tensor_allocation(int x, int y, int z)
     t_complex ***t;
     int          i, j;
 
-    t = (t_complex ***)calloc(x, sizeof(t_complex**));
-    if (!t)
-    {
-        exit(fprintf(stderr, "\nallocation error"));
-    }
-    t[0] = (t_complex **)calloc(x*y, sizeof(t_complex*));
-    if (!t[0])
-    {
-        exit(fprintf(stderr, "\nallocation error"));
-    }
-    t[0][0] = (t_complex *)calloc(x*y*z, sizeof(t_complex));
-    if (!t[0][0])
-    {
-        exit(fprintf(stderr, "\nallocation error"));
-    }
+    snew(t, x);
+    snew(t[0], x*y);
+    snew(t[0][0], x*y*z);
 
     for (j = 1; j < y; j++)
     {
@@ -260,7 +247,10 @@ extern void compute_structure_factor (structure_factor_t * sft, matrix box,
             }
         }
     }
-    sfree (counter); free(tmpSF[0][0]); free(tmpSF[0]); free(tmpSF);
+    sfree(counter);
+    sfree(tmpSF[0][0]);
+    sfree(tmpSF[0]);
+    sfree(tmpSF);
 }
 
 
index 841b43e35e89754a9e4c8223fab8ca3d9f46f26b..757ba30f40401d10e59f036233f8584c9e1fc37a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include <config.h>
 #endif
 
+#include <stdlib.h>
+
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "sighandler.h"
 
-
 const char *gmx_stop_cond_name[] =
 {
     "None",
index 1d98dc2c8d2319c5a8b8a570b4c77305bfd3df06..c5793a5e2b75c8318fb9af61c70112b270ff29d7 100644 (file)
 #endif
 
 #include <assert.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "macros.h"
-#include "gromacs/utility/smalloc.h"
 #include "mshift.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int atom, sid;
index 7e9d65a450b934208623da5b242bad61e4cb1756..7ed7c4eca614d5f484b4b50095fa360b399c5923 100644 (file)
@@ -40,9 +40,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include "sysstuff.h"
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "txtdump.h"
 #include "symtab.h"
index 7d1f5e5fb33530cbe0878876bb62aede35cac87f..0fe9719a7cc6238c0bd189f522c1e6d120d0c06c 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "topsort.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static gmx_bool ip_pert(int ftype, const t_iparams *ip)
 {
index e1705d20d0d96d83882d5b2bfce16bff745940bb..314eef2d3dbbdefb7694ad9270a7da424c2637da 100644 (file)
@@ -41,6 +41,8 @@
 /* This file is completely threadsafe - please keep it that way! */
 
 #include <stdio.h>
+#include <stdlib.h>
+
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "names.h"
@@ -48,7 +50,7 @@
 #include "vec.h"
 #include "macros.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 int pr_indent(FILE *fp, int n)
index 81eab1b2ebf765d19b7f0090a4ae24f106cbb140..92b10975ca885d062640ad4db30beb4c6e3a0db6 100644 (file)
@@ -331,12 +331,12 @@ void done_molblock(gmx_molblock_t *molb)
     if (molb->nposres_xA > 0)
     {
         molb->nposres_xA = 0;
-        free(molb->posres_xA);
+        sfree(molb->posres_xA);
     }
     if (molb->nposres_xB > 0)
     {
         molb->nposres_xB = 0;
-        free(molb->posres_xB);
+        sfree(molb->posres_xB);
     }
 }
 
index feb6898642ea2889218f119ef73a0519b399b84e..beace19aac008b226cafd2859334fa273ed7864f 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
+#include "viewit.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
 #include "oenv.h"
-#include "viewit.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/filenm.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 
 static const int   can_view_ftp[] = {
     0,
@@ -58,7 +60,7 @@ static const char* view_program[] = {
     "ghostview",    "display",      NULL,           "xterm -e rasmol"
 };
 
-int can_view(int ftp)
+static int can_view(int ftp)
 {
     int i;
 
index 0e18160c6b2012948365e17614596d3c44897f2a..d7a8b10ca351308a216f6fed3c035e9f58834430 100644 (file)
@@ -43,7 +43,7 @@
 #include "gromacs/utility/smalloc.h"
 #include "copyrite.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "warninp.h"
 
 typedef struct warninp {
index 429e78849cc14f1cdc0d1980cfeeab08abb5906c..85bbd465c20320852cd70bfe88b67a682bd80534 100644 (file)
@@ -47,7 +47,7 @@
 #include "toputil.h"
 #include "hackblock.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void clear_atom_list(int i0, atom_id a[])
 {
index a96bd0679e12189f7deb961679b78280de87c349..0ea860be07d889ab0744f7f81451beed2b4931d3 100644 (file)
 #endif
 
 #include <assert.h>
+#include <math.h>
+#include <stdlib.h>
 
 #include <sys/types.h>
-#include <math.h>
+
 #include "typedefs.h"
 #include "physics.h"
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
 #include "macros.h"
 #include "vec.h"
 #include "coulomb.h"
 #include "calc_verletbuf.h"
 #include "../mdlib/nbnxn_consts.h"
 
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
 #ifdef GMX_NBNXN_SIMD
 /* The include below sets the SIMD instruction type (precision+width)
  * for all nbnxn SIMD search and non-bonded kernel code.
index fb97126e251b77bac8d21c24c8a1aa72bd01df57..503e3f615e3664ad39d43f2f173d1c7e762b8b13 100644 (file)
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "physics.h"
 #include "vec.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "topio.h"
 #include "toputil.h"
 #include "convparm.h"
index f1cdf02aa3c7e75105f37a756caaa48e76d2b68c..a45a62ba4d97ba60292da4298b7e3d78d3f73b31 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <fcntl.h>
-#include "sysstuff.h"
-#include "network.h"
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+#include "network.h"
 #include "fflibutil.h"
 
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/path.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
 
 const char *fflib_forcefield_dir_ext()
 {
index 7e8bfad88c19e864e1ccfc00113f24c68a6b34fe..c90e7341e1108217aa0172abcb4a0e415c231330 100644 (file)
@@ -41,9 +41,9 @@
 
 #include <ctype.h>
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
@@ -55,7 +55,7 @@
 #include "gpp_nextnb.h"
 #include "symtab.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "pgutil.h"
 #include "resall.h"
 #include "gen_ad.h"
index 73326ac08fab1d321db7962b213803cac3c75571..4fb1976893b4813534d0b9e31bdda04b9c2fea13 100644 (file)
@@ -40,7 +40,6 @@
 
 #include <math.h>
 #include "gromacs/random/random.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "physics.h"
 #include "typedefs.h"
index 4afe493cb3c097e6fa19e3108d41bf06944702aa..5e95eecb39dd1222c230d814f4ad4777d3de7156 100644 (file)
 
 #include <math.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "gromacs/utility/cstringutil.h"
 #include "gen_vsite.h"
-#include "gromacs/utility/smalloc.h"
 #include "resall.h"
 #include "add_par.h"
 #include "vec.h"
 #include "physics.h"
 #include "index.h"
 #include "names.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gpp_atomtype.h"
 #include "fflibutil.h"
 #include "macros.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #define MAXNAME 32
 #define OPENDIR     '[' /* starting sign for directive         */
index 52b7b048b38769c14b51ec8ac8fc23c327918f4b..d08c77a64cebcb004a967b831dd7d31dace4ce0f 100644 (file)
@@ -39,7 +39,6 @@
 #include "gromacs/math/utilities.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/commandline/pargs.h"
 #include "vec.h"
@@ -51,7 +50,7 @@
 #include "sortwater.h"
 #include "gromacs/fileio/trxio.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void rand_rot(int natoms, rvec x[], rvec v[], vec4 xrot[], vec4 vrot[],
                      gmx_rng_t rng, rvec max_rot)
index afcadb43b4b09b5f96df7d4f074426171ccc133f..6382a2c39a1f877e1c477b07ddaedc44e933c8c5 100644 (file)
 #include <string.h>
 #include <time.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/fileio/confio.h"
 #include "symtab.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "physics.h"
 #include "calch.h"
 #include "genhydro.h"
index d9265d483192da1f736873455a97df2281008037..b53f8e32d6231ddbbb50d185173291ec8ad36bbc 100644 (file)
@@ -49,9 +49,9 @@
 
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gmxcpp.h"
 
 typedef struct {
index 31a39aec157e9438ef17b08ee9464b8bdc2fb43b..a44dcb95c1c365dcd21a984b206317a19678e824 100644 (file)
 #include <string.h>
 
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "macros.h"
 #include "topdirs.h"
 #include "toputil.h"
 #include "topdirs.h"
 #include "toputil.h"
 #include "symtab.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "txtdump.h"
 #include "gpp_atomtype.h"
 
index ae3657e47673b7fb8df25a73494d6f59e7573fc5..deabccfc5d85ccf6df952996e0f964aa5fe35236 100644 (file)
@@ -39,7 +39,6 @@
 #endif
 
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "macros.h"
 #include "symtab.h"
 #include "gromacs/utility/cstringutil.h"
index b90c82274286efc4b578f09df67a01f91fa47809..41a026d072c18bcb9915c6da9dd162de7cf47132 100644 (file)
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
+#include <stdlib.h>
+
 #include "macros.h"
 /* #define DEBUG_NNB */
 #include "gpp_nextnb.h"
-#include "gmx_fatal.h"
 #include "toputil.h"
 
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
 typedef struct {
     int ai, aj;
 } sortable;
index 872c670990c99807997386445ec424ecab86cc7e..d0e452ccc2bc0a58e53bc50a6788defab12b5a43 100644 (file)
@@ -47,7 +47,6 @@
 #include <limits.h>
 #include <assert.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "readir.h"
 #include "gromacs/random/random.h"
 #include "gromacs/gmxpreprocess/gen_maxwell_velocities.h"
 #include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "splitter.h"
 #include "gromacs/gmxpreprocess/sortwater.h"
 #include "convparm.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "warninp.h"
 #include "index.h"
 #include "gromacs/fileio/gmxfio.h"
index 25ec285e06fe24d57ae029989b7aaddaf0910e4b..0680ef47014ca23f696781cd77c0dc8199aa7d46 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/utility/cstringutil.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "symtab.h"
 #include "h_db.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "fflibutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 
 /* Number of control atoms for each 'add' type.
index 604966552b26d006585b95a01aae4c26dd87ba29..f297506765f1e06dfbef013178b541483a79de12 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef GMX_GMXPREPROCESS_H_DB_H
 #define GMX_GMXPREPROCESS_H_DB_H
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "hackblock.h"
 
 #ifdef __cplusplus
index 262e308f72da17defb1fbe9bf05a35514b361571..b74e294bf2e00a5d8b4d7c6ea771b241c2a4adef 100644 (file)
@@ -93,7 +93,7 @@ void free_t_restp(int nrtp, t_restp **rtp)
             free_t_bondeds(&(*rtp)[i].rb[j]);
         }
     }
-    free(*rtp);
+    sfree(*rtp);
 }
 
 void free_t_hack(int nh, t_hack **h)
index 4274d779880b47adfd6d1958006918bd3010ec08..0bb9e1873c289c848a1a9d7f237a4380f06e8b70 100644 (file)
@@ -51,7 +51,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "macros.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static int in_strings(char *key, int nstr, const char **str)
 {
index c60b4d0d03c2678e25e7db81d38669ecabc3905d..590672eabf24a3ec9dc65dcb68d5d67e6849d4c5 100644 (file)
 #endif
 
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/fileio/confio.h"
 #include "macros.h"
 #include "gromacs/random/random.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "atomprop.h"
 #include "names.h"
 #include "vec.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/gmxlib/conformation-utilities.h"
 #include "addconf.h"
 #include "read-conformation.h"
 #include "pbc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
+
+#include "gromacs/utility/cstringutil.h"
 
 static gmx_bool in_box(t_pbc *pbc, rvec x)
 {
index e9dd3961f18f3935f578f4c48f472923257bc2d2..4ec089dddc8b43b58052ccfcfeb40b59f427bc1a 100644 (file)
@@ -46,7 +46,6 @@
 #include "bondf.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "gromacs/fileio/confio.h"
 #include "physics.h"
 #include "vec.h"
@@ -62,7 +61,7 @@
 
 #include "nm2type.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
 {
index b8686eefefcd92c62760f21da3956f1ab28fa1ca..c37a0069b7ae2a6e7275f37c31a361d609cbecc9 100644 (file)
 #endif
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/utility/smalloc.h"
@@ -54,8 +54,8 @@
 #include "symtab.h"
 #include "vec.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/pdbio.h"
 #include "toputil.h"
 #include "h_db.h"
index 2110a4b32e5d7747649855e736db2a58223ebff3..6f6bc008411c75cb6fe0867e2b4481f8341b92ce 100644 (file)
@@ -46,8 +46,8 @@
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "symtab.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "pdb2top.h"
 #include "gpp_nextnb.h"
 #include "topdirs.h"
index 80088875f820b240cfd02beeeeb03f4e497f8959..c9ad5fd2767bb68023facb161c9a126dd6ecd62b 100644 (file)
@@ -42,7 +42,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "pgutil.h"
 #include <string.h>
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define BUFSIZE 1024
 static void atom_not_found(int fatal_errno, const char *file, int line,
index 38bf7cdc97bf5adcffe1c84f491ec2557da7aefe..ebd539a7f8dc0cdcd6836c83d610a4fe9eac0916 100644 (file)
@@ -54,7 +54,7 @@
 #include "vec.h"
 #include "hackblock.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 int gmx_protonate(int argc, char *argv[])
 {
index 64fa909de44387d358105fd555d18b4a8936c54d..ca9e5248c80729e5d802876d1ac81b6214e6e30c 100644 (file)
  */
 #include "read-conformation.h"
 
-#include "gromacs/fileio/confio.h"
 #include "atomprop.h"
 #include "types/simple.h"
 #include "types/atoms.h"
+
+#include "gromacs/fileio/confio.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
 
 real *makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
index 7f3668484463f424648eb30a965b4821ef847336..422198aa0a8c5d067c0b0be2c1f1cac503ce8b7c 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#include <stdlib.h>
 #include <string.h>
 
-#include "gromacs/utility/cstringutil.h"
 #include "readir.h"
 #include "names.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
 
 #define MAXPTR 254
 
index 19f9411761ec217d33e849c7b3a0eb0e2fbae597..328e8d89b78b175f9e4f7422439d28ea7f46f194 100644 (file)
 #include <ctype.h>
 #include <stdlib.h>
 #include <limits.h>
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "physics.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "index.h"
 #include "symtab.h"
index c23aa35668d2f74ac0f729b33b4f4765301895bd..ad4582eea9f272828ff442ca21312c41e94b4901 100644 (file)
 #include <stdlib.h>
 
 #include "gromacs/utility/cstringutil.h"
-#include "sysstuff.h"
 #include "princ.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "vec.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "index.h"
 #include "symtab.h"
index cc25957b1adcde7ceebac92a68449460e2b782e9..e446177541cee905d91575abbd3915c9f2be1889 100644 (file)
 #include "gromacs/utility/smalloc.h"
 #include "readir.h"
 #include "names.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/trnio.h"
 #include "txtdump.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static char *RotStr = {"Enforced rotation:"};
 
index 91aa32613a2600320b8fac3efdd68e9812e7e56e..01e77a8a06fc7d662df1744ac9a09082ee8c7349 100644 (file)
 #endif
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "symtab.h"
 #include "macros.h"
 #include "resall.h"
index 27623f165ebfa059dab3cd68761a0c8177b1dd9a..7f3f09c3a583cf6c2bbf0e9848713d5e17404dc2 100644 (file)
 
 #include <string.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/fileio/confio.h"
 #include "macros.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "atomprop.h"
 #include "names.h"
 #include "vec.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/gmxlib/conformation-utilities.h"
 #include "addconf.h"
index 63834a92585c7fac628a66f597d1c901aecb487d..abcac867ccba39666d99852faf78caea81b6afc4 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
+
 #include "typedefs.h"
-#include "gromacs/random/random.h"
-#include "gromacs/utility/smalloc.h"
 #include "vec.h"
 #include "sortwater.h"
 
+#include "gromacs/random/random.h"
+#include "gromacs/utility/smalloc.h"
+
 static rvec   *xptr, box_1;
 static int     nwat;
 static matrix  BOX;
index 09758f8e3b497a586881d1245098e1b254b2c10c..d66d5ab2a61d31705b49e9647ec40f3c3e4f75e1 100644 (file)
 #include <ctype.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "symtab.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "resall.h"
 #include "h_db.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "ter_db.h"
 #include "toputil.h"
 #include "gromacs/fileio/gmxfio.h"
index 3f859699af918bef8020991e2462dc603e4b017b..40547627da54ed8b442304a00844f2f8ce1eee07 100644 (file)
@@ -38,7 +38,6 @@
 #ifndef GMX_GMXPREPROCESS_TER_DB_H
 #define GMX_GMXPREPROCESS_TER_DB_H
 
-#include "sysstuff.h"
 #include "hackblock.h"
 #include "grompp-impl.h"
 
index 2f535f8241f5d13f48b0532943c164f79fb7965a..a6af1e1d9428654504294b890d0b60627f50a605 100644 (file)
@@ -42,7 +42,7 @@
 #include "../insert-molecules.h"
 #include "testutils/integrationtests.h"
 #include "testutils/cmdlinetest.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 
 namespace
 {
index 71202b62ec4091fa85de66a5514c705b65d8ef61..ae99c0e0a4c986dffaa96838507c766281661da5 100644 (file)
@@ -42,7 +42,7 @@
 #include "../solvate.h"
 #include "testutils/integrationtests.h"
 #include "testutils/cmdlinetest.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 
 namespace
 {
index 5bcf84f73756f10bca574acdd659e9ed26a719bb..330616115f3d56ed3d8adf563bb4242bdb9d5953 100644 (file)
 #include "typedefs.h"
 #include "gromacs/utility/cstringutil.h"
 #include "grompp-impl.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 #include "toputil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gpp_atomtype.h"
 #include "macros.h"
 
index 212bf1ea6fbeed464803ac01731ee1b945bcf31e..5e7efabe36c08e6f95cc4e51fd2147c61786e23b 100644 (file)
 #include <stdio.h>
 #include <stdarg.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "topdirs.h"
 
 /* Must correspond to the directive enum in grompp-impl.h */
index 52dcdd51cc6edc258b7fd8436fae6ef994592359..87fd8a7a978a60c684b1f04d34b6e14a82744547 100644 (file)
 #include <config.h>
 #endif
 
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
 #include <math.h>
-#include <sys/types.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
 
-#include "gromacs/fileio/futil.h"
-#include "sysstuff.h"
+#include <sys/types.h>
+
+#include "gromacs/utility/futil.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
@@ -58,7 +59,7 @@
 #include "names.h"
 #include "gromacs/utility/cstringutil.h"
 #include "symtab.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "warninp.h"
 #include "vsite_parm.h"
 
index 8f25139fd2cb8cb44a320eefad4886d1c69b254c..18787878f9629204a9587f036ac1a145d713862c 100644 (file)
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <ctype.h>
 #include <math.h>
-#include <assert.h>
+#include <stdlib.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gromacs/utility/cstringutil.h"
 #include "names.h"
 #include "toputil.h"
 #include "toppush.h"
 #include "topdirs.h"
 #include "readir.h"
 #include "symtab.h"
-#include "gmx_fatal.h"
 #include "warninp.h"
 #include "gpp_atomtype.h"
 #include "gpp_bond_atomtype.h"
 
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
 void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype_t atype,
                        warninp_t wi)
 {
index fa00694a6e534e1e702638c33f48149e94a06d4a..56bc0c55bfe3d70a953080bdbbf3d1775ea2f6d6 100644 (file)
@@ -42,7 +42,6 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "sysstuff.h"
 #include "physics.h"
 #include "macros.h"
 #include "readir.h"
@@ -52,7 +51,7 @@
 #include "toputil.h"
 #include "topdirs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void copy_bond (t_params *pr, int to, int from)
 /* copies an entry in a bond list to another position.
index 33db83ee49aa90a11fe2897cea52118e38fdcfef..a23a38af7037e0e98c454dc3f746cdd9f16ccc0a 100644 (file)
 #include <string.h>
 
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "macros.h"
 #include "topdirs.h"
 #include "toputil.h"
 #include "symtab.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gpp_atomtype.h"
 
 /* UTILITIES */
index 87b7763c3860c828f864bc6e33f69292fa5c4e26..d7b4a5fef1a733f58ed8072775ad14b2fd8d5b92 100644 (file)
@@ -51,7 +51,7 @@
 #include "physics.h"
 #include "index.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/cstringutil.h"
 #include "physics.h"
 #include "macros.h"
index 5a0c27af1bdc6eb6d0497fca0af31fa134a230d3..75fe7b02f74a56f94bec411b9168823823b4170c 100644 (file)
@@ -49,7 +49,6 @@
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "gromacs/fileio/confio.h"
 #include "physics.h"
 #include "gromacs/commandline/pargs.h"
@@ -67,7 +66,7 @@
 #include "hackblock.h"
 #include "nm2type.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 char atp[7] = "HCNOSX";
 #define NATP (asize(atp)-1)
@@ -635,7 +634,7 @@ int gmx_x2top(int argc, char *argv[])
         dump_hybridization(debug, atoms, nbonds);
     }
     close_symtab(&symtab);
-    free(mymol.name);
+    sfree(mymol.name);
 
     printf("\nWARNING: topologies generated by %s can not be trusted at face value.\n",
            ShortProgram());
index dac0b3cd652d78b2783ba6e8ebbaabe369c3f491..9a88f65e10eb0e269d14d154d2a03498087b3b89 100644 (file)
 #include "gromacs/utility/smalloc.h"
 #include "symtab.h"
 #include "index.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "fflibutil.h"
 #include "hackblock.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "xlate.h"
 
 #include "gromacs/fileio/strdb.h"
index 2e8cbcece8b67194f923e556f0954eb8c5aecd0c..1210cdf2f6c8cdf5569e2c63c296311b86200d51 100644 (file)
@@ -50,7 +50,7 @@
 #include <config.h>
 #endif
 
-
+#include <errno.h>
 #include <string.h>
 
 #ifdef GMX_NATIVE_WINDOWS
 #include "mdrun.h"
 #include "sighandler.h"
 #include "gmx_ga2la.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/fileio/confio.h"
 #include "mtop_util.h"
 #include "names.h"
 #include "gromacs/timing/wallcycle.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \brief How long shall we wait in seconds until we check for a connection again? */
 #define IMDLOOPWAIT 1
index 6febf83e55b57d45d739bb681b2bf49d3275e7dc..8c0719eab5efc0c077d90bdc6c419aca8f5b9817 100644 (file)
 #include <config.h>
 #endif
 
-
+#include <errno.h>
 #include <string.h>
+
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "imdsocket.h"
 #include "imd.h"
 
-
 #ifdef GMX_NATIVE_WINDOWS
 #ifdef GMX_HAVE_WINSOCK
 /*! \brief Define socklen type on Windows. */
@@ -78,7 +78,6 @@ extern int imdsock_winsockinit()
 #endif
 #else
 /* On UNIX, we can use nice errors from errno.h */
-#include <errno.h>
 #include <unistd.h>
 #endif
 
index 2fab5bc79cc1b21aa934691515a6e9ffc4f9fd59..44a429fe575f17ff13afa53aa4803fb9e84b24d0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,8 @@
 #ifndef _chargegroup_h
 #define _chargegroup_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index 2b8cfab10cfb876fb53caafe06add1da91eb75c6..eca746698af2a3a1be038732d1a7b52dfaed3050 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef _disre_h
 #define _disre_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index b468a3bc6b6dc1d3881d81758ddc4612108ab8c7..61a8db1de3340efde074a145c3158b8bca4965fc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,8 @@
 #ifndef _ebin_h
 #define _ebin_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 #include "../fileio/enxio.h"
 
diff --git a/src/gromacs/legacyheaders/gmx_fatal_collective.h b/src/gromacs/legacyheaders/gmx_fatal_collective.h
deleted file mode 100644 (file)
index c7e5957..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2012, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef _fatal_collective_h
-#define _fatal_collective_h
-
-#include "typedefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-void
-gmx_fatal_collective(int f_errno, const char *file, int line,
-                     const t_commrec *cr, gmx_domdec_t *dd,
-                     const char *fmt, ...);
-/* As gmx_fatal declared in gmx_fatal.h,
- * but only the master process prints the error message.
- * This should only be called one of the following two situations:
- * 1) On all nodes in cr->mpi_comm_mysim, with cr!=NULL,dd==NULL.
- * 2) On all nodes in dd->mpi_comm_all,   with cr==NULL,dd!=NULL.
- * This will call MPI_Finalize instead of MPI_Abort when possible,
- * This is useful for handling errors in code that is executed identically
- * for all processes.
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* _fatal_collective_h */
index a241ee0def4f5f4695784237dd20dc978fc3dfe6..da399214daf57da218e4dc2c0f501bc54e160d31 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #ifdef __cplusplus
 extern "C" {
index f4010010dba270082c377b2786c52645cb7a256b..4c30d7e7d268a0d2c69d202edf6454c1142b1ecc 100644 (file)
@@ -33,8 +33,8 @@
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef GMX_OMP_NTHREADS
-#define GMX_OMP_NTHREADS
+#ifndef GMX_OMP_NTHREADS_H
+#define GMX_OMP_NTHREADS_H
 
 #include <stdio.h>
 #include "typedefs.h"
@@ -46,7 +46,7 @@ extern "C" {
 }
 #endif
 
-/*! Enum values corresponding to multithreaded algorithmic modules. */
+/** Enum values corresponding to multithreaded algorithmic modules. */
 typedef enum module_nth
 {
     /* Default is meant to be used in OMP regions outside the named
@@ -56,9 +56,12 @@ typedef enum module_nth
     emntNR
 } module_nth_t;
 
-/*! Initializes the per-module thread count. It is compatible with tMPI,
- *  thread-safety is ensured (for the features available with tMPI).
- *  This function should caled only once during the initialization of mdrun. */
+/*! \brief
+ * Initializes the per-module thread count.
+ *
+ * It is compatible with tMPI, thread-safety is ensured (for the features
+ * available with tMPI).
+ * This function should caled only once during the initialization of mdrun. */
 void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
                            int nthreads_hw_avail,
                            int omp_nthreads_req,
@@ -66,14 +69,18 @@ void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
                            gmx_bool bCurrNodePMEOnly,
                            gmx_bool bFullOmpSupport);
 
-/*! Returns the number of threads to be used in the given module m. */
+/*! \brief
+ * Returns the number of threads to be used in the given module \p mod. */
 int gmx_omp_nthreads_get(int mod);
 
-/*! \brief Sets the number of threads to be used in module. Intended
- *  for use in testing. */
+/*! \brief Sets the number of threads to be used in module.
+ *
+ * Intended for use in testing. */
 void gmx_omp_nthreads_set(int mod, int nthreads);
 
-/*! Read the OMP_NUM_THREADS env. var. and check against the value set on the command line. */
+/*! \brief
+ * Read the OMP_NUM_THREADS env. var. and check against the value set on the
+ * command line. */
 void gmx_omp_nthreads_read_env(int     *nthreads_omp,
                                gmx_bool bIsSimMaster);
 
@@ -84,4 +91,4 @@ void gmx_omp_nthreads_read_env(int     *nthreads_omp,
 }
 #endif
 
-#endif /* GMX_OMP_NTHREADS */
+#endif
index 2ee5cfd4e328b03611cfcfa95339586b03d145b0..5ac0bb54c5186b415e4afb31cf796e4e0e75fef5 100644 (file)
@@ -34,6 +34,7 @@
  */
 #ifndef GMX_THREAD_AFFINITY_H_
 #define GMX_THREAD_AFFINITY_H_
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
@@ -61,6 +62,8 @@ gmx_set_thread_affinity(FILE                *fplog,
  * made by the OpenMP library.
  *
  * Note that this will only work on Linux as we use a GNU feature.
+ * With bAfterOpenmpInit false, it will also detect whether OpenMP environment
+ * variables for setting the affinity are set.
  */
 void
 gmx_check_thread_affinity_set(FILE *fplog, const t_commrec *cr,
index 0d02e7f53ba18694fbfb0425b7951dad667ec6ab..fb8f022ec08f29c8706e5f13776faf1a80167580 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,8 +38,6 @@
 #ifndef _macros_h
 #define _macros_h
 
-#include "typedefs.h" /* for real definition only */
-
 /* no extern "C" for this header because it only defines Macros */
 
 /*
@@ -50,6 +48,8 @@
  * angle.a[0][3]
  */
 #ifndef __cplusplus
+#include <stdlib.h>
+
 #define AI  a[0]
 #define AJ  a[1]
 #define AK  a[2]
index 58356f6a6a980472b422b8d221e3b3eca32e710b..e447d85af0753b4d9a2b8729d22f557fd79b785c 100644 (file)
 extern "C" {
 #endif
 
-int gmx_gethostname(char *name, size_t len);
-/* Sets the hostname to the value given by gethostname, if available,
- * and to "unknown" otherwise. name should have at least size len.
- * Returns 0 on success, -1 on error.
- */
-
 void gmx_log_open(const char *fn, const t_commrec *cr,
                   gmx_bool bMasterOnly, gmx_bool bAppendFiles, FILE**);
 /* Open the log file, if necessary (nprocs > 1) the logfile name is
index 4516a07367860787a8e1b72642a58f73d34c0660..ad76bd567ac8925227e9ca19a962a79506468baa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,8 +38,9 @@
 #ifndef _mdebin_h
 #define _mdebin_h
 
+#include <stdio.h>
+
 #include "typedefs.h"
-#include "sysstuff.h"
 #include "ebin.h"
 #include "../fileio/enxio.h"
 #include "types/state.h"
index 62cdfe6ceab333a31b9d2aed1c067c769b5adb99..919e1355b09e20534dbadda4835cff8921ca1ca8 100644 (file)
@@ -54,7 +54,7 @@
 extern "C" {
 #endif
 
-/*! Initializes the data structures related to CUDA nonbonded calculations. */
+/** Initializes the data structures related to CUDA nonbonded calculations. */
 FUNC_QUALIFIER
 void nbnxn_cuda_init(FILE gmx_unused                 *fplog,
                      nbnxn_cuda_ptr_t gmx_unused     *p_cu_nb,
@@ -64,19 +64,19 @@ void nbnxn_cuda_init(FILE gmx_unused                 *fplog,
                      /* true of both local and non-local are don on GPU */
                      gmx_bool gmx_unused              bLocalAndNonlocal) FUNC_TERM
 
-/*! Initializes simulation constant data. */
+/** Initializes simulation constant data. */
 FUNC_QUALIFIER
 void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t               gmx_unused  cu_nb,
                            const interaction_const_t      gmx_unused *ic,
                            const nonbonded_verlet_group_t gmx_unused *nbv_group) FUNC_TERM
 
-/*! Initializes pair-list data for GPU, called at every pair search step. */
+/** Initializes pair-list data for GPU, called at every pair search step. */
 FUNC_QUALIFIER
 void nbnxn_cuda_init_pairlist(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
                               const nbnxn_pairlist_t gmx_unused *h_nblist,
                               int                    gmx_unused  iloc) FUNC_TERM
 
-/*! Initializes atom-data on the GPU, called at every pair search step. */
+/** Initializes atom-data on the GPU, called at every pair search step. */
 FUNC_QUALIFIER
 void nbnxn_cuda_init_atomdata(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
                               const nbnxn_atomdata_t gmx_unused *atomdata) FUNC_TERM
@@ -86,21 +86,21 @@ FUNC_QUALIFIER
 void nbnxn_cuda_pme_loadbal_update_param(nbnxn_cuda_ptr_t          gmx_unused  cu_nb,
                                          const interaction_const_t gmx_unused *ic) FUNC_TERM
 
-/*! Uploads shift vector to the GPU if the box is dynamic (otherwise just returns). */
+/** Uploads shift vector to the GPU if the box is dynamic (otherwise just returns). */
 FUNC_QUALIFIER
 void nbnxn_cuda_upload_shiftvec(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
                                 const nbnxn_atomdata_t gmx_unused *nbatom) FUNC_TERM
 
-/*! Clears GPU outputs: nonbonded force, shift force and energy. */
+/** Clears GPU outputs: nonbonded force, shift force and energy. */
 FUNC_QUALIFIER
 void nbnxn_cuda_clear_outputs(nbnxn_cuda_ptr_t gmx_unused cu_nb,
                               int              gmx_unused flags) FUNC_TERM
 
-/*! Frees all GPU resources used for the nonbonded calculations. */
+/** Frees all GPU resources used for the nonbonded calculations. */
 FUNC_QUALIFIER
 void nbnxn_cuda_free(nbnxn_cuda_ptr_t gmx_unused  cu_nb) FUNC_TERM
 
-/*! Returns the GPU timings structure or NULL if GPU is not used or timing is off. */
+/** Returns the GPU timings structure or NULL if GPU is not used or timing is off. */
 FUNC_QUALIFIER
 wallclock_gpu_t * nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 #ifdef GMX_GPU
@@ -111,12 +111,12 @@ wallclock_gpu_t * nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 }
 #endif
 
-/*! Resets nonbonded GPU timings. */
+/** Resets nonbonded GPU timings. */
 FUNC_QUALIFIER
 void nbnxn_cuda_reset_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb) FUNC_TERM
 
-/*! Calculates the minimum size of proximity lists to improve SM load balance
   with CUDA non-bonded kernels. */
+/** Calculates the minimum size of proximity lists to improve SM load balance
*  with CUDA non-bonded kernels. */
 FUNC_QUALIFIER
 int nbnxn_cuda_min_ci_balanced(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 #ifdef GMX_GPU
@@ -127,7 +127,7 @@ int nbnxn_cuda_min_ci_balanced(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 }
 #endif
 
-/*! Returns if analytical Ewald CUDA kernels are used. */
+/** Returns if analytical Ewald CUDA kernels are used. */
 FUNC_QUALIFIER
 gmx_bool nbnxn_cuda_is_kernel_ewald_analytical(const nbnxn_cuda_ptr_t gmx_unused cu_nb)
 #ifdef GMX_GPU
index 8d4d4f17a3c8cc2a8a7388f0d83326cf70542da3..42fe9ca74fdad8fd2f8e8ed5d30f63d06f6cabf1 100644 (file)
@@ -47,8 +47,7 @@
 
 #include "types/simple.h"
 #include "typedefs.h"
-#include "main.h"
-#include "gmx_fatal.h"
+#include "../utility/fatalerror.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -67,37 +66,12 @@ t_commrec *reinitialize_commrec_for_this_thread(const t_commrec *cro);
 void gmx_fill_commrec_from_mpi(t_commrec *cr);
 /* Continues t_commrec construction */
 
-int gmx_node_num(void);
-/* return the number of nodes in the ring */
-
-int gmx_node_rank(void);
-/* return the rank of the node */
-
-int gmx_physicalnode_id_hash(void);
-/* Return a non-negative hash that is, hopefully, unique for each physical node.
- * This hash is useful for determining hardware locality.
- */
-
-int gmx_hostname_num(void);
-/* Ostensibly, returns a integer characteristic of and unique to each
-   physical node in the MPI system. If the first part of the MPI
-   hostname (up to the first dot) ends with a number, returns this
-   number. If the first part of the MPI hostname does not ends in a
-   number (0-9 characters), returns 0.
- */
-
 void gmx_setup_nodecomm(FILE *fplog, t_commrec *cr);
 /* Sets up fast global communication for clusters with multi-core nodes */
 
 void gmx_init_intranode_counters(t_commrec *cr);
 /* Initializes intra-physical-node MPI process/thread counts and ID. */
 
-gmx_bool gmx_mpi_initialized(void);
-/* return TRUE when MPI_Init has been called.
- * return FALSE when MPI_Init has not been called OR
- * when GROMACS was compiled without MPI support.
- */
-
 void gmx_barrier(const t_commrec *cr);
 /* Wait till all processes in cr->mpi_comm_mygroup have reached the barrier */
 
@@ -131,9 +105,6 @@ void gmx_sumf_sim(int nr, float r[], const gmx_multisim_t *ms);
 void gmx_sumd_sim(int nr, double r[], const gmx_multisim_t *ms);
 /* Calculate the sum over the simulations of an array of doubles */
 
-void gmx_abort(int nodeid, int nnodes, int errorno);
-/* Abort the parallel run */
-
 #ifdef GMX_DOUBLE
 #define gmx_sum       gmx_sumd
 #define gmx_sum_sim   gmx_sumd_sim
@@ -142,6 +113,24 @@ void gmx_abort(int nodeid, int nnodes, int errorno);
 #define gmx_sum_sim   gmx_sumf_sim
 #endif
 
+gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr);
+/* Return TRUE when fname exists, FALSE otherwise, bcast from master to others */
+
+void
+gmx_fatal_collective(int f_errno, const char *file, int line,
+                     const t_commrec *cr, gmx_domdec_t *dd,
+                     const char *fmt, ...);
+/* As gmx_fatal declared in utility/fatalerror.h,
+ * but only the master process prints the error message.
+ * This should only be called one of the following two situations:
+ * 1) On all nodes in cr->mpi_comm_mysim, with cr!=NULL,dd==NULL.
+ * 2) On all nodes in dd->mpi_comm_all,   with cr==NULL,dd!=NULL.
+ * This will call MPI_Finalize instead of MPI_Abort when possible,
+ * This is useful for handling errors in code that is executed identically
+ * for all processes.
+ */
+
+/* This doesn't currently work if enabled (needs some header cleanup). */
 #ifdef DEBUG_GMX
 #define debug_gmx() do { FILE *fp = debug ? debug : stderr; \
                          if (bDebugMode()) { fprintf(fp, "NODEID=%d, %s  %d\n", gmx_mpi_initialized() ? gmx_node_rank() : -1, __FILE__, __LINE__); } fflush(fp); } while (0)
index dafbfa9f6e7fe64e68da0df51d58d87663095ede..24e1bc8042de3774204a83740d56be9647f7f7dc 100644 (file)
@@ -39,7 +39,7 @@
 #define _ns_h
 
 #include <stdio.h>
-#include "sysstuff.h"
+
 #include "typedefs.h"
 #include "pbc.h"
 #include "tgroup.h"
index deb1bfe7f121985f6bb818698052ec1f3bb4d6a9..1a6b17ef92cd6008a84b7e163e0996debe3d1693 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef _orires_h
 #define _orires_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index be7e51fa9e421344d1dea33f5f1fe409873ab068..eca121f79dfc575f5141ca8576db7fd2f0ee9ae8 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef _types_pbc_h
 #define _types_pbc_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index d00179a4ad11f46e552df6ab96084e639c8d1906..2f620af8da73a55183a5c5761b69378895a963e0 100644 (file)
 extern "C" {
 #endif
 
-/*! Allocates nbytes of page-locked memory. */
+/** Allocates nbytes of page-locked memory. */
 void pmalloc(void gmx_unused **h_ptr, size_t gmx_unused nbytes) FUNC_TERM
 
-/*! Allocates nbytes of page-locked memory with write-combining. */
+/** Allocates nbytes of page-locked memory with write-combining. */
 void pmalloc_wc(void gmx_unused **h_ptr, size_t gmx_unused nbytes) FUNC_TERM
 
-/*! Frees page locked memory allocated with pmalloc. */
+/** Frees page locked memory allocated with pmalloc. */
 void pfree(void gmx_unused *h_ptr) FUNC_TERM
 
 #ifdef __cplusplus
index 72f5b4ce1c2f1c880eb16786eace4d58d27c3217..f8ff166fea35cf0eba8a462bd6cdf7c5f06dda96 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,9 +38,7 @@
 #ifndef _rbin_h
 #define _rbin_h
 
-#include "sysstuff.h"
 #include "typedefs.h"
-#include "network.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/gromacs/legacyheaders/sysstuff.h b/src/gromacs/legacyheaders/sysstuff.h
deleted file mode 100644 (file)
index 7eeb697..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef _sysstuff_h
-#define _sysstuff_h
-
-#ifndef _386_
-#include <stdlib.h>
-#endif
-#include <stdio.h>
-#include <errno.h>
-#include <signal.h>
-#include <limits.h>
-#include <time.h>
-
-#endif  /* _sysstuff_h */
index eb0b30b563c2d483007ebd35005b6e60da41838e..92f883b1b6c52cce6e007f4464479b9b1ed2fd8f 100644 (file)
@@ -43,7 +43,7 @@
 #define NOTSET -12345
 
 #include <sys/types.h>
-#include "sysstuff.h"
+
 #include "types/simple.h"
 #include "types/enums.h"
 #include "types/block.h"
index 3f463dcd53443547f885c9b8df131a04a3dcb85e..3380b12b50f13b677fb6a0c7923eb1b8ad612731 100644 (file)
 #ifndef _inputrec_h_
 #define _inputrec_h_
 
+#include <stdio.h>
 
 #include "simple.h"
 #include "enums.h"
-#include "../sysstuff.h"
 #include "../../swap/enums.h"
 
 #ifdef __cplusplus
index aaeeaa8b3616d2603c4e84dd64d90cdc96e5632a..e1e8ab0ca82bcc8b85469e79686039191c4b6262 100644 (file)
@@ -44,7 +44,7 @@ extern "C" {
 #endif
 
 
-/*! Nonbonded NxN kernel types: plain C, CPU SIMD, GPU CUDA, GPU emulation */
+/** Nonbonded NxN kernel types: plain C, CPU SIMD, GPU CUDA, GPU emulation */
 typedef enum
 {
     nbnxnkNotSet = 0,
@@ -56,7 +56,7 @@ typedef enum
     nbnxnkNR
 } nbnxn_kernel_type;
 
-/*! Return a string indentifying the kernel type */
+/** Return a string indentifying the kernel type */
 const char *lookup_nbnxn_kernel_name(int kernel_type);
 
 enum {
index f00da633cb59f22468413daa2b2c068bff50fca1..2aba62292def0249c548826a1baadcd486bda6de 100644 (file)
 #ifndef _simple_h
 #define _simple_h
 
-/* Information about integer data type sizes */
-#include <limits.h>
-#define __STDC_LIMIT_MACROS
-#include <stdint.h>
-#ifndef _MSC_VER
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-#endif
+#include "../../utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -54,39 +47,10 @@ extern "C" {
 }
 #endif
 
-
-#define XX      0           /* Defines for indexing in */
-#define YY      1           /* vectors                 */
+#define XX      0                 /* Defines for indexing in */
+#define YY      1                 /* vectors                 */
 #define ZZ      2
-#define DIM     3           /* Dimension of vectors            */
-#define XXXX    0           /* defines to index matrices */
-#define XXYY    1
-#define XXZZ    2
-#define YYXX    3
-#define YYYY    4
-#define YYZZ    5
-#define ZZXX    6
-#define ZZYY    7
-#define ZZZZ    8
-
-/* There is no standard size for 'bool' in C++, so when
- * we previously defined it to int for C code the data types
- * (and structs) would have different size depending on your compiler,
- * both at gromacs build time and when you use the library.
- * The only way around this is to NOT assume anything about the C++ type,
- * so we cannot use the name 'bool' in our C code anymore.
- */
-
-typedef int gmx_bool;
-
-#ifndef FALSE
-#  define FALSE   0
-#endif
-#ifndef TRUE
-#  define TRUE    1
-#endif
-#define BOOL_NR 2
-
+#define DIM     3                 /* Dimension of vectors    */
 
 typedef int         atom_id;      /* To indicate an atoms id         */
 #define NO_ATID     (atom_id)(~0) /* Use this to indicate invalid atid */
@@ -149,95 +113,6 @@ typedef int             ivec[DIM];
 
 typedef int             imatrix[DIM][DIM];
 
-#ifdef _MSC_VER
-typedef __int32 gmx_int32_t;
-#define GMX_PRId32 "I32d"
-#define GMX_SCNd32 "I32d"
-
-typedef __int64 gmx_int64_t;
-#define GMX_PRId64 "I64d"
-#define GMX_SCNd64 "I64d"
-
-typedef unsigned __int32 gmx_uint32_t;
-#define GMX_PRIu32 "I32u"
-#define GMX_SCNu32 "I32u"
-
-typedef unsigned __int64 gmx_uint64_t;
-#define GMX_PRIu64 "I64u"
-#define GMX_SCNu64 "I64u"
-#else
-typedef int32_t gmx_int32_t;
-#define GMX_PRId32 PRId32
-#define GMX_SCNd32 SCNd32
-
-typedef int64_t gmx_int64_t;
-#define GMX_PRId64 PRId64
-#define GMX_SCNd64 SCNd64
-
-typedef uint32_t gmx_uint32_t;
-#define GMX_PRIu32 PRIu32
-#define GMX_SCNu32 SCNu32
-
-typedef uint64_t gmx_uint64_t;
-#define GMX_PRIu64 PRIu64
-#define GMX_SCNu64 SCNu64
-#endif
-
-#define GMX_INT32_MAX INT32_MAX
-#define GMX_INT32_MIN INT32_MIN
-
-#define GMX_INT64_MAX INT64_MAX
-#define GMX_INT64_MIN INT64_MIN
-
-#define GMX_UINT32_MAX UINT32_MAX
-#define GMX_UINT32_MIN UINT32_MIN
-
-#define GMX_UINT64_MAX UINT64_MAX
-#define GMX_UINT64_MIN UINT64_MIN
-
-#if !defined __cplusplus && _MSC_VER
-#define gmx_inline __inline
-#else
-/* C++ or C99 */
-#define gmx_inline inline
-#endif
-
-/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
- * Any other compiler can be added here. We cannot
- * use restrict because it is in C99 but not in C++ */
-#define gmx_restrict __restrict
-
-/*
- * These attributes suppress compiler warnings about unused function arguments
- * by marking them as possibly unused. Some arguments are unused but
- * have to be retained to preserve a function signature
- * that must match that of another function.
- * Some arguments are only used in *some* code paths (e.g. MPI)
- */
-
-#ifndef gmx_unused
-#ifdef __GNUC__
-/* GCC, clang, and some ICC pretending to be GCC */
-#  define gmx_unused __attribute__ ((unused))
-#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && !defined(_MSC_VER)
-/* ICC on *nix */
-#  define gmx_unused __attribute__ ((unused))
-#elif defined _MSC_VER
-/* MSVC */
-#  define gmx_unused /*@unused@*/
-#elif defined(__xlC__)
-/* IBM */
-#  define gmx_unused __attribute__ ((unused))
-#else
-#  define gmx_unused
-#endif
-#endif
-
-/* Standard sizes for char* string buffers */
-#define STRLEN 4096
-#define BIG_STRLEN 1048576
-
-
 #ifdef __cplusplus
 }
 #endif
index affebb924fa492e5f3eae6a5325d7e5d37c64b64..c11f77c87aed5c74a36b1924f2cddf10bb0c0ff0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,8 @@
 #ifndef _vcm_h
 #define _vcm_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index a14dc49dc90f77eb7e1d36c1cbba72adde3f3ea2..8687faa88c9f10ee3bd3c85f04028423431d08ab 100644 (file)
 #include <config.h>
 #endif
 
+#include <math.h>
+
 #include "types/simple.h"
-#include "../math/utilities.h"
 #include "typedefs.h"
-#include "sysstuff.h"
-#include "gmx_fatal.h"
-#include <math.h>
 #include "physics.h"
 
+#include "../math/utilities.h"
+#include "../utility/fatalerror.h"
+
 #ifdef __cplusplus
 extern "C" {
 #elif 0
index 04fad52e556a0a1224e79ccdbcd89d0e12a65b1c..64359dfd620219b600115e24912b45269978d39f 100644 (file)
 #ifndef _viewit_h
 #define _viewit_h
 
-#include "typedefs.h"
+#include "types/oenv.h"
 #include "../fileio/filenm.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
 void do_view(const output_env_t oenv, const char *fn, const char *opts);
 /* forks off appropriate command to view file.
  * currently eps, xpm, xvg and pdb are supported
index a0221be3c7a95407a2eb791659687c6223aaa21f..06af5423c2c239fc452a5740976e6be32b341499 100644 (file)
@@ -37,9 +37,9 @@
 #include "eigensolver.h"
 
 #include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
 
 #include "gromacs/linearalgebra/sparsematrix.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "gmx_lapack.h"
index ccbd22ec19a4e4b248ee3ad7ac60a8498040cf28..eda4e452cbef8987e9d4e0f665342c99a2d68bd0 100644 (file)
@@ -42,9 +42,9 @@
 
 #include <stdio.h>
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
 #include "gromacs/legacyheaders/vec.h"
 
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "gmx_lapack.h"
index 0a82d271c600941c7e831ddf2e527162977fc9d0..a446feed9b9fae5f63c9b061d227bc2134b41659 100644 (file)
  */
 
 #include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xdrf.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
-
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 /* Just a number to identify our file type */
index b5cf7066b4612f26ce79b0962fa8621b6c8a9329..485f1ad973fe7fb1ce21c4fdd58e3bd1ce913f1a 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <math.h>
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 static gmx_inline
index 5e8a06c41e7f1ad8d8926caef273ae9f596fdb13..0d09032362e41ef41bf932e4fd32ec5dcf36536d 100644 (file)
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "physics.h"
 #include "pbc.h"
 #include "vec.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define N 4
 
index 9701f769ab30982c3063c8c84012b2cc89ace86a..c2b10b9b308191688c40a2e5f6db1db180a1e691 100644 (file)
 #include "do_fit.h"
 
 #include "gromacs/math/utilities.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "vec.h"
 #include "txtdump.h"
 
 #include "gromacs/linearalgebra/nrjac.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 real calc_similar_ind(gmx_bool bRho, int nind, atom_id *index, real mass[],
index c6db48d9a3759fc0926da3b9b443524004bec769..12601d4ead2af6726e3eed033722b280a9591169 100644 (file)
@@ -144,9 +144,9 @@ gmx_numzero(double a);
 unsigned int
 gmx_log2i(unsigned int x);
 
-/*! /brief Multiply two large ints
+/*! \brief Multiply two large ints
  *
- *  \return False iff overflow occured
+ * \return False iff overflow occured
  */
 gmx_bool
 check_int_multiply_for_overflow(gmx_int64_t  a,
index d2ac44d54c0c68a89ee35cdb7a2d92850cbfb5e8..ba290c1431ea76786bccf45b25eb0fd198219ece 100644 (file)
@@ -41,7 +41,7 @@
 #include "typedefs.h"
 #include "vec.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 real
 adress_weight(rvec                 x,
index 3a2dc0b1a2c688bf85585771b2fc4b2c5dc2dc80..27e3065070607f8ee8bf8b59946b5196c5aac957 100644 (file)
@@ -46,7 +46,6 @@
 #include "network.h"
 #include "vec.h"
 #include "physics.h"
-#include "main.h"
 #include "calcmu.h"
 #include "gmx_omp_nthreads.h"
 
index 395b9c38f5200c0adcf27ca83f3ec67957802a69..7eebb8768c2628e4ad99cfd18942ccc019ca34cf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "force.h"
 #include "vec.h"
 #include "mshift.h"
 #include "macros.h"
 
+#define XXXX    0
+#define XXYY    1
+#define XXZZ    2
+#define YYXX    3
+#define YYYY    4
+#define YYZZ    5
+#define ZZXX    6
+#define ZZYY    7
+#define ZZZZ    8
+
 static void upd_vir(rvec vir, real dvx, real dvy, real dvz)
 {
     vir[XX] -= 0.5*dvx;
index d215cbdac63273fe065b56b4cde398c0de98866a..01e30da5325f16b4323ffdaab1e164646cb603b3 100644 (file)
 #endif
 
 #include <math.h>
-#include "main.h"
+#include <stdlib.h>
+
+#include "types/commrec.h"
 #include "constr.h"
 #include "copyrite.h"
 #include "physics.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/utility/smalloc.h"
 #include "mdrun.h"
 #include "nrnb.h"
 #include "domdec.h"
@@ -54,8 +55,9 @@
 #include "gmx_omp_nthreads.h"
 
 #include "gromacs/fileio/gmxfio.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int    b0;         /* first constraint for this thread */
index 1f5addc99b990da065e764d3c2095f16f9f982eb..aac7cc7d54ac9f597501c11dd662db9bc3b92910 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
+
 #include "gromacs/fileio/confio.h"
 #include "types/commrec.h"
 #include "constr.h"
 #include "copyrite.h"
 #include "invblock.h"
-#include "main.h"
 #include "mdrun.h"
 #include "nrnb.h"
 #include "gromacs/utility/smalloc.h"
@@ -61,7 +62,7 @@
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/pulling/pull.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct gmx_constr {
     int                ncon_tot;       /* The total number of constraints    */
index c0ca0111489f07271b62b622fcd873924eca4c7a..3a3b71a9a6a6a9c6cb24aa663ad102703747500d 100644 (file)
@@ -47,7 +47,7 @@
 #include "macros.h"
 #include "physics.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "txtdump.h"
 #include "nrnb.h"
 #include "gromacs/random/random.h"
index 281f3973c2aa9721df5bf717be24d554b3d9a474..68f9b3268f10502b49b7fabfbb6929bd4b2be8fe 100644 (file)
@@ -42,7 +42,7 @@
 #include <stdio.h>
 #include "vec.h"
 #include "constr.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "pbc.h"
 
index f83d241e09742d5bea2935661e6b5ffe0d3aaf79..8760f143aa7ca8cb5656d1ea081cb6f5e7806bad 100644 (file)
@@ -46,8 +46,8 @@
 
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "gmx_fatal_collective.h"
+#include "gromacs/utility/fatalerror.h"
+#include "network.h"
 #include "vec.h"
 #include "domdec.h"
 #include "domdec_network.h"
 #include "gmx_omp_nthreads.h"
 #include "gpu_utils.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/pdbio.h"
+#include "gromacs/imd/imd.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/pulling/pull_rotation.h"
+#include "gromacs/swap/swapcoords.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/gmxmpi.h"
-#include "gromacs/swap/swapcoords.h"
 #include "gromacs/utility/qsort_threadsafe.h"
-#include "gromacs/pulling/pull.h"
-#include "gromacs/pulling/pull_rotation.h"
-#include "gromacs/imd/imd.h"
 
 #define DDRANK(dd, rank)    (rank)
 #define DDMASTERRANK(dd)   (dd->masterrank)
index 6b20dd987c3a58d475fecb4c4b49a6899a605579..1302ffec3b0dd0cc301578faaf1567a12ee2cd3b 100644 (file)
@@ -46,7 +46,7 @@
 #include "nsgrid.h"
 #include "network.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 static void calc_cgcm_av_stddev(t_block *cgs, int n, rvec *x, rvec av, rvec stddev,
                                 t_commrec *cr_sum)
index d79ffb5065988f0cd9dd9fb8af448a275da60401..c09ec52fdd5e76f9b7ed015dfdf9dc7fe09fb927 100644 (file)
@@ -50,7 +50,7 @@
 #include "gmx_omp_nthreads.h"
 #include "macros.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 typedef struct {
     int  nsend;
index 8aa77bfb6aa21c3c14d196339775c7979a486509..1e361293125f83407a64610ce6c41e14ee1f1766 100644 (file)
@@ -38,8 +38,8 @@
 #endif
 
 #include <string.h>
+
 #include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
 #include "types/commrec.h"
 #include "domdec.h"
 #include "domdec_network.h"
@@ -56,7 +56,9 @@
 #include "force.h"
 #include "gmx_omp_nthreads.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* for dd_init_local_state */
 #define NITEM_DD_INIT_LOCAL_STATE 5
index 4760fcf32e1ea8d2397a16551d0b29c3200d42b9..88466da73a2f451aa6104b5f59603ce13186e55d 100644 (file)
 
 #include <math.h>
 #include <string.h>
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "ebin.h"
-#include "main.h"
 #include "gromacs/math/utilities.h"
 #include "vec.h"
 #include "physics.h"
index 9a12d41e884c51b9c52b1573aba8762d46010cb4..4992003fa07443ee6346b7b0bf1b46cf490489cf 100644 (file)
 #include <config.h>
 #endif
 
-#include <stdio.h>
 #include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "vec.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "physics.h"
 #include "coulomb.h"
 #include "macros.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/math/gmxcomplex.h"
 
 #define TOL 2e-5
index 14d0e7ea3d3a23ef7227d323928affa55e8e17e5..c2baf6ba27809b17e06c73ff442b2334e373d9db 100644 (file)
@@ -51,7 +51,6 @@
 #include "mdrun.h"
 #include "update.h"
 #include "physics.h"
-#include "main.h"
 #include "mdatoms.h"
 #include "force.h"
 #include "bondf.h"
@@ -61,7 +60,6 @@
 #include "network.h"
 #include "calcmu.h"
 #include "constr.h"
-#include "xvgr.h"
 #include "gromacs/random/random.h"
 #include "domdec.h"
 #include "macros.h"
@@ -71,7 +69,7 @@
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/timing/wallcycle.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
 
 static void init_df_history_weights(df_history_t *dfhist, t_expanded *expand, int nlim)
index 0726402913b01bb5d6f79fc79317132f73680163..951170911fd1362aaeae86f7e1e46ab6ba5f793d 100644 (file)
@@ -41,7 +41,6 @@
 #include <math.h>
 #include <string.h>
 #include <assert.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
@@ -65,7 +64,7 @@
 #include "gmx_omp_nthreads.h"
 
 #include "gromacs/timing/wallcycle.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 void ns(FILE              *fp,
         t_forcerec        *fr,
index 67cd36f34184ba820b4ab4a6196dd56fc135078a..5594c6a6223079cccbb416c96d33ff2fb35f79c8 100644 (file)
@@ -41,7 +41,6 @@
 #include <math.h>
 #include <string.h>
 #include <assert.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "vec.h"
@@ -49,7 +48,7 @@
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "physics.h"
 #include "force.h"
 #include "tables.h"
index 6c20080c5f8a5ee44823975b91a53f776c416eb8..559169659298c40f504d71f5c0955f8a93ca2837 100644 (file)
@@ -52,7 +52,7 @@
 #include "physics.h"
 #include "domdec.h"
 #include "network.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "mtop_util.h"
 #include "pbc.h"
 #include "nrnb.h"
index 7e71bf8ba437977065a6fd0ada88a1917f1c0bec..345933f3e4b2b64dfac228e95eaa6dc9e113479c 100644 (file)
@@ -50,7 +50,7 @@
 #include "physics.h"
 #include "domdec.h"
 #include "network.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "mtop_util.h"
 #include "genborn.h"
 
index 95fa0cdc40a9fe2927aa548b790fa60ab3669f08..8e1b69bc89588514936dc862efd32c8ecb864506 100644 (file)
@@ -50,7 +50,7 @@
 #include "physics.h"
 #include "domdec.h"
 #include "network.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "mtop_util.h"
 #include "genborn.h"
 
index 95516341f8b957d79e02e317f8f7cdd55f6db0c4..0504d07a07916da83f71aaace2102a849531f145 100644 (file)
@@ -43,9 +43,8 @@
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/utility/smalloc.h"
 #include "vec.h"
-#include "main.h"
 #include "mvdata.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "symtab.h"
 #include "txtdump.h"
 #include "mdatoms.h"
index 5c3529f0f028162abfec9edef6ee5f94873659a1..f3f37a40eba2f7d0afc9c86bc5b3cc679434bb95 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -40,7 +40,7 @@
 
 #include <math.h>
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "mdrun.h"
 #include "md_support.h"
 #include "md_logging.h"
index 9c0c5943d54f139e40b6629a308b2d59955a2734..4f90b613478202d2bd136950ef101264aa74448f 100644 (file)
@@ -43,7 +43,6 @@
 #include "typedefs.h"
 #include "mdatoms.h"
 #include "gromacs/utility/smalloc.h"
-#include "main.h"
 #include "qmmm.h"
 #include "mtop_util.h"
 #include "gmx_omp_nthreads.h"
index 5ef8b7d79a98ca52491ca4e5782f34fc8ac3ea24..106161d8c0310186b3bdef22eea564fe02f30677 100644 (file)
 #include <config.h>
 #endif
 
-#include <string.h>
 #include <float.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "typedefs.h"
 #include "mdebin.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/fileio/enxio.h"
 #include "vec.h"
 #include "disre.h"
-#include "main.h"
 #include "network.h"
 #include "names.h"
 #include "orires.h"
 #include "constr.h"
 #include "mtop_util.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "macros.h"
 #include "mdrun.h"
index 9f057bd6fd4126dda7848c64f8149e4a3c01f354..84b602cf809d074bd6197f1760b3c242aee9cb76 100644 (file)
@@ -42,7 +42,7 @@
 #include <float.h>
 #include <math.h>
 #include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "mdebin.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/fileio/enxio.h"
index 05d40bca5dedc434c1da51231aa034a26bac7728..ff73269d75e3fbec51650c3008b6088eb490bc04 100644 (file)
 #include <string.h>
 #include <time.h>
 #include <math.h>
-#include "sysstuff.h"
 #include "gromacs/utility/cstringutil.h"
 #include "network.h"
 #include "gromacs/utility/smalloc.h"
 #include "nrnb.h"
-#include "main.h"
 #include "force.h"
 #include "macros.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "update.h"
index 68365412121494b5daeab85794965ca63608977c..84a1c761032e76bd1694f1c7c955ddd5b016f65f 100644 (file)
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
-#include <assert.h>
-#include "gromacs/utility/smalloc.h"
+
 #include "macros.h"
 #include "vec.h"
 #include "nbnxn_consts.h"
 #include "nbnxn_internal.h"
 #include "nbnxn_atomdata.h"
 #include "nbnxn_search.h"
-#include "gromacs/utility/gmxomp.h"
 #include "gmx_omp_nthreads.h"
 #include "thread_mpi/atomic.h"
 
+#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
+
 /* Default nbnxn allocation routine, allocates NBNXN_MEM_ALIGN byte aligned */
 void nbnxn_alloc_aligned(void **ptr, size_t nbytes)
 {
index 440c074db3b9518cfb2da8b8769e7084f6464be8..b57ceea04d42ae0b2590acb9c87f4697f161a93d 100644 (file)
@@ -61,6 +61,8 @@
 #include "nbnxn_cuda.h"
 #include "nbnxn_cuda_data_mgmt.h"
 
+#include "gromacs/utility/cstringutil.h"
+
 #if defined TEXOBJ_SUPPORTED && __CUDA_ARCH__ >= 300
 #define USE_TEXOBJ
 #endif
index 994738f627a94ba99c359e15041b37d702fdfb89..c1945b58ef7ad20df6db35bb88380021304b1b07 100644 (file)
@@ -53,7 +53,9 @@
 extern "C" {
 #endif
 
-/*! Launch asynchronously the nonbonded force calculations.
+/*! \brief
+ * Launch asynchronously the nonbonded force calculations.
+ *
  *  This consists of the following (async) steps launched:
  *  - upload x and q;
  *  - upload shift vector;
@@ -66,16 +68,18 @@ void nbnxn_cuda_launch_kernel(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
                               int                    gmx_unused  flags,
                               int                    gmx_unused  iloc) FUNC_TERM
 
-/*! Launch asynchronously the download of nonbonded forces from the GPU
- *  (and energies/shift forces if required).
+/*! \brief
+ * Launch asynchronously the download of nonbonded forces from the GPU
+ * (and energies/shift forces if required).
  */
 void nbnxn_cuda_launch_cpyback(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
                                const nbnxn_atomdata_t gmx_unused *nbatom,
                                int                    gmx_unused  flags,
                                int                    gmx_unused  aloc) FUNC_TERM
 
-/*! Wait for the asynchronously launched nonbonded calculations and data
- *  transfers to finish.
+/*! \brief
+ * Wait for the asynchronously launched nonbonded calculations and data
+ * transfers to finish.
  */
 void nbnxn_cuda_wait_gpu(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
                          const nbnxn_atomdata_t gmx_unused *nbatom,
index 4ba5acfb23c5d6a3ff582f928661b4c2843611cf..f2886e625fc9366001be40a29a221e7c6a806d5c 100644 (file)
@@ -43,8 +43,6 @@
 
 #include <cuda.h>
 
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
 #include "tables.h"
 #include "typedefs.h"
 #include "types/enums.h"
@@ -61,6 +59,9 @@
 #include "gpu_utils.h"
 
 #include "gromacs/utility/common.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */
 
index 1ac1bf54197b72c8f86bb80d24bd711d9cd5d26e..ed2ffcdc22e14c3f0cff8e089013c8e19eacd69b 100644 (file)
@@ -49,7 +49,7 @@
 #include "../nbnxn_kernel_common.h"
 #include "gmx_omp_nthreads.h"
 #include "types/force_flags.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
  */
@@ -116,7 +116,7 @@ reduce_group_energies(int ng, int ng_2log,
 
 #else /* {0} */
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #endif /* {0} */
 
index 45f09bc4621d64d900ba6c9fc66effead4372743..ffb0670fa59c9469a821d48f7f3e257f6d6e0fa5 100644 (file)
@@ -59,7 +59,7 @@
 #include "../nbnxn_kernel_common.h"
 #include "gmx_omp_nthreads.h"
 #include "types/force_flags.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
  */
@@ -252,7 +252,7 @@ reduce_group_energies(int ng, int ng_2log,
 
 #else /* GMX_NBNXN_SIMD_2XNN */
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
index 17608af2e7037a7fa46f647413d213f09036ada8..3cd1cce93b74de3f91a4e0b3c6041d780f2b7a30 100644 (file)
@@ -57,7 +57,7 @@
 #include "../nbnxn_kernel_common.h"
 #include "gmx_omp_nthreads.h"
 #include "types/force_flags.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
  */
@@ -250,7 +250,7 @@ reduce_group_energies(int ng, int ng_2log,
 
 #else /* GMX_NBNXN_SIMD_4XN */
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #endif /* GMX_NBNXN_SIMD_4XN */
 
index a2fe52a902444d28aed1f1bfde137d8bde2082a6..392ba8cb583ea1529139c15f5846ccd99b7cb5c8 100644 (file)
@@ -41,7 +41,6 @@
 #include <string.h>
 #include <assert.h>
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "types/commrec.h"
 #include "macros.h"
index d2f7401295fbf079611ea9d8730ab62e14c789d6..f5266aace7b40ddcf4014bb010657e119f019ee4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -40,7 +40,7 @@
 
 #include "typedefs.h"
 #include "types/nlistheuristics.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 
 void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_int64_t step)
index 5208983deccab7cc9b8e44c25ab7ba293a59f4cb..3a36007d646c926fd1b39e3a47e69a6ddf78eacf 100644 (file)
@@ -39,8 +39,9 @@
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
-#include "sysstuff.h"
+
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gromacs/math/utilities.h"
@@ -53,7 +54,7 @@
 #include "ns.h"
 #include "pbc.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "nrnb.h"
 #include "txtdump.h"
 #include "mtop_util.h"
index 137b06f25559d6ef13d92f79586b1e2e76dc9a69..b709a1eecac976f088b06d9614d842a79f61d8e5 100644 (file)
 
 #include <stdlib.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
 #include "nsgrid.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "network.h"
 #include "domdec.h"
 #include "pbc.h"
 #include <stdio.h>
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/pdbio.h"
 
 /***********************************
index 17eb6482d157f672699247b292b494a0eaf78cd6..6259694f81145733a96873736ff2f618ef4e7d1c 100644 (file)
 #include <config.h>
 #endif
 
+#include <assert.h>
+#include <math.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <math.h>
-#include <assert.h>
+
 #include "typedefs.h"
 #include "txtdump.h"
 #include "vec.h"
 #include "gromacs/utility/smalloc.h"
 #include "coulomb.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "pme.h"
 #include "network.h"
 #include "physics.h"
@@ -78,7 +80,7 @@
 #include "macros.h"
 
 #include "gromacs/fft/parallel_3dfft.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/math/gmxcomplex.h"
 #include "gromacs/timing/cyclecounter.h"
index 7ed29b31171710a7b1ec89178562095287f6c32f..ddaeba64aceda71512d0fef44e107bf4922aa179 100644 (file)
@@ -46,7 +46,7 @@
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "pme.h"
 #include "network.h"
index d3ba4ac4ab0a17e6b6f851d9f22f35cdfcd21cd9..c3b92a041f37560ad8a5c1cc86e8d0eeef4d1c2e 100644 (file)
@@ -41,7 +41,6 @@
 #ifdef GMX_QMMM_GAMESS
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
@@ -62,7 +61,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
index 8e96ec739ab7874a63550927b66485e8ec13c657..72df479b44df993f8e1b3febf1c489d249712c7d 100644 (file)
@@ -41,7 +41,6 @@
 #ifdef GMX_QMMM_GAUSSIAN
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
@@ -62,7 +61,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
index 760e4e00589779fbf2ca03dca0be1ae3e384b7bf..bb68fc53549d5acfecd1a79467227f19581ecd01 100644 (file)
@@ -41,7 +41,6 @@
 #ifdef GMX_QMMM_MOPAC
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
@@ -62,7 +61,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
index db48238ff0e49722e742b0722a1ebaee3a54ee09..7b58d28c20f9e7a06253464bb0495b7e88843f41 100644 (file)
@@ -39,7 +39,6 @@
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
@@ -60,7 +59,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
index ad0b66e387d61550cb38c4e338b684b08ac5ecbb..71df3d78d22781b1c987e1f45e6eb9423ab8532f 100644 (file)
@@ -39,7 +39,6 @@
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "macros.h"
@@ -61,7 +60,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "typedefs.h"
 #include <stdlib.h>
 #include "mtop_util.h"
index ede7ace0bae5731feb3a596b6d0ecaffda9f78ea..98c1636c3f24b2b89d2edf77a6df2522394f964b 100644 (file)
@@ -38,7 +38,6 @@
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "force.h"
 #include "names.h"
index ab09ea47b7afd7b1bd1f84b23cce2f622d93eaf2..f3a459a58a11a2104ca0fa0255f58d069f5520fa 100644 (file)
@@ -39,7 +39,6 @@
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "pbc.h"
index 531b88b61673dc519f888287f881b43600db2a5b..1121ee28228daf3e4c1c520662a37f5b703f6c3b 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
+
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "vec.h"
 #include "txtdump.h"
 #include "force.h"
index 8155c99ee75af15dc463944b453cdb0d627e4c2b..7358793df7d0965a54e8d6273741c9babbf1c5d5 100644 (file)
@@ -60,7 +60,6 @@
 #include "sim_util.h"
 #include "update.h"
 #include "physics.h"
-#include "main.h"
 #include "mdatoms.h"
 #include "force.h"
 #include "bondf.h"
@@ -70,7 +69,6 @@
 #include "network.h"
 #include "calcmu.h"
 #include "constr.h"
-#include "xvgr.h"
 #include "copyrite.h"
 #include "domdec.h"
 #include "genborn.h"
index 393e4fe8840720bc125847f1e4196e5db61ff350..3d16a16e514066f04f9c6b7fd2c9f8a5b5fb41c2 100644 (file)
 #include <stdio.h>
 #include "typedefs.h"
 #include "types/commrec.h"
-#include "sysstuff.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "network.h"
 #include "txtdump.h"
 #include "names.h"
 #include "physics.h"
 #include "vec.h"
 #include "gromacs/math/utilities.h"
-#include "main.h"
 #include "force.h"
 #include "vcm.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "network.h"
 #include "rbin.h"
 #include "tgroup.h"
@@ -64,7 +62,6 @@
 #include "domdec.h"
 #include "constr.h"
 #include "checkpoint.h"
-#include "xvgr.h"
 #include "md_support.h"
 #include "mdrun.h"
 #include "sim_util.h"
index ff73a90e89e5452f64cc7feb7d4f570675ac2011..6d8aff2040e81a1637ec2cd740d32cd7914d32b7 100644 (file)
 #include "typedefs.h"
 #include "names.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/fileio/xvgr.h"
 #include "vec.h"
-#include "main.h"
 #include "network.h"
 #include "physics.h"
 #include "force.h"
index cd32b2477b56b8e75e481b042602e96f3e0ad10f..2b359cec445aaf76354c2d038e705782fafbdf21 100644 (file)
@@ -42,9 +42,8 @@
 
 #include <math.h>
 #include "macros.h"
-#include "main.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "tgroup.h"
 #include "vec.h"
 #include "network.h"
index 72a6901f9e221778df7c9781305f0ddf1b7bf3d0..479df9b44d4e9f8cb6297c68051b7bc65e579c9c 100644 (file)
 #include <config.h>
 #endif
 
+#include <math.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include <math.h>
-#include "sysstuff.h"
+
 #include "network.h"
 #include "gromacs/utility/smalloc.h"
 #include "nrnb.h"
-#include "main.h"
 #include "chargegroup.h"
 #include "force.h"
 #include "macros.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "update.h"
@@ -64,7 +64,7 @@
 #include "domdec.h"
 #include "gromacs/random/random.h"
 #include "physics.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "mdatoms.h"
 #include "ns.h"
 #include "mtop_util.h"
index 0f96a357777491f7a468907277b86a1426224cfd..9039d6d383b20aa68ee40a4a7fd2cca47b23fcbc 100644 (file)
 #include <math.h>
 
 #include "types/commrec.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "nrnb.h"
 #include "physics.h"
 #include "macros.h"
 #include "vec.h"
-#include "main.h"
 #include "update.h"
 #include "gromacs/random/random.h"
 #include "mshift.h"
@@ -65,7 +63,7 @@
 #include "gmx_omp_nthreads.h"
 
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/pulling/pull.h"
index 7ad217f4a5cae44f14ecd28358ec664185f51b3e..c41dacff63842baef82a04599a9bdabfbe54efe7 100644 (file)
@@ -39,7 +39,9 @@
 #endif
 
 #include <stdio.h>
+
 #include "typedefs.h"
+#include "types/commrec.h"
 #include "vsite.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
index 85a74eb4aef035394a95ba6b97b3be308294bca1..f7e28280cb31a92d28ea3996220fec9d9b2d6572 100644 (file)
 
 #include <math.h>
 #include <string.h>
-#include "gromacs/math/utilities.h"
-#include "sysstuff.h"
+
 #include "typedefs.h"
 #include "macros.h"
-#include "gromacs/utility/smalloc.h"
 #include "force.h"
-#include "gromacs/fileio/filenm.h"
 #include "nrnb.h"
 #include "vec.h"
 
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
+
 void make_wall_tables(FILE *fplog, const output_env_t oenv,
                       const t_inputrec *ir, const char *tabfn,
                       const gmx_groups_t *groups,
index eb99f7a3a4491854facafbfd6f8c1a2ae35bfc67..23efb06dbf30431a22d8a95c911b4a9ad98a1dc3 100644 (file)
@@ -46,9 +46,9 @@
 #include "types/commrec.h"
 #include "ns.h"
 #include "nrnb.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "names.h"
 #include "domdec.h"
 #include "gromacs/fileio/gmxfio.h"
index e733ad876019ac37cf8d3fc9d3ac9d0b52a78883..35e91cc817ddb6145a87399a97baf1ea5cf5a578 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <string>
 
-#include "../legacyheaders/types/simple.h"
+#include "../utility/basedefinitions.h"
 #include "../utility/gmxassert.h"
 
 #include "abstractoption.h"
index b2200918f8fc8212fee8b46725a698c495e10d00..06813294c2bbb86ed2339d36c0498b1009bea4bd 100644 (file)
@@ -42,7 +42,7 @@
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "index.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "vec.h"
@@ -53,7 +53,7 @@
 #include <string.h>
 #include "gromacs/utility/smalloc.h"
 #include "pull.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "names.h"
 #include "pbc.h"
 #include "mtop_util.h"
index cdee91efff60099565e5ec362f87bbdbe65d522b..d0e953ba433b76ad0a89cacaf85ccbd9aa264e8e 100644 (file)
 #include "names.h"
 #include "vec.h"
 #include "gmx_ga2la.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "copyrite.h"
 #include "macros.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/linearalgebra/nrjac.h"
index 6b30d111b12822545200731016531e58ac677176..1a86423a13388e76bb92eea0a6cdec7fcb67023f 100644 (file)
 
 #include <stdlib.h>
 
-#include "sysstuff.h"
 #include "princ.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "vec.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "names.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "macros.h"
 #include "symtab.h"
 #include "index.h"
index e1a938b3fd6a39c7a813a44841a916056dfcb130..0fa41c0c308cfe732e8833c266d7eb991f1595b4 100644 (file)
@@ -46,12 +46,12 @@ extern "C" {
 #endif
 
 /*! Fixed random number seeds for different types of RNG */
-#define RND_SEED_UPDATE    1 /*!< For coordinate update (sd, bd, ..) */
-#define RND_SEED_REPLEX    2 /*!< For replica exchange */
-#define RND_SEED_VRESCALE  3 /*!< For V-rescale thermostat */
-#define RND_SEED_ANDERSEN  4 /*!< For Andersen thermostat */
-#define RND_SEED_TPI       5 /*!< For test particle insertion */
-#define RND_SEED_EXPANDED  6 /*!< For expanded emseble methods */
+#define RND_SEED_UPDATE    1 /**< For coordinate update (sd, bd, ..) */
+#define RND_SEED_REPLEX    2 /**< For replica exchange */
+#define RND_SEED_VRESCALE  3 /**< For V-rescale thermostat */
+#define RND_SEED_ANDERSEN  4 /**< For Andersen thermostat */
+#define RND_SEED_TPI       5 /**< For test particle insertion */
+#define RND_SEED_EXPANDED  6 /**< For expanded emseble methods */
 
 /*! \brief Abstract datatype for a random number generator
  *
index a46facd626b4ef26e9ef16f8b91d0ea4253743f3..bd14886ca46783840442560f444eb428ddc5e803 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,6 +41,8 @@
  */
 #include "gromacs/selection/centerofmass.h"
 
+#include <errno.h>
+
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/pbc.h"
 #include "gromacs/legacyheaders/vec.h"
index 084577d365ca97fb3adacbec2a720a4327e17809..061c08bc246122752b0688308144082709998b35 100644 (file)
  */
 #include "gromacs/selection/indexutil.h"
 
+#include <cstdlib>
 #include <cstring>
 
 #include <string>
 #include <vector>
 
 #include "gromacs/legacyheaders/index.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
 #include "gromacs/legacyheaders/typedefs.h"
 
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 /********************************************************************
@@ -464,7 +465,7 @@ cmp_atomid(const void *a, const void *b)
 void
 gmx_ana_index_sort(gmx_ana_index_t *g)
 {
-    qsort(g->index, g->isize, sizeof(*g->index), cmp_atomid);
+    std::qsort(g->index, g->isize, sizeof(*g->index), cmp_atomid);
 }
 
 /*!
@@ -844,7 +845,7 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
                         break;
 
                     default: /* Should not be reached */
-                        gmx_bug("internal error");
+                        GMX_RELEASE_ASSERT(false, "Unreachable code was reached");
                         break;
                 }
             }
index 7f4566923dc45d57f5ac53fdb56a28945cc19063..2cecc6442a2028c4f03c3c0da3020670b94f4b07 100644 (file)
 #include <boost/exception_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include "gromacs/fileio/futil.h"
 #include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selmethod.h"
index 09f24e03c5faf90968ef74b3c38fd6c1801f57a8..df91fe990ea54d644c3eaa25525717081d2c49e2 100644 (file)
@@ -50,7 +50,6 @@
 #include <boost/shared_ptr.hpp>
 
 #include "gromacs/legacyheaders/oenv.h"
-#include "gromacs/legacyheaders/xvgr.h"
 
 #include "gromacs/onlinehelp/helpmanager.h"
 #include "gromacs/onlinehelp/helpwritercontext.h"
index 5269fa14e5e403e94814336ca80b6ffb3e9bcbfb..c4f6f776caa1aa353d1ae14dcd62b1a75be866aa 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <math.h>
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \cond libapi */
 /*! \addtogroup module_simd */
index 53a65e984a97cecaf6ffdea03ae8dabe77fc08d7..44b9d356f73166965c38b947a3e2c360033fd199 100644 (file)
@@ -75,7 +75,8 @@
 #endif
 
 #include <stddef.h>
-#include "gromacs/legacyheaders/types/simple.h"
+
+#include "gromacs/utility/basedefinitions.h"
 
 /* Forward declarations so memory allocation can be used in implementations */
 static gmx_inline float *  gmx_simd_align_f(float *p);
index f4af291973c05c94182172955a9cad461ed5373f..0f5c4dcca980276bcbbc0a12acdbbc192fb34ee9 100644 (file)
  * \ingroup module_simd
  */
 #include <vector>
+
 #include <gtest/gtest.h>
-#include "gromacs/simd/simd.h"
 
+#include "gromacs/legacyheaders/types/simple.h"
+
+#include "gromacs/simd/simd.h"
 
 namespace gmx
 {
index d7a38e9b510a01be958a168149fd9b29574de6c6..5ea86fbb8f53fee42b373c71db6987b7013c8f6e 100644 (file)
@@ -55,6 +55,9 @@
  */
 
 #include <gtest/gtest.h>
+
+#include "gromacs/legacyheaders/types/simple.h"
+
 #include "gromacs/simd/simd.h"
 
 namespace
index 38ad0b5036b68b0e2a1be5a6324c9e5e970aa03d..ee8847e8308eff14938fb7fe50f1528bf4d11ea1 100644 (file)
@@ -57,7 +57,7 @@
 #include "names.h"
 #include "network.h"
 #include "mdrun.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "copyrite.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/timing/wallcycle.h"
index 03f726d9d5b5645b1a60269b5188b887727b7e85..ca6e0a88fbc652872fe208d7964e87ef12b44355 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
 #include "md_logging.h"
-#include "gromacs/utility/cstringutil.h"
 
 #include "gromacs/timing/cyclecounter.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
 
 /* DEBUG_WCYCLE adds consistency checking for the counters.
  * It checks if you stop a counter different from the last
index ec256b22730656de4a25d9f39352d96410aab715..bed1ad92191c8af77af6218ea299d1b0170a8289 100644 (file)
@@ -47,8 +47,7 @@
 #include <sys/time.h>
 #endif
 
-#include "gromacs/legacyheaders/types/simple.h"
-
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/smalloc.h"
 
 /* TODO in future: convert gmx_walltime_accounting to a class,
index 641393a0ddac227f50650cace0f90b9ef1c54e17..b80d138d8f724cc45de4ad059a20ab899a2e02ad 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,7 @@
 #ifndef GMX_TIMING_WALLTIME_ACCOUNTING_H
 #define GMX_TIMING_WALLTIME_ACCOUNTING_H
 
-#include "../legacyheaders/types/simple.h"
+#include "../utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -48,8 +48,9 @@ extern "C" {
 }
 #endif
 
-/*! Contains per-process and per-thread data about elapsed wall-clock
- *  times and integration steps performed. */
+/*! \brief
+ * Contains per-process and per-thread data about elapsed wall-clock
+ * times and integration steps performed. */
 typedef struct gmx_walltime_accounting *gmx_walltime_accounting_t;
 
 //! Constructor
@@ -60,18 +61,21 @@ walltime_accounting_init(int numOpenMPThreads);
 void
 walltime_accounting_destroy(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Record initial time stamps, e.g. at run end or counter
- * re-initalization time */
+/*! \brief
+ * Record initial time stamps, e.g. at run end or counter re-initalization time
+ */
 void
 walltime_accounting_start(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Measure and cache the elapsed wall-clock time since
- * walltime_accounting_start */
+/*! \brief
+ * Measure and cache the elapsed wall-clock time since
+ * walltime_accounting_start() */
 void
 walltime_accounting_end(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Measure and return the elapsed wall-clock time since
- * walltime_accounting_start */
+/*! \brief
+ * Measure and return the elapsed wall-clock time since
+ * walltime_accounting_start() */
 double
 walltime_accounting_get_current_elapsed_time(gmx_walltime_accounting_t walltime_accounting);
 
@@ -91,15 +95,16 @@ walltime_accounting_get_start_time_stamp(gmx_walltime_accounting_t walltime_acco
 double
 walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Set the number of integration steps done
+/*! \brief Set the number of integration steps done
  *
  * TODO consider whether this should get done in walltime_accounting_end */
 void
 walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t   walltime_accounting,
                                     gmx_int64_t                 nsteps_done);
 
-/*! \brief Calls system timing routines (e.g. clock_gettime) to get the
- * (fractional) number of seconds elapsed since the epoch.
+/*! \brief
+ * Calls system timing routines (e.g. clock_gettime) to get the (fractional)
+ * number of seconds elapsed since the epoch.
  *
  * Resolution is implementation-dependent, but typically nanoseconds
  * or microseconds. */
index 3d166cf465bba208a69497e52796fc7230842e95..2458f4086b6b2f65d02f6f03401db14f5a117254 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
-#include "main.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "txtdump.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "atomprop.h"
 #include "vec.h"
 #include "pbc.h"
@@ -56,7 +54,7 @@
 #include "gromacs/utility/smalloc.h"
 #include "names.h"
 #include "mtop_util.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/xtcio.h"
index 24ad49bab7c581586be4f5cce08308988a77484a..d44c2d9197158a876308af7c6b80f177f6c0e956 100644 (file)
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
-#include "main.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "sysstuff.h"
+#include "gromacs/utility/futil.h"
 #include "txtdump.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "names.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
index 08c264e97e52a5198f92611c8f09f08fa1092d44..c8f2fd95d91083f925fa9bd23509cef6f0483914 100644 (file)
@@ -40,8 +40,7 @@
 
 #include <math.h>
 #include "index.h"
-#include "gmx_fatal.h"
-#include "sysstuff.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "names.h"
@@ -54,7 +53,7 @@
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/enxio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/random/random.h"
 
 #define RANGECHK(i, n) if ((i) >= (n)) gmx_fatal(FARGS, "Your index file contains atomnumbers (e.g. %d)\nthat are larger than the number of atoms in the tpr file (%d)", (i), (n))
index ad94ac7162c9f21f836d86af3e408af44d8f6251..44f947bc59f4ea7cffbfa1500d428ea4a5603971 100644 (file)
 #include <string.h>
 #include <math.h>
 #include <assert.h>
-#include "main.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
 #include "txtdump.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "names.h"
 #include "txtdump.h"
@@ -59,7 +57,7 @@
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trnio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/tngio.h"
 #include "gromacs/fileio/tngio_for_tools.h"
 
index eb7a3d3e69b215282c4ae987ce4151b690ec0e30..023423f99d7edd9a96f55888bb71e82367c13a35 100644 (file)
@@ -58,7 +58,6 @@
 #include "gromacs/analysisdata/modules/average.h"
 #include "gromacs/analysisdata/modules/plot.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
@@ -68,6 +67,7 @@
 #include "gromacs/trajectoryanalysis/analysismodule.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/scoped_ptr_sfree.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
index d2597a13e1a00030154955a18036647e0a1119c4..1bf7655a575f8ce63fffd438a46812c2a500b07f 100644 (file)
@@ -92,8 +92,7 @@
  * The header file.h declares a gmx::File class for basic I/O support.
  *
  * The header path.h declares helpers for manipulating paths and for managing
- * directories (this has been moved to src/gromacs/fileio/ to wait for
- * resolution of #950).
+ * directories.
  *
  * The fate of these headers depends on what is decided in Redmine issue #950.
  *
index ae59513caa0dca83540b68296f4f735f97699cdb..1618dce0650c0a81268ec97a24f67449fa5255d7 100644 (file)
@@ -41,12 +41,15 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gmx_header_config_gen.h.cmakein
 
 set(UTILITY_PUBLIC_HEADERS
     arrayref.h
+    basedefinitions.h
     cstringutil.h
     common.h
     errorcodes.h
     exceptions.h
+    fatalerror.h
     file.h
     flags.h
+    futil.h
     gmx_header_config.h
     gmxassert.h
     init.h
diff --git a/src/gromacs/utility/basedefinitions.h b/src/gromacs/utility/basedefinitions.h
new file mode 100644 (file)
index 0000000..c8e65c2
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \file
+ * \brief
+ * Basic types and macros used throughout \Gromacs.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_BASEDEFINITIONS_H
+#define GMX_UTILITY_BASEDEFINITIONS_H
+
+/* Information about integer data type sizes */
+#include <limits.h>
+#define __STDC_LIMIT_MACROS
+#include <stdint.h>
+#ifndef _MSC_VER
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+#endif
+
+/*! \brief
+ * Boolean type for use in \Gromacs C code.
+ *
+ * There is no standard size for 'bool' in C++, so when
+ * we previously defined it to int for C code the data types
+ * (and structs) would have different size depending on your compiler,
+ * both at \Gromacs build time and when you use the library.
+ * The only way around this is to NOT assume anything about the C++ type,
+ * so we cannot use the name 'bool' in our C code anymore.
+ */
+typedef int gmx_bool;
+
+#ifndef FALSE
+/** False value for ::gmx_bool. */
+#  define FALSE   0
+#endif
+#ifndef TRUE
+/** True value for ::gmx_bool. */
+#  define TRUE    1
+#endif
+/** Number of gmx_bool values. */
+#define BOOL_NR 2
+
+/*! \name Fixed-width integer types
+ *
+ * These types and macros provide the equivalent of 32- and 64-bit integer
+ * types from C99 headers `stdint.h` and `inttypes.h`.  These headers are also
+ * there in C++11.  The types and macros from here should be used instead of
+ * `int32_t` etc.
+ * MSVC doesn't support these before Visual Studio 2013.
+ */
+/*! \{ */
+#ifdef _MSC_VER
+typedef __int32 gmx_int32_t;
+#define GMX_PRId32 "I32d"
+#define GMX_SCNd32 "I32d"
+
+typedef __int64 gmx_int64_t;
+#define GMX_PRId64 "I64d"
+#define GMX_SCNd64 "I64d"
+
+typedef unsigned __int32 gmx_uint32_t;
+#define GMX_PRIu32 "I32u"
+#define GMX_SCNu32 "I32u"
+
+typedef unsigned __int64 gmx_uint64_t;
+#define GMX_PRIu64 "I64u"
+#define GMX_SCNu64 "I64u"
+#else
+typedef int32_t gmx_int32_t;
+#define GMX_PRId32 PRId32
+#define GMX_SCNd32 SCNd32
+
+typedef int64_t gmx_int64_t;
+#define GMX_PRId64 PRId64
+#define GMX_SCNd64 SCNd64
+
+typedef uint32_t gmx_uint32_t;
+#define GMX_PRIu32 PRIu32
+#define GMX_SCNu32 SCNu32
+
+typedef uint64_t gmx_uint64_t;
+#define GMX_PRIu64 PRIu64
+#define GMX_SCNu64 SCNu64
+#endif
+
+#define GMX_INT32_MAX INT32_MAX
+#define GMX_INT32_MIN INT32_MIN
+
+#define GMX_INT64_MAX INT64_MAX
+#define GMX_INT64_MIN INT64_MIN
+
+#define GMX_UINT32_MAX UINT32_MAX
+#define GMX_UINT32_MIN UINT32_MIN
+
+#define GMX_UINT64_MAX UINT64_MAX
+#define GMX_UINT64_MIN UINT64_MIN
+/*! \} */
+
+/*! \def gmx_inline
+ * \brief
+ * Keyword to use in C code instead of C99 `inline`.
+ *
+ * Some of the C compilers we support do not recognize the C99 keyword
+ * `inline`.  This macro should be used in C code and in shared C/C++ headers
+ * to indicate a function is inlined.
+ * C++ code should use plain `inline`, as that is already in C++98.
+ */
+#if !defined __cplusplus && _MSC_VER
+#define gmx_inline __inline
+#else
+/* C++ or C99 */
+#define gmx_inline inline
+#endif
+
+/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
+ * Any other compiler can be added here. */
+/*! \brief
+ * Keyword to use in instead of C99 `restrict`.
+ *
+ * We cannot use `restrict` because it is only in C99, but not in C++.
+ * This macro should instead be used to allow easily supporting different
+ * compilers.
+ */
+#define gmx_restrict __restrict
+
+/*! \def gmx_unused
+ * \brief
+ * Attribute to suppres compiler warnings about unused function parameters.
+ *
+ * This attribute suppresses compiler warnings about unused function arguments
+ * by marking them as possibly unused.  Some arguments are unused but
+ * have to be retained to preserve a function signature
+ * that must match that of another function.
+ * Some arguments are only used in *some* conditional compilation code paths
+ * (e.g. MPI).
+ */
+#ifndef gmx_unused
+#ifdef __GNUC__
+/* GCC, clang, and some ICC pretending to be GCC */
+#  define gmx_unused __attribute__ ((unused))
+#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && !defined(_MSC_VER)
+/* ICC on *nix */
+#  define gmx_unused __attribute__ ((unused))
+#elif defined _MSC_VER
+/* MSVC */
+#  define gmx_unused /*@unused@*/
+#elif defined(__xlC__)
+/* IBM */
+#  define gmx_unused __attribute__ ((unused))
+#else
+#  define gmx_unused
+#endif
+#endif
+
+#endif
diff --git a/src/gromacs/utility/basenetwork.cpp b/src/gromacs/utility/basenetwork.cpp
new file mode 100644 (file)
index 0000000..d4adc34
--- /dev/null
@@ -0,0 +1,270 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#include "basenetwork.h"
+
+#include "config.h"
+
+#include <cctype>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include <algorithm>
+#include <exception>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/programcontext.h"
+
+int gmx_gethostname(char *name, size_t len)
+{
+    if (len < 8)
+    {
+        gmx_incons("gmx_gethostname called with len<8");
+    }
+#if defined(HAVE_UNISTD_H) && !defined(__native_client__)
+    if (gethostname(name, len-1) != 0)
+    {
+        std::strncpy(name, "unknown", 8);
+        return -1;
+    }
+    return 0;
+#else
+    std::strncpy(name, "unknown", 8);
+    return -1;
+#endif
+}
+
+gmx_bool gmx_mpi_initialized(void)
+{
+#ifndef GMX_MPI
+    return 0;
+#else
+    int n;
+    MPI_Initialized(&n);
+
+    return n;
+#endif
+}
+
+int gmx_node_num(void)
+{
+#ifndef GMX_MPI
+    return 1;
+#else
+    int i;
+    (void) MPI_Comm_size(MPI_COMM_WORLD, &i);
+    return i;
+#endif
+}
+
+int gmx_node_rank(void)
+{
+#ifndef GMX_MPI
+    return 0;
+#else
+    int i;
+    (void) MPI_Comm_rank(MPI_COMM_WORLD, &i);
+    return i;
+#endif
+}
+
+#if defined GMX_LIB_MPI && defined GMX_TARGET_BGQ
+#include <spi/include/kernel/location.h>
+#endif
+
+int gmx_physicalnode_id_hash(void)
+{
+    int hash_int;
+
+#ifndef GMX_LIB_MPI
+    /* We have a single physical node */
+    hash_int = 0;
+#else
+    int  resultlen;
+    char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
+
+    /* This procedure can only differentiate nodes with different names.
+     * Architectures where different physical nodes have identical names,
+     * such as IBM Blue Gene, should use an architecture specific solution.
+     */
+    MPI_Get_processor_name(mpi_hostname, &resultlen);
+
+    /* The string hash function returns an unsigned int. We cast to an int.
+     * Negative numbers are converted to positive by setting the sign bit to 0.
+     * This makes the hash one bit smaller.
+     * A 63-bit hash (with 64-bit int) should be enough for unique node hashes,
+     * even on a million node machine. 31 bits might not be enough though!
+     */
+    hash_int =
+        (int)gmx_string_fullhash_func(mpi_hostname, gmx_string_hash_init);
+    if (hash_int < 0)
+    {
+        hash_int -= INT_MIN;
+    }
+#endif
+
+    return hash_int;
+}
+
+int gmx_hostname_num()
+{
+#ifndef GMX_MPI
+    return 0;
+#else
+#ifdef GMX_THREAD_MPI
+    /* thread-MPI currently puts the thread number in the process name,
+     * we might want to change this, as this is inconsistent with what
+     * most MPI implementations would do when running on a single node.
+     */
+    return 0;
+#else
+    int  resultlen, hostnum, i, j;
+    char mpi_hostname[MPI_MAX_PROCESSOR_NAME], hostnum_str[MPI_MAX_PROCESSOR_NAME];
+
+    MPI_Get_processor_name(mpi_hostname, &resultlen);
+#ifdef GMX_TARGET_BGQ
+    Personality_t personality;
+    Kernel_GetPersonality(&personality, sizeof(personality));
+    /* Each MPI rank has a unique coordinate in a 6-dimensional space
+       (A,B,C,D,E,T), with dimensions A-E corresponding to different
+       physical nodes, and T within each node. Each node has sixteen
+       physical cores, each of which can have up to four hardware
+       threads, so 0 <= T <= 63 (but the maximum value of T depends on
+       the confituration of ranks and OpenMP threads per
+       node). However, T is irrelevant for computing a suitable return
+       value for gmx_hostname_num().
+     */
+    hostnum  = personality.Network_Config.Acoord;
+    hostnum *= personality.Network_Config.Bnodes;
+    hostnum += personality.Network_Config.Bcoord;
+    hostnum *= personality.Network_Config.Cnodes;
+    hostnum += personality.Network_Config.Ccoord;
+    hostnum *= personality.Network_Config.Dnodes;
+    hostnum += personality.Network_Config.Dcoord;
+    hostnum *= personality.Network_Config.Enodes;
+    hostnum += personality.Network_Config.Ecoord;
+#else
+    /* This procedure can only differentiate nodes with host names
+     * that end on unique numbers.
+     */
+    i = 0;
+    j = 0;
+    /* Only parse the host name up to the first dot */
+    while (i < resultlen && mpi_hostname[i] != '.')
+    {
+        if (std::isdigit(mpi_hostname[i]))
+        {
+            hostnum_str[j++] = mpi_hostname[i];
+        }
+        i++;
+    }
+    hostnum_str[j] = '\0';
+    if (j == 0)
+    {
+        hostnum = 0;
+    }
+    else
+    {
+        /* Use only the last 9 decimals, so we don't overflow an int */
+        hostnum = std::strtol(hostnum_str + std::max(0, j-9), NULL, 10);
+    }
+#endif
+
+    if (debug)
+    {
+        std::fprintf(debug, "In gmx_hostname_num: hostname '%s', hostnum %d\n",
+                     mpi_hostname, hostnum);
+#ifdef GMX_TARGET_BGQ
+        std::fprintf(debug,
+                     "Torus ID A: %d / %d B: %d / %d C: %d / %d D: %d / %d E: %d / %d\n"
+                     "Node ID T: %d / %d core: %d / %d hardware thread: %d / %d\n",
+                     personality.Network_Config.Acoord,
+                     personality.Network_Config.Anodes,
+                     personality.Network_Config.Bcoord,
+                     personality.Network_Config.Bnodes,
+                     personality.Network_Config.Ccoord,
+                     personality.Network_Config.Cnodes,
+                     personality.Network_Config.Dcoord,
+                     personality.Network_Config.Dnodes,
+                     personality.Network_Config.Ecoord,
+                     personality.Network_Config.Enodes,
+                     Kernel_ProcessorCoreID(),
+                     16,
+                     Kernel_ProcessorID(),
+                     64,
+                     Kernel_ProcessorThreadID(),
+                     4);
+#endif
+    }
+    return hostnum;
+#endif
+#endif
+}
+
+#ifdef GMX_LIB_MPI
+void gmx_abort(int errorno)
+{
+    const char *programName = "GROMACS";
+    try
+    {
+        programName = gmx::getProgramContext().displayName();
+    }
+    catch (const std::exception &)
+    {
+    }
+    const int nnodes   = gmx_node_num();
+    const int noderank = gmx_node_rank();
+    if (nnodes > 1)
+    {
+        std::fprintf(stderr, "Halting parallel program %s on node %d out of %d\n",
+                     programName, noderank, nnodes);
+    }
+    else
+    {
+        std::fprintf(stderr, "Halting program %s\n", programName);
+    }
+
+    MPI_Abort(MPI_COMM_WORLD, errorno);
+    std::exit(errorno);
+}
+#endif
similarity index 50%
rename from src/gromacs/legacyheaders/shift.h
rename to src/gromacs/utility/basenetwork.h
index 08488454e887d7e2a54f5a255245a87319f02179..604f90a3a9d447494c696ab21b20a9261de89783 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+/*! \libinternal \file
+ * \brief
+ * Utility functions for basic MPI and network functionality.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_BASENETWORK_H
+#define GMX_UTILITY_BASENETWORK_H
 
-#ifndef _shift_h
-#define _shift_h
+#include <stddef.h>
 
-#include "typedefs.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-real *mk_shift_tab(int n, real r1, real rc, real dr, real *sfac);
-/* Return a table of length n, containing the parabolic
- * shift function from HJC Berendsen
+/*! \brief
+ * Sets the hostname to the value given by gethostname(), if available.
+ *
+ * \param[out] name Buffer to receive the hostname.
+ * \param[in]  len  Length of buffer \p name (must be >= 8).
+ * \returns 0 on success, -1 on error.
+ *
+ * If the value is not available, "unknown" is returned.
+ * \p name should have at least size \p len.
+ */
+int gmx_gethostname(char *name, size_t len);
+
+/*! \brief
+ * Returns whether MPI has been initialized.
+ *
+ * The return value is `FALSE` if MPI_Init() has not been called, or if
+ * \Gromacs has been compiled without MPI support.
+ * For thread-MPI, always returns `TRUE`.
+ */
+gmx_bool gmx_mpi_initialized(void);
+
+/** Returns the number of nodes. */
+int gmx_node_num(void);
+
+/** Returns the rank of the node. */
+int gmx_node_rank(void);
+
+/*! \brief
+ * Return a non-negative hash that is, hopefully, unique for each physical
+ * node.
+ *
+ * This hash is useful for determining hardware locality.
  */
+int gmx_physicalnode_id_hash(void);
+
+/*! \brief
+ * Returns an integer characteristic of and, hopefully, unique to each
+ * physical node in the MPI system.
+ *
+ * If the first part of the MPI hostname (up to the first dot) ends with a
+ * number, returns this number.  If the first part of the MPI hostname does not
+ * ends in a number (0-9 characters), returns 0.
+ *
+ * \todo
+ * This function should be fully replaced by gmx_physicalnode_id_hash().
+ */
+int gmx_hostname_num(void);
+
+/** Abort the parallel run */
+void gmx_abort(int errorno);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif  /* _shift_h */
+#endif
index 71c22d38387a854a419ff5f019a4f60f09821ac2..86c983c955f809758ac25a35d2e40a2ac481ff9e 100644 (file)
 #include <unistd.h>
 #endif
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/main.h"
-
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 int continuing(char *s)
index 6d8f94b4e7472dc27b5d5703360aa278437f75b0..a02d2b7ec171654d27975fca4420e4b89108cbde 100644 (file)
@@ -46,7 +46,7 @@
 #include <stdio.h>
 #include <time.h>
 
-#include "../legacyheaders/types/simple.h"
+#include "basedefinitions.h"
 
 #include "gmx_header_config.h"
 
@@ -79,6 +79,8 @@ extern "C" {
 #define CONTINUE    '\\'
 /** Comment sign to use. */
 #define COMMENTSIGN ';'
+/** Standard size for char* string buffers. */
+#define STRLEN 4096
 
 /*! \brief
  * Strip trailing spaces and if s ends with a ::CONTINUE remove that too.
index 0f0d003696989cf3969e65dafcd5ad600d05b081..6dfc4330d83324b7c35ffc3d8d32beadb9d98f71 100644 (file)
@@ -56,8 +56,7 @@
 
 #include "thread_mpi/system_error.h"
 
-#include "gromacs/legacyheaders/network.h"
-
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/errorcodes.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
@@ -517,7 +516,7 @@ int processExceptionAtExit(const std::exception & /*ex*/)
 #ifdef GMX_LIB_MPI
     // TODO: Consider moving the output done in gmx_abort() into the message
     // printing routine above, so that this could become a simple MPI_Abort().
-    gmx_abort(gmx_node_rank(), gmx_node_num(), returnCode);
+    gmx_abort(returnCode);
 #endif
     return returnCode;
 }
similarity index 62%
rename from src/gromacs/gmxlib/gmx_fatal.c
rename to src/gromacs/utility/fatalerror.cpp
index 837abe06d7197d179cf1b782408e4ba9f800b9ec..7ca511886b10c5ad6e38c39e3d42fffe173c1f42 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#include "gmx_fatal.h"
-#include "gmx_fatal_collective.h"
+#include "fatalerror.h"
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <string.h>
+#include <cerrno>
+#include <cstdarg>
+#include <cstdlib>
+#include <cstring>
 
-#include "thread_mpi/threads.h"
+#include <exception>
 
-#include "main.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "copyrite.h"
-#include "macros.h"
+#include "thread_mpi/threads.h"
 
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/baseversion.h"
+#include "gromacs/utility/common.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 
 static gmx_bool            bDebug         = FALSE;
 static FILE               *log_file       = NULL;
 
-static tMPI_Thread_mutex_t debug_mutex     = TMPI_THREAD_MUTEX_INITIALIZER;
-static tMPI_Thread_mutex_t where_mutex     = TMPI_THREAD_MUTEX_INITIALIZER;
+static tMPI_Thread_mutex_t debug_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
+static tMPI_Thread_mutex_t where_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
+
+static const char *const   gmxuser
+    = "Please report this to the mailing list (gmx-users@gromacs.org)";
 
 gmx_bool bDebugMode(void)
 {
-    gmx_bool ret;
-#if 0
-    tMPI_Thread_mutex_lock(&debug_mutex);
-#endif
-    ret = bDebug;
-#if 0
-    tMPI_Thread_mutex_unlock(&debug_mutex);
-#endif
     return bDebug;
 }
 
@@ -128,7 +121,7 @@ void _where(const char *file, int line)
 
 static int fatal_errno = 0;
 
-static void quit_gmx(const char *msg)
+static void default_error_handler(const char *msg)
 {
     tMPI_Thread_mutex_lock(&debug_mutex);
     if (fatal_errno == 0)
@@ -150,175 +143,127 @@ static void quit_gmx(const char *msg)
         }
         perror(msg);
     }
+    tMPI_Thread_mutex_unlock(&debug_mutex);
+}
 
-#ifdef GMX_LIB_MPI
-    if (gmx_mpi_initialized())
-    {
-        int  nnodes;
-        int  noderank;
+static void (*gmx_error_handler)(const char *msg) = default_error_handler;
 
-        nnodes   = gmx_node_num();
-        noderank = gmx_node_rank();
+void set_gmx_error_handler(void (*func)(const char *msg))
+{
+    // TODO: Either this is unnecessary, or also reads to the handler should be
+    // protected by a mutex.
+    tMPI_Thread_mutex_lock(&debug_mutex);
+    gmx_error_handler = func;
+    tMPI_Thread_mutex_unlock(&debug_mutex);
+}
 
-        if (nnodes > 1)
-        {
-            fprintf(stderr, "Error on node %d, will try to stop all the nodes\n",
-                    noderank);
-        }
-        gmx_abort(noderank, nnodes, -1);
-    }
-#endif
+static void call_error_handler(const char *key, const char *file, int line, const char *msg)
+{
+    char        buf[10240], errerrbuf[1024];
+    const char *llines = "-------------------------------------------------------";
+    char       *strerr;
 
-    if (debug)
+    if (msg == NULL)
     {
-        fflush(debug);
+        sprintf(errerrbuf, "Empty fatal_error message. %s", gmxuser);
     }
-    if (bDebugMode())
+    // In case ProgramInfo is not initialized and there is an issue with the
+    // initialization, fall back to "GROMACS".
+    const char *programName = "GROMACS";
+    try
+    {
+        programName = gmx::getProgramContext().displayName();
+    }
+    catch (const std::exception &)
     {
-        fprintf(stderr, "dump core (y/n):");
-        fflush(stderr);
-        if (toupper(getc(stdin)) != 'N')
-        {
-            (void) abort();
-        }
     }
 
-    exit(fatal_errno);
-    tMPI_Thread_mutex_unlock(&debug_mutex);
+    strerr = gmx_strerror(key);
+    sprintf(buf, "\n%s\nProgram %s, %s\n"
+            "Source code file: %s, line: %d\n\n"
+            "%s:\n%s\nFor more information and tips for troubleshooting, please check the GROMACS\n"
+            "website at http://www.gromacs.org/Documentation/Errors\n%s\n",
+            llines, programName, gmx_version(), file, line,
+            strerr, msg ? msg : errerrbuf, llines);
+    free(strerr);
+
+    gmx_error_handler(buf);
 }
 
-/* The function below should be identical to quit_gmx,
- * except that is does not actually quit and call gmx_abort.
- */
-static void quit_gmx_noquit(const char *msg)
+static void do_exit(bool bMaster, bool bFinalize)
 {
-    tMPI_Thread_mutex_lock(&debug_mutex);
-    if (!fatal_errno)
-    {
-        if (log_file)
-        {
-            fprintf(log_file, "%s\n", msg);
-        }
-        fprintf(stderr, "%s\n", msg);
-        /* we set it to no-zero because if this function is called, something
-           has gone wrong */
-        fatal_errno = 255;
-    }
-    else
-    {
-        if (fatal_errno != -1)
-        {
-            errno = fatal_errno;
-        }
-        perror(msg);
-    }
-
-#ifndef GMX_LIB_MPI
     if (debug)
     {
         fflush(debug);
     }
-    if (bDebugMode())
+
+#ifdef GMX_MPI
+    if (gmx_mpi_initialized())
     {
-        fprintf(stderr, "dump core (y/n):");
-        fflush(stderr);
-        if (toupper(getc(stdin)) != 'N')
+        if (bFinalize)
         {
-            (void) abort();
+            /* Broadcast the fatal error number possibly modified
+             * on the master process, in case the user would like
+             * to use the return status on a non-master process.
+             * The master process in cr and dd always has global rank 0.
+             */
+            MPI_Bcast(&fatal_errno, sizeof(fatal_errno), MPI_BYTE,
+                      0, MPI_COMM_WORLD);
+
+            /* Finalize nicely instead of aborting */
+            MPI_Finalize();
         }
-    }
+        else if (bMaster)
+        {
+#ifdef GMX_LIB_MPI
+            gmx_abort(1);
 #endif
-
-    tMPI_Thread_mutex_unlock(&debug_mutex);
-}
-
-void gmx_fatal(int f_errno, const char *file, int line, const char *fmt, ...)
-{
-    va_list ap;
-    char    msg[STRLEN];
-
-    va_start(ap, fmt);
-    vsprintf(msg, fmt, ap);
-    va_end(ap);
-
-    tMPI_Thread_mutex_lock(&debug_mutex);
-    fatal_errno = f_errno;
-    tMPI_Thread_mutex_unlock(&debug_mutex);
-
-    _gmx_error("fatal", msg, file, line);
-}
-
-void gmx_fatal_collective(int f_errno, const char *file, int line,
-                          const t_commrec *cr, gmx_domdec_t *dd,
-                          const char *fmt, ...)
-{
-    gmx_bool    bFinalize;
-    va_list     ap;
-    char        msg[STRLEN];
-#ifdef GMX_MPI
-    int         result;
+        }
+        else
+        {
+            /* Let all other processes wait till the master has printed
+             * the error message and issued MPI_Abort.
+             */
+            MPI_Barrier(MPI_COMM_WORLD);
+        }
+    }
+#else
+    GMX_UNUSED_VALUE(bMaster);
+    GMX_UNUSED_VALUE(bFinalize);
 #endif
 
-    bFinalize = TRUE;
-
-#ifdef GMX_MPI
-    /* Check if we are calling on all processes in MPI_COMM_WORLD */
-    if (cr != NULL)
-    {
-        MPI_Comm_compare(cr->mpi_comm_mysim, MPI_COMM_WORLD, &result);
-    }
-    else
+    if (bDebugMode())
     {
-        MPI_Comm_compare(dd->mpi_comm_all, MPI_COMM_WORLD, &result);
+        std::abort();
     }
-    /* Any result except MPI_UNEQUAL allows us to call MPI_Finalize */
-    bFinalize = (result != MPI_UNEQUAL);
-#endif
+    std::exit(1);
+}
 
-    if ((cr != NULL && MASTER(cr)  ) ||
-        (dd != NULL && DDMASTER(dd)))
+void gmx_fatal_mpi_va(int f_errno, const char *file, int line,
+                      gmx_bool bMaster, gmx_bool bFinalize,
+                      const char *fmt, va_list ap)
+{
+    if (bMaster)
     {
-        va_start(ap, fmt);
+        char msg[STRLEN];
         vsprintf(msg, fmt, ap);
-        va_end(ap);
 
         tMPI_Thread_mutex_lock(&debug_mutex);
         fatal_errno = f_errno;
         tMPI_Thread_mutex_unlock(&debug_mutex);
 
-        if (bFinalize)
-        {
-            /* Use an error handler that does not quit */
-            set_gmx_error_handler(quit_gmx_noquit);
-        }
-
-        _gmx_error("fatal", msg, file, line);
+        call_error_handler("fatal", file, line, msg);
     }
 
-#ifdef GMX_MPI
-    if (bFinalize)
-    {
-        /* Broadcast the fatal error number possibly modified
-         * on the master process, in case the user would like
-         * to use the return status on a non-master process.
-         * The master process in cr and dd always has global rank 0.
-         */
-        MPI_Bcast(&fatal_errno, sizeof(fatal_errno), MPI_BYTE,
-                  0, MPI_COMM_WORLD);
-
-        /* Finalize nicely instead of aborting */
-        MPI_Finalize();
-    }
-    else
-    {
-        /* Let all other processes wait till the master has printed
-         * the error message and issued MPI_Abort.
-         */
-        MPI_Barrier(MPI_COMM_WORLD);
-    }
-#endif
+    do_exit(bMaster, bFinalize);
+}
 
-    exit(fatal_errno);
+void gmx_fatal(int f_errno, const char *file, int line, const char *fmt, ...)
+{
+    va_list ap;
+    va_start(ap, fmt);
+    gmx_fatal_mpi_va(f_errno, file, line, TRUE, FALSE, fmt, ap);
+    va_end(ap);
 }
 
 /*
@@ -337,7 +282,7 @@ void init_debug(const int dbglevel, const char *dbgfile)
     if (!bDebug) /* another thread hasn't already run this*/
     {
         no_buffers();
-        debug  = gmx_fio_fopen(dbgfile, "w+");
+        debug  = gmx_ffopen(dbgfile, "w+");
         bDebug = TRUE;
         if (dbglevel >= 2)
         {
@@ -347,17 +292,6 @@ void init_debug(const int dbglevel, const char *dbgfile)
     tMPI_Thread_mutex_unlock(&debug_mutex);
 }
 
-static const char *gmxuser = "Please report this to the mailing list (gmx-users@gromacs.org)";
-
-static void        (*gmx_error_handler)(const char *msg) = quit_gmx;
-
-void set_gmx_error_handler(void (*func)(const char *msg))
-{
-    tMPI_Thread_mutex_lock(&debug_mutex);
-    gmx_error_handler = func;
-    tMPI_Thread_mutex_unlock(&debug_mutex);
-}
-
 char *gmx_strerror(const char *key)
 {
     typedef struct {
@@ -375,11 +309,9 @@ char *gmx_strerror(const char *key)
         { "input",  "Input error or input inconsistency" },
         { "mem",    "Memory allocation/freeing error" },
         { "open",   "Can not open file" },
-        { "range",  "Range checking error" }
+        { "range",  "Range checking error" },
+        { NULL,     NULL}
     };
-#define NMSG asize(msg)
-    char        buf[1024];
-    size_t      i;
 
     if (key == NULL)
     {
@@ -387,49 +319,24 @@ char *gmx_strerror(const char *key)
     }
     else
     {
-        for (i = 0; (i < NMSG); i++)
+        for (size_t i = 0; msg[i].key != NULL; ++i)
         {
             if (strcmp(key, msg[i].key) == 0)
             {
-                break;
+                return strdup(msg[i].msg);
             }
         }
-        if (i == NMSG)
-        {
-            sprintf(buf, "No error message associated with key %s\n%s", key, gmxuser);
-            return strdup(buf);
-        }
-        else
-        {
-            return strdup(msg[i].msg);
-        }
+        char buf[1024];
+        sprintf(buf, "No error message associated with key %s\n%s", key, gmxuser);
+        return strdup(buf);
     }
 }
 
 
 void _gmx_error(const char *key, const char *msg, const char *file, int line)
 {
-    char        buf[10240], errerrbuf[1024];
-    const char *llines = "-------------------------------------------------------";
-    char       *strerr;
-
-    /* protect the audience from suggestive discussions */
-
-    if (msg == NULL)
-    {
-        sprintf(errerrbuf, "Empty fatal_error message. %s", gmxuser);
-    }
-
-    strerr = gmx_strerror(key);
-    sprintf(buf, "\n%s\nProgram %s, %s\n"
-            "Source code file: %s, line: %d\n\n"
-            "%s:\n%s\nFor more information and tips for troubleshooting, please check the GROMACS\n"
-            "website at http://www.gromacs.org/Documentation/Errors\n%s\n",
-            llines, ShortProgram(), GromacsVersion(), file, line,
-            strerr, msg ? msg : errerrbuf, llines);
-    free(strerr);
-
-    gmx_error_handler(buf);
+    call_error_handler(key, file, line, msg);
+    do_exit(true, false);
 }
 
 void _range_check(int n, int n_min, int n_max, const char *warn_str,
similarity index 85%
rename from src/gromacs/legacyheaders/gmx_fatal.h
rename to src/gromacs/utility/fatalerror.h
index 8bf145b35e8f997bbbf0e83dbcc9639ce92891d9..0bc323260c02074cec8a9055f216cff11226ef66 100644 (file)
  * Declares fatal error handling and debugging routines for C code.
  *
  * \inpublicapi
+ * \ingroup module_utility
  */
-#ifndef _fatal_h
-#define _fatal_h
+#ifndef GMX_UTILITY_FATALERROR_H
+#define GMX_UTILITY_FATALERROR_H
 
+#include <stdarg.h>
 #include <stdio.h>
 
-#include "types/simple.h"
+#include "basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -79,6 +81,22 @@ _where(const char *file, int line);
 /** Prints filename and line to stdlog. */
 #define where() _where(__FILE__, __LINE__)
 
+/*! \brief
+ * Low-level fatal error reporting routine for collective MPI errors.
+ *
+ * This function works as gmx_fatal(), but provides additional control for
+ * cases where it is known that the same error occurs on multiple MPI ranks.
+ * The error handler is called only if \p bMaster is `TRUE`, and MPI_Finalize()
+ * is called instead of MPI_Abort() in MPI-enabled \Gromacs if \p bFinalize is
+ * `TRUE`.
+ *
+ * This is used to implement gmx_fatal_collective() (which cannot be declared
+ * here, since it would bring with it mdrun-specific dependencies).
+ */
+void
+gmx_fatal_mpi_va(int fatal_errno, const char *file, int line, gmx_bool bMaster,
+                 gmx_bool bFinalize, const char *fmt, va_list ap) GMX_ATTRIBUTE_NORETURN;
+
 /*! \brief
  * Fatal error reporting routine for \Gromacs.
  *
@@ -92,7 +110,7 @@ _where(const char *file, int line);
  * The format of \p fmt uses printf()-like formatting.
  *
  * In case all MPI processes want to stop with the same fatal error,
- * use gmx_fatal_collective(), declared in gmx_fatal_collective.h,
+ * use gmx_fatal_collective(), declared in network.h,
  * to avoid having as many error messages as processes.
  *
  * The first three parameters can be provided through ::FARGS:
@@ -196,10 +214,10 @@ void _gmx_error(const char *key, const char *msg, const char *file, int line) GM
 /*! \brief
  * Sets an error handler for gmx_fatal() and other fatal error routines.
  *
- * The default handler prints the message and aborts the program.
- * If you set a custom handler, it must also abort the program, otherwise
- * \Gromacs will behave unpredictably (most likely, it crashes shortly after
- * the fatal error).
+ * The default handler prints the message.
+ * \Gromacs will terminate the program after the error handler returns.
+ * To make gmx_fatal_collective() work, the error handler should not terminate
+ * the program, as it cannot know what is the desired way of termination.
  * The string passed to the handler may be a multi-line string.
  *
  * \see gmx_fatal()
similarity index 95%
rename from src/gromacs/fileio/futil.cpp
rename to src/gromacs/utility/futil.cpp
index 6f272aa76aa81e7c3d0a0a54219bf8e3e40f2248..8c344e0781c59144d8b2bf7289a8a836e0540713 100644 (file)
@@ -34,6 +34,8 @@
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#include "gromacs/utility/futil.h"
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/types/commrec.h"
-#include "gromacs/legacyheaders/network.h"
-
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/path.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
@@ -198,10 +196,6 @@ int gmx_ffclose(FILE *fp)
 }
 
 
-#ifdef rewind
-#undef rewind
-#endif
-
 void frewind(FILE *fp)
 {
     tMPI_Thread_mutex_lock(&pstack_mutex);
@@ -248,7 +242,8 @@ gmx_off_t gmx_ftell(FILE *stream)
 }
 
 
-gmx_bool is_pipe(FILE *fp)
+//! Check whether the file (opened by gmx_ffopen()) is a pipe.
+static bool is_pipe(FILE *fp)
 {
     tMPI_Thread_mutex_lock(&pstack_mutex);
 
@@ -258,12 +253,12 @@ gmx_bool is_pipe(FILE *fp)
         if (ps->fp == fp)
         {
             tMPI_Thread_mutex_unlock(&pstack_mutex);
-            return TRUE;
+            return true;
         }
         ps = ps->prev;
     }
     tMPI_Thread_mutex_unlock(&pstack_mutex);
-    return FALSE;
+    return false;
 }
 
 
@@ -325,22 +320,6 @@ gmx_bool gmx_fexist(const char *fname)
     }
 }
 
-
-gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr)
-{
-    gmx_bool bExist;
-
-    if (SIMMASTER(cr))
-    {
-        bExist = gmx_fexist(fname);
-    }
-    if (PAR(cr))
-    {
-        gmx_bcast(sizeof(bExist), &bExist, cr);
-    }
-    return bExist;
-}
-
 gmx_bool gmx_eof(FILE *fp)
 {
     char     data[4];
@@ -865,28 +844,6 @@ void gmx_tmpnam(char *buf)
     /* name in Buf should now be OK */
 }
 
-int gmx_truncatefile(char *path, gmx_off_t length)
-{
-#ifdef _MSC_VER
-    /* Microsoft visual studio does not have "truncate" */
-    HANDLE        fh;
-    LARGE_INTEGER win_length;
-
-    win_length.QuadPart = length;
-
-    fh = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL,
-                    OPEN_EXISTING, 0, NULL);
-    SetFilePointerEx(fh, win_length, NULL, FILE_BEGIN);
-    SetEndOfFile(fh);
-    CloseHandle(fh);
-
-    return 0;
-#else
-    return truncate(path, length);
-#endif
-}
-
-
 int gmx_file_rename(const char *oldname, const char *newname)
 {
 #ifndef GMX_NATIVE_WINDOWS
diff --git a/src/gromacs/utility/futil.h b/src/gromacs/utility/futil.h
new file mode 100644 (file)
index 0000000..bec08e5
--- /dev/null
@@ -0,0 +1,272 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \file
+ * \brief
+ * Low-level wrappers for OS-specific file handling with some \Gromacs
+ * customizations.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_FUTIL_H
+#define GMX_UTILITY_FUTIL_H
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "basedefinitions.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if 0
+}
+#endif
+
+#include "gmx_header_config.h"
+/*! \def DIR_SEPARATOR
+ * \brief
+ * Directory separator on this OS.
+ *
+ * Native Windows uses backslash path separators (but accepts also slashes).
+ * Cygwin and most other systems use slash.
+ *
+ * \todo
+ * Get rid of this (Redmine #950), or at least remove this from an installed
+ * header.  It is not necessary for constructing paths on the systems that it
+ * currently supports, and is not reliable in parsing input paths either, since
+ * Windows needs to accept both instead of only DIR_SEPARATOR.
+ */
+#ifdef GMX_NATIVE_WINDOWS
+#define DIR_SEPARATOR '\\'
+#else
+#define DIR_SEPARATOR '/'
+#endif
+
+/*! \def GMX_PATH_MAX
+ * \brief
+ * Maximum path length, if the OS provides one, otherwise a fixed constant.
+ */
+#ifdef PATH_MAX
+#  define GMX_PATH_MAX PATH_MAX
+#elif defined MAX_PATH
+#  define GMX_PATH_MAX MAX_PATH
+#else
+#  define GMX_PATH_MAX 4096
+#endif
+
+/** \Gromacs definition to use instead of `off_t`. */
+typedef gmx_int64_t    gmx_off_t;
+
+/*! \brief
+ * Turn off buffering of files (which is default) for debugging purposes.
+ *
+ * This only has effect on files opened with gmx_ffopen().
+ */
+void no_buffers(void);
+
+/*! \brief
+ * Check whether a path exists.
+ *
+ * \returns `TRUE` when \p fname exists.
+ *
+ * Note that this returns `TRUE` even if \p fname is a directory instead of a
+ * file.
+ */
+gmx_bool gmx_fexist(const char *fname);
+
+/*! \brief
+ * Checks for end of file.
+ *
+ * \returns `TRUE` on end-of-file
+ *
+ * \todo
+ * There are only two callers for this function, while there are ~20 direct
+ * calls to feof().  Probably this is unnecessary.
+ */
+gmx_bool gmx_eof(FILE *fp);
+
+/*! \brief
+ * Makes a backup of file if the file exists.
+ *
+ * \returns `FALSE` if there was a problem.
+ */
+gmx_bool make_backup(const char *file);
+
+/*! \brief
+ * Opens a file, with \Gromacs-specific additions.
+ *
+ * If the file is in compressed format, opens a pipe which uncompresses the
+ * file on the fly.  For this to work, gmx_ffclose() and frewind() should
+ * always be used for files opened with gmx_ffopen() instead of fclose() and
+ * rewind().  For compressed files, the \p file parameter should be passed
+ * without the compressed extension; if that file is not found, then a few
+ * compression extensions are tried.
+ * Creates a backup if a file opened for writing already exists before
+ * overwriting it.
+ * A fatal error results if the file cannot be opened, for whatever reason.
+ */
+FILE *gmx_ffopen(const char *file, const char *mode);
+
+/** Closes a file opened with gmx_ffopen(). */
+int gmx_ffclose(FILE *fp);
+
+/*! \brief
+ * Wraps rewind() for files opened with gmx_ffopen().
+ *
+ * A fatal error results if this function is called for a pipe (a compressed
+ * input file).
+ */
+void frewind(FILE *fp);
+
+/** OS-independent 64-bit fseek(). */
+int gmx_fseek(FILE *stream, gmx_off_t offset, int whence);
+
+/** OS-independent 64-bit ftell(). */
+gmx_off_t gmx_ftell(FILE *stream);
+
+/*! \brief
+ * Finds full path for a library file.
+ *
+ * Searches first in the current directory, and then in the configured library
+ * directories.
+ * Fatal error results if the file is not found in any location.
+ * The caller is responsible of freeing the returned string.
+ */
+char *gmxlibfn(const char *file);
+
+/*! \brief
+ * Opens a library file for reading.
+ *
+ * Works as gmxlibfn(), except that it opens the file and returns a file
+ * handle.
+ */
+FILE *libopen(const char *file);
+
+/*! \brief
+ * More flexible gmxlibfn().
+ *
+ * Works as gmxlibfn(), but provides control whether the current working
+ * directory is searched or not, and whether a missing file is a fatal error or
+ * not.
+ */
+char *low_gmxlibfn(const char *file, gmx_bool bAddCWD, gmx_bool bFatal);
+
+/*! \brief
+ * Alternative for libopen() that optionally does not exit.
+ *
+ * Works as libopen(), but provides control whether a missing file is a fatal
+ * error or not.
+ */
+FILE *low_libopen(const char *file, gmx_bool bFatal);
+
+/** Opaque data type to list directories. */
+typedef struct gmx_directory *gmx_directory_t;
+
+/*! \brief
+ * Opens a directory for reading.
+ *
+ * \param[out] p_gmxdir Handle to the opened directory.
+ * \param[in]  dirname  Path to directory to open.
+ * \returns  0 on success.
+ */
+int
+gmx_directory_open(gmx_directory_t *p_gmxdir, const char *dirname);
+
+/*! \brief
+ * Gets next file in a directory.
+ *
+ * Given an initialized gmx_directory_t, if there are more files in
+ * the directory this routine returns 0 and write the next name
+ * into the USER-PROVIDED buffer \p name.  The last argument is the max
+ * number of characters that will be written.  Just as strncpy(), the
+ * string will NOT be terminated it it is longer than \p maxlength_name.
+ */
+int
+gmx_directory_nextfile(gmx_directory_t gmxdir, char *name, int maxlength_name);
+
+/** Releases all data for a directory structure. */
+int
+gmx_directory_close(gmx_directory_t gmxdir);
+
+
+/*! \brief
+ * Creates unique name for temp file (wrapper around mkstemp).
+ *
+ * \p buf should be at least 7 bytes long
+ */
+void gmx_tmpnam(char *buf);
+
+/*! \brief
+ * OS-independent rename().
+ *
+ * Renames/moves a file atomically, if the OS makes that available.
+ */
+int gmx_file_rename(const char *oldname, const char *newname);
+
+/*! \brief
+ * Copies a file (data only) oldname to newname.
+ *
+ * If \p copy_if_empty is `FALSE`, the file won't be copied if it's empty.
+ */
+int gmx_file_copy(const char *oldname, const char *newname, gmx_bool copy_if_empty);
+
+/*! \brief
+ * OS-independent fsync().
+ *
+ * Only use this during checkpointing!
+ */
+int gmx_fsync(FILE *fp);
+
+/*! \brief
+ * OS-independent chdir().
+ *
+ * Exits with a fatal error if changing the directory fails.
+ */
+void gmx_chdir(const char *directory);
+/*! \brief
+ * OS-independent getcwd().
+ *
+ * Exits with a fatal error if the call fails.
+ */
+void gmx_getcwd(char *buffer, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 9e6469b3a442fb02d6400a33ab106a586e7d7fb8..7da093b53461450e7a8bf3ff9d177b57085ae704 100644 (file)
 #include "config.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #ifdef GMX_OPENMP
 #include <omp.h>
 #endif
 
-#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/md_logging.h"
-
 #include "gromacs/utility/common.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/stringutil.h"
 
 int gmx_omp_get_max_threads(void)
 {
@@ -91,58 +92,41 @@ void gmx_omp_set_num_threads(int num_threads)
 #endif
 }
 
-/*!
- * Thread affinity set by the OpenMP library can conflict with the GROMACS
- * internal affinity setting.
- *
- * While GNU OpenMP does not set affinity by default, the Intel OpenMP library
- * does. This conflicts with the internal affinity (especially thread-MPI)
- * setting, results in incorrectly locked threads, and causes dreadful performance.
- *
- * The KMP_AFFINITY environment variable is used by Intel, GOMP_CPU_AFFINITY
- * by the GNU compilers (Intel also honors it well). If any of the variables
- * is set, we honor it, disable the internal pinning, and warn the user.
- * When using Intel OpenMP, we will disable affinity if the user did not set it
- * anually through one of the aforementioned environment variables.
- *
- * Note that the Intel OpenMP affinity disabling iwll only take effect if this
- * function is called before the OpenMP library gets initialized which happens
- * when the first call is made into a compilation unit that contains OpenMP
- * pragmas.
- */
-void gmx_omp_check_thread_affinity(FILE            *fplog,
-                                   const t_commrec *cr,
-                                   gmx_hw_opt_t    *hw_opt)
+gmx_bool gmx_omp_check_thread_affinity(char **message)
 {
-    /* no need to worry if internal thread pinning is turned off */
-    if (hw_opt->thread_affinity == threadaffOFF)
-    {
-        return;
-    }
+    bool shouldSetAffinity = true;
 
-#ifndef GMX_OPENMP
-    GMX_UNUSED_VALUE(fplog);
-    GMX_UNUSED_VALUE(cr);
-#else
+    *message = NULL;
+#ifdef GMX_OPENMP
     /* We assume that the affinity setting is available on all platforms
      * gcc supports. Even if this is not the case (e.g. Mac OS) the user
      * will only get a warning. */
 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
+    const char *programName;
+    try
+    {
+        programName = gmx::getProgramContext().displayName();
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+
     const char *const gomp_env            = getenv("GOMP_CPU_AFFINITY");
     const bool        bGompCpuAffinitySet = (gomp_env != NULL);
 
     /* turn off internal pinning if GOMP_CPU_AFFINITY is set & non-empty */
     if (bGompCpuAffinitySet && *gomp_env != '\0')
     {
-        /* TODO: with -pin auto we should only warn when using all cores */
-        md_print_warn(cr, fplog,
-                      "NOTE: GOMP_CPU_AFFINITY set, will turn off %s internal affinity\n"
-                      "      setting as the two can conflict and cause performance degradation.\n"
-                      "      To keep using the %s internal affinity setting, unset the\n"
-                      "      GOMP_CPU_AFFINITY environment variable.",
-                      ShortProgram(), ShortProgram());
-
-        hw_opt->thread_affinity = threadaffOFF;
+        try
+        {
+            std::string buf = gmx::formatString(
+                        "NOTE: GOMP_CPU_AFFINITY set, will turn off %s internal affinity\n"
+                        "      setting as the two can conflict and cause performance degradation.\n"
+                        "      To keep using the %s internal affinity setting, unset the\n"
+                        "      GOMP_CPU_AFFINITY environment variable.",
+                        programName, programName);
+            *message = gmx_strdup(buf.c_str());
+        }
+        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+        shouldSetAffinity = false;
     }
 #endif /* __GNUC__ || __INTEL_COMPILER */
 
@@ -178,17 +162,21 @@ void gmx_omp_check_thread_affinity(FILE            *fplog,
     /* turn off internal pinning KMP_AFFINITY != "disabled" */
     if (bKmpAffinitySet && (gmx_strncasecmp(kmp_env, "disabled", 8) != 0))
     {
-        /* TODO: with -pin auto we should only warn when using all cores */
-        md_print_warn(cr, fplog,
-                      "NOTE: KMP_AFFINITY set, will turn off %s internal affinity\n"
-                      "      setting as the two can conflict and cause performance degradation.\n"
-                      "      To keep using the %s internal affinity setting, set the\n"
-                      "      KMP_AFFINITY=disabled environment variable.",
-                      ShortProgram(), ShortProgram());
-
-        hw_opt->thread_affinity = threadaffOFF;
+        try
+        {
+            std::string buf = gmx::formatString(
+                        "NOTE: KMP_AFFINITY set, will turn off %s internal affinity\n"
+                        "      setting as the two can conflict and cause performance degradation.\n"
+                        "      To keep using the %s internal affinity setting, set the\n"
+                        "      KMP_AFFINITY=disabled environment variable.",
+                        programName, programName);
+            *message = gmx_strdup(buf.c_str());
+        }
+        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+        shouldSetAffinity = false;
     }
 #endif /* __INTEL_COMPILER */
 
 #endif /* GMX_OPENMP */
+    return shouldSetAffinity;
 }
index af11cac918acdcc739daba306f3a41e8865c0f1a..39664aecb6077e6b2df8c76240b2bfcad042a852 100644 (file)
@@ -53,6 +53,8 @@
 #include "config.h"
 #endif
 
+#include <stdio.h>
+
 #ifndef GMX_NATIVE_WINDOWS
 /* Ugly hack because the openmp implementation below hacks into the SIMD
  * settings to decide when to use _mm_pause(). This should eventually be
@@ -67,8 +69,7 @@
 #include <windows.h>
 #endif
 
-#include "types/commrec.h"
-#include "mdrun.h"
+#include "basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -113,9 +114,31 @@ void gmx_omp_set_num_threads(int num_threads);
 /*! \brief
  * Check for externally set thread affinity to avoid conflicts with \Gromacs
  * internal setting.
+ *
+ * \param[out] message  Receives the message to be shown to the user.
+ * \returns `true` if we can set thread affinity ourselves.
+ *
+ * While GNU OpenMP does not set affinity by default, the Intel OpenMP library
+ * does.  This conflicts with the internal affinity (especially thread-MPI)
+ * setting, results in incorrectly locked threads, and causes dreadful performance.
+ *
+ * The KMP_AFFINITY environment variable is used by Intel, GOMP_CPU_AFFINITY
+ * by the GNU compilers (Intel also honors it well).  If any of the variables
+ * is set, we should honor it and disable the internal pinning.
+ * When using Intel OpenMP, we will disable affinity if the user did not set it
+ * manually through one of the aforementioned environment variables.
+ *
+ * Note that the Intel OpenMP affinity disabling will only take effect if this
+ * function is called before the OpenMP library gets initialized, which happens
+ * when the first call is made into a compilation unit that contains OpenMP
+ * pragmas.
+ *
+ * If this function returns `false`, the caller is responsible to disable the
+ * pinning, show the message from \p *message to the user, and free the memory
+ * allocated for \p *message.
+ * If the return value is `true`, \p *message is NULL.
  */
-void gmx_omp_check_thread_affinity(FILE *fplog, const t_commrec *cr,
-                                   gmx_hw_opt_t *hw_opt);
+gmx_bool gmx_omp_check_thread_affinity(char **message);
 
 /*! \brief
  * Pause for use in a spin-wait loop.
similarity index 99%
rename from src/gromacs/fileio/path.cpp
rename to src/gromacs/utility/path.cpp
index b9db04d7a1be0c6450de5d45c180a8f8e99b43a3..44fe331b60f2ca9a44cddc09483e06d9445bdcde 100644 (file)
@@ -37,7 +37,7 @@
  * Implements functions in path.h.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \ingroup module_fileio
+ * \ingroup module_utility
  */
 #include "path.h"
 
@@ -59,7 +59,7 @@
 #endif
 #endif
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/stringutil.h"
 
 namespace
similarity index 97%
rename from src/gromacs/fileio/path.h
rename to src/gromacs/utility/path.h
index b900676d73687b261a04a4f1281523264ca65876..a8132f7082de4c94f16b1bc5301fc4af559eecd8 100644 (file)
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
- * \ingroup module_fileio
+ * \ingroup module_utility
  */
-#ifndef GMX_FILEIO_PATH_H
-#define GMX_FILEIO_PATH_H
+#ifndef GMX_UTILITY_PATH_H
+#define GMX_UTILITY_PATH_H
 
 #include <string>
 #include <utility>
index 85ae9d0b1412082f7c32be90ef37dee1e30f21ea..54145246890fe1092ddc90470bf543796cdb54e5 100644 (file)
@@ -49,8 +49,7 @@
 #include <dmalloc.h>
 #endif
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
-
+#include "gromacs/utility/fatalerror.h"
 #ifdef PRINT_ALLOC_KB
 #include "gromacs/utility/gmxmpi.h"
 #endif
index e49e19b2f2cccaba65e69df6226a1b4ab8526749..56116bad756453436cd269ca4f8bb5e3105cf8b4 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "vec.h"
 #include "vcm.h"
 #include "mdebin.h"
@@ -54,7 +55,6 @@
 #include "md_support.h"
 #include "md_logging.h"
 #include "network.h"
-#include "xvgr.h"
 #include "physics.h"
 #include "names.h"
 #include "force.h"
index ca96aadcfb6bb6bf4e91d48e5ec0af0bc454013f..a783c3505453e6ffe3218743980743497caf48c4 100644 (file)
@@ -44,7 +44,6 @@
 
 #include "gromacs/legacyheaders/checkpoint.h"
 #include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/main.h"
 #include "gromacs/legacyheaders/mdrun.h"
@@ -55,6 +54,7 @@
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/filenm.h"
+#include "gromacs/utility/fatalerror.h"
 
 int gmx_mdrun(int argc, char *argv[])
 {
index cf83ce57b58c02cf477638d3a33036295337b1a4..3a96c0c78b3741c6a9a715af39de257c675e571b 100644 (file)
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "vec.h"
 #include "macros.h"
-#include "main.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "index.h"
 #include "physics.h"
index b4206046761090dc410b5a2ec4baba95d672a8d6..be82beb060f147b10e2316a0c4be1bb38b55cc8a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,6 +38,7 @@
 
 #include "typedefs.h"
 #include "types/membedt.h"
+#include "gromacs/fileio/filenm.h"
 
 #ifdef __cplusplus
 extern "C" {
index e88b4b3b457fe17cb9c598bbe287a48dff591e82..25d6fd2563583e669a3c336e11711d592cee6ffb 100644 (file)
@@ -36,7 +36,6 @@
 #include <config.h>
 #endif
 
-#include "gromacs/utility/smalloc.h"
 #include "types/commrec.h"
 #include "network.h"
 #include "calcgrid.h"
@@ -49,6 +48,9 @@
 #include "md_logging.h"
 #include "pme_loadbal.h"
 
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
+
 /* Parameters and setting for one PP-PME setup */
 typedef struct {
     real      rcut_coulomb;    /* Coulomb cut-off                              */
index d52bf5b95f9b250afb598d4f027ca04d3d6a275b..b3a1aa14c51c923ba16be7b34291061c2fd5d397 100644 (file)
@@ -49,6 +49,7 @@
 #include "vec.h"
 #include "names.h"
 #include "domdec.h"
+#include "main.h"
 #include "gromacs/random/random.h"
 
 #define PROBABILITYCUTOFF 100
index a0d7b7f8a4eb3f811424b7b5416f01511a03fa71..ad1b6f2a0745505b37e84714bc94fcc290599ce2 100644 (file)
@@ -47,7 +47,6 @@
 
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "copyrite.h"
 #include "force.h"
 #include "mdrun.h"
 #include "gmx_detect_hardware.h"
 #include "gmx_omp_nthreads.h"
 #include "gromacs/gmxpreprocess/calc_verletbuf.h"
-#include "gmx_fatal_collective.h"
 #include "membed.h"
 #include "macros.h"
 #include "gmx_thread_affinity.h"
 #include "inputrec.h"
+#include "main.h"
 
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/mdlib/nbnxn_consts.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/gmxmpi.h"
-#include "gromacs/utility/gmxomp.h"
 #include "gromacs/swap/swapcoords.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/pulling/pull.h"
@@ -1204,29 +1202,14 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         }
     }
 
-    /* Check for externally set OpenMP affinity and turn off internal
-     * pinning if any is found. We need to do this check early to tell
-     * thread-MPI whether it should do pinning when spawning threads.
-     * TODO: the above no longer holds, we should move these checks down
-     */
-    gmx_omp_check_thread_affinity(fplog, cr, hw_opt);
-
     /* Check and update the hardware options for internal consistency */
     check_and_update_hw_opt_1(hw_opt, SIMMASTER(cr));
 
+    /* Early check for externally set process affinity. */
+    gmx_check_thread_affinity_set(fplog, cr,
+                                  hw_opt, hwinfo->nthreads_hw_avail, FALSE);
     if (SIMMASTER(cr))
     {
-#ifdef GMX_THREAD_MPI
-        /* Early check for externally set process affinity.
-         * With thread-MPI this is needed as pinning might get turned off,
-         * which needs to be known before starting thread-MPI.
-         * With thread-MPI hw_opt is processed here on the master rank
-         * and passed to the other ranks later, so we only do this on master.
-         */
-        gmx_check_thread_affinity_set(fplog,
-                                      NULL,
-                                      hw_opt, hwinfo->nthreads_hw_avail, FALSE);
-#endif
 
 #ifdef GMX_THREAD_MPI
         if (cr->npmenodes > 0 && hw_opt->nthreads_tmpi <= 0)
index 4bab454016502424c4bc22a3d049ed33600dabdd..261ae857101605fce46a6f2bea4fc4c0572f7917 100644 (file)
 #  include <config.h>
 #endif
 
-#include "testutils/integrationtests.h"
-#include "testutils/testoptions.h"
-#include "testutils/cmdlinetest.h"
-#include "gromacs/options/options.h"
-#include "gromacs/options/basicoptions.h"
-#include "gromacs/utility/file.h"
-#include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/types/simple.h"
+
 #include "gromacs/gmxpreprocess/grompp.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/file.h"
+
 #include "programs/mdrun/mdrun_main.h"
 
+#include "testutils/integrationtests.h"
+#include "testutils/testoptions.h"
+#include "testutils/cmdlinetest.h"
+
 namespace gmx
 {
 namespace test
index 3cd40eac2b06c0f164a3565a27451fe0f43aac3a..0a915c61d9b569d5b356b815a8a053b743e886d3 100644 (file)
 
 #include <gtest/gtest.h>
 
-#include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/fileio/path.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "../mdrun_main.h"
+#include "programs/mdrun/mdrun_main.h"
 
 #include "testutils/cmdlinetest.h"
 
index 3d5d76145c9cfeaa411bbe90a196d16fa6c12317..cabbc8d3df1ea9cff767e67cdba7657b2aee670f 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <algorithm>
 
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 
 #include "x11.h"
 #include "xutil.h"
index e4ba670a4c7127e398949bc854aa0039c9837cf7..0955be77c96ec2cc421058aff90fdb09ae8f22ef 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h> // for fork()
 #endif
 
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include "macros.h"
-#include "gromacs/utility/cstringutil.h"
 #include "x11.h"
 #include "xdlghi.h"
 #include "xmb.h"
 #include "names.h"
 #include "nmol.h"
 #include "manager.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define MBFLAGS /* MB_APPLMODAL | */ MB_DONTSHOW
 
index 55a44a7fb8c11c73c73247d8b8ca1037f5dbeab9..83f66a80a692e38f2650398c2ea4a0f5062c972a 100644 (file)
 #include <config.h>
 #endif
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
+
+#include "fgrid.h"
+
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "fgrid.h"
-#include "gromacs/fileio/futil.h"
 
 static const char *type[] = {
     "button", "radiobuttons", "groupbox", "checkbox",
index 1acaa8c42bad028d95ddb069292e39c5f60dc865..8534a3a765f9d04ed6438728062ba324178c1cbc 100644 (file)
 
 #include <algorithm>
 
-#include "sysstuff.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "index.h"
 #include "xdlghi.h"
 #include "dialogs.h"
 #include "index.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 t_filter *init_filter(t_atoms *atoms, const char *fn, int natom_trx)
 {
index 11ef88b9664d9632fb8110304b8fb994e45fbbba..33243471694af9086e784d6ffe84f37d87b07433 100644 (file)
@@ -38,7 +38,8 @@
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
+#include <stdlib.h>
+
 #include "macros.h"
 #include "xutil.h"
 #include "Xstuff.h"
index eae974e53a7b6ceaef58e02ba96a1bc9411fd90d..1e3cdfd2c588a3edff0e1c86aaa4e3353944c4fe 100644 (file)
 #endif
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h> // for usleep()
 #endif
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "macros.h"
@@ -58,7 +58,7 @@
 #include "vec.h"
 #include "gromacs/utility/cstringutil.h"
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/math/utilities.h"
 
index c6ba93966a7054bd9ab0f1b5cb15c3642ce5e07a..311c9e4e91a4c1951eb9cc0d3382e389bd449191 100644 (file)
@@ -39,9 +39,9 @@
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
+#include <stdlib.h>
 #include <string.h>
-#include "gromacs/utility/smalloc.h"
+
 #include "macros.h"
 #include "xutil.h"
 #include "buttons.h"
@@ -51,6 +51,7 @@
 
 #include "gromacs/fileio/writeps.h"
 #include "gromacs/math/3dview.h"
+#include "gromacs/utility/smalloc.h"
 
 #define MSIZE 4
 
index 5a6866fff4de98517d193ea23c2011a2f06b35c0..d385d27122f4511ac6555c6ee63dc87fbdba070b 100644 (file)
 #endif
 
 #include <math.h>
-#include "sysstuff.h"
+#include <stdlib.h>
 #include <string.h>
-#include "gromacs/utility/smalloc.h"
+
 #include "macros.h"
 #include "xutil.h"
-#include "gromacs/math/3dview.h"
-#include "gmx_fatal.h"
 #include "buttons.h"
 #include "manager.h"
 #include "nmol.h"
 #include "txtdump.h"
 #include "pbc.h"
 
+#include "gromacs/math/3dview.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
 #define MSIZE 4
 
 static bool MWCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
index aec59937e6fa56932dddddb9100ac924b267e7ad..fcc392998713a16ecc601f4b12473d646ea03e07 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
-#include "sysstuff.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
index e30b6f1a8d8330a54798b55681e42090e53bcbd2..eb2608b85d7e2886791f275e979d2740a0505115 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
+
 #include "typedefs.h"
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "Xstuff.h"
 #include "x11.h"
index dc4e0b6e4e661970ce433a0570e590e1adae7985..997ad2255a4c346fa0d464ff61008f40c6462c5a 100644 (file)
@@ -48,7 +48,7 @@
 #include "xutil.h"
 #include "xdlg.h"
 #include "xmb.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 /*****************************
  *
  * Helpful routines
index 5d280fc75d32db67fac7cb661943bc4f51d146cc..d8986152c4530eadd4c67ac69114551f5c013653 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <algorithm>
 
-#include "gmx_fatal.h"
-#include "gromacs/utility/cstringutil.h"
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "xutil.h"
 #include "xdlghi.h"
 #include "fgrid.h"
 
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
 t_dlgitem **CreateRadioButtonGroup(t_x11 *x11, char *szTitle,
                                    t_id GroupID, int nrb, t_id rb[],
                                    int nSelect,
index 590bf733240a7e36d2c6167af45cc258f0730a7c..b3dd9ca3ca27710e35fda756f0c8475d4738591d 100644 (file)
 
 #include <algorithm>
 
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "Xstuff.h"
 #include "xdlgitem.h"
 
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
 #define BUFSIZE 16
 
 static t_dlgitem *newitem(void)
index 2b747ded6d549f7b208634ac52288d8dc6aec6bc..8e08a7b2668ca909661a96e63d3df4b06c7d705d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -49,7 +49,7 @@
 #include "xutil.h"
 #include "xdlg.h"
 #include "xmb.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs.bm"
 #include "stop.bm"
 #include "info.bm"
index f145e9adb1ec2a4cef98ec4b2f668e85d8dd8ee8..64828951721eabdb8951fa789c72cc823d597e08 100644 (file)
 #include <libxml/parser.h>
 #include <libxml/xmlmemory.h>
 
-#include "gromacs/fileio/path.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "testutils/testasserts.h"
index b7616302804d9d2596a64270f1f5724789447a10..6a1b4c27bd5112b6c148db59e7e225cf900285a9 100644 (file)
 
 #include <gtest/gtest.h>
 
-#include "gromacs/fileio/path.h"
 #include "gromacs/options/options.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/path.h"
 
 #include "testutils/testoptions.h"
 
index 1d7ac5c8e846a9fdd1c1db4278eaeed4d75c67df..2d6bda6895030bd3c163deefa3a8395e5cedab3d 100644 (file)
@@ -90,7 +90,7 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         --suppress=variableScope
         --suppress=unnecessaryForwardDeclaration
         --suppress=invalidscanf:src/gromacs/fileio/matio.cpp
-        --suppress=invalidscanf:src/gromacs/gmxlib/xvgr.cpp
+        --suppress=invalidscanf:src/gromacs/fileio/xvgr.cpp
         --suppress=invalidscanf:src/gromacs/gmxpreprocess/pdb2top.cpp
         --suppress=*:src/gromacs/selection/scanner.cpp)