From: Roland Schulz Date: Mon, 16 Jul 2018 16:35:11 +0000 (-0700) Subject: Remove gmx custom fixed int (e.g. gmx_int64_t) types X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=4194255e4b12e46aec3f6d23eb1100064eb586a4;p=alexxy%2Fgromacs.git Remove gmx custom fixed int (e.g. gmx_int64_t) types Change-Id: I20b6681f55c06e535524923351c9919ec4c7ffa3 --- diff --git a/src/gromacs/analysisdata/modules/histogram.cpp b/src/gromacs/analysisdata/modules/histogram.cpp index 932f9e7dae..a8a294d54e 100644 --- a/src/gromacs/analysisdata/modules/histogram.cpp +++ b/src/gromacs/analysisdata/modules/histogram.cpp @@ -601,7 +601,7 @@ class AnalysisDataSimpleHistogramModule::Impl : public internal::BasicHistogramI { public: //! Shorthand for the per-frame accumulation data structure type. - typedef AnalysisDataFrameLocalData FrameLocalData; + typedef AnalysisDataFrameLocalData FrameLocalData; Impl() {} //! Creates an histogram impl with defined bin parameters. diff --git a/src/gromacs/awh/awh.cpp b/src/gromacs/awh/awh.cpp index a2425ddb8d..95bca480dd 100644 --- a/src/gromacs/awh/awh.cpp +++ b/src/gromacs/awh/awh.cpp @@ -194,7 +194,7 @@ Awh::Awh(FILE *fplog, Awh::~Awh() = default; -bool Awh::isOutputStep(gmx_int64_t step) const +bool Awh::isOutputStep(int64_t step) const { return (nstout_ > 0 && step % nstout_ == 0); } @@ -204,7 +204,7 @@ real Awh::applyBiasForcesAndUpdateBias(int ePBC, const matrix box, gmx::ForceWithVirial *forceWithVirial, double t, - gmx_int64_t step, + int64_t step, gmx_wallcycle *wallcycle, FILE *fplog) { @@ -364,7 +364,7 @@ void Awh::registerAwhWithPull(const AwhParams &awhParams, } /* Fill the AWH data block of an energy frame with data (if there is any). */ -void Awh::writeToEnergyFrame(gmx_int64_t step, +void Awh::writeToEnergyFrame(int64_t step, t_enxframe *frame) const { GMX_ASSERT(MASTER(commRecord_), "writeToEnergyFrame should only be called on the master rank"); diff --git a/src/gromacs/awh/awh.h b/src/gromacs/awh/awh.h index 858da6b756..7bbc2a97aa 100644 --- a/src/gromacs/awh/awh.h +++ b/src/gromacs/awh/awh.h @@ -168,7 +168,7 @@ class Awh const matrix box, gmx::ForceWithVirial *forceWithVirial, double t, - gmx_int64_t step, + int64_t step, gmx_wallcycle *wallcycle, FILE *fplog); @@ -211,7 +211,7 @@ class Awh * \param[in] step The current MD step. * \param[in,out] fr Energy data frame. */ - void writeToEnergyFrame(gmx_int64_t step, + void writeToEnergyFrame(int64_t step, t_enxframe *fr) const; /*! \brief Returns string "AWH" for registering AWH as an external potential provider with the pull module. @@ -237,11 +237,11 @@ class Awh * * \param[in] step The current MD step. */ - bool isOutputStep(gmx_int64_t step) const; + bool isOutputStep(int64_t step) const; private: std::vector biasCoupledToSystem_; /**< AWH biases and definitions of their coupling to the system. */ - const gmx_int64_t seed_; /**< Random seed for MC jumping with umbrella type bias potential. */ + const int64_t seed_; /**< Random seed for MC jumping with umbrella type bias potential. */ const int nstout_; /**< Interval in steps for writing to energy file. */ const t_commrec *commRecord_; /**< Pointer to the communication record. */ const gmx_multisim_t *multiSimRecord_; /**< Handler for multi-simulations. */ diff --git a/src/gromacs/awh/bias.cpp b/src/gromacs/awh/bias.cpp index 14f4bc770c..be165c0ca9 100644 --- a/src/gromacs/awh/bias.cpp +++ b/src/gromacs/awh/bias.cpp @@ -73,7 +73,7 @@ namespace gmx { -void Bias::warnForHistogramAnomalies(double t, gmx_int64_t step, FILE *fplog) +void Bias::warnForHistogramAnomalies(double t, int64_t step, FILE *fplog) { const int maxNumWarningsInCheck = 1; /* The maximum number of warnings to print per check */ const int maxNumWarningsInRun = 10; /* The maximum number of warnings to print in a run */ @@ -109,8 +109,8 @@ Bias::calcForceAndUpdateBias(const awh_dvec coordValue, const t_commrec *commRecord, const gmx_multisim_t *ms, double t, - gmx_int64_t step, - gmx_int64_t seed, + int64_t step, + int64_t seed, FILE *fplog) { if (step < 0) @@ -215,7 +215,7 @@ Bias::calcForceAndUpdateBias(const awh_dvec coordValue, * \param[in] pointState The state of the points in a bias. * \returns the total sample count. */ -static gmx_int64_t countSamples(const std::vector &pointState) +static int64_t countSamples(const std::vector &pointState) { double numSamples = 0; for (const PointState &point : pointState) @@ -223,7 +223,7 @@ static gmx_int64_t countSamples(const std::vector &pointState) numSamples += point.weightSumTot(); } - return static_cast(numSamples + 0.5); + return static_cast(numSamples + 0.5); } /*! \brief @@ -237,9 +237,9 @@ static gmx_int64_t countSamples(const std::vector &pointState) static void ensureStateAndRunConsistency(const BiasParams ¶ms, const BiasState &state) { - gmx_int64_t numSamples = countSamples(state.points()); - gmx_int64_t numUpdatesFromSamples = numSamples/(params.numSamplesUpdateFreeEnergy_*params.numSharedUpdate); - gmx_int64_t numUpdatesExpected = state.histogramSize().numUpdates(); + int64_t numSamples = countSamples(state.points()); + int64_t numUpdatesFromSamples = numSamples/(params.numSamplesUpdateFreeEnergy_*params.numSharedUpdate); + int64_t numUpdatesExpected = state.histogramSize().numUpdates(); if (numUpdatesFromSamples != numUpdatesExpected) { std::string mesg = gmx::formatString("The number of AWH updates in the checkpoint file (%ld) does not match the total number of AWH samples divided by the number of samples per update for %d sharing AWH bias(es) (%ld/%d=%ld)", diff --git a/src/gromacs/awh/bias.h b/src/gromacs/awh/bias.h index c81c4e0c4d..2e3a8c5798 100644 --- a/src/gromacs/awh/bias.h +++ b/src/gromacs/awh/bias.h @@ -210,8 +210,8 @@ class Bias const t_commrec *commRecord, const gmx_multisim_t *ms, double t, - gmx_int64_t step, - gmx_int64_t seed, + int64_t step, + int64_t seed, FILE *fplog); /*! \brief @@ -313,7 +313,7 @@ class Bias * \param[in,out] fplog Output file for warnings. */ void warnForHistogramAnomalies(double t, - gmx_int64_t step, + int64_t step, FILE *fplog); /*! \brief diff --git a/src/gromacs/awh/biasparams.cpp b/src/gromacs/awh/biasparams.cpp index 5e72ba4f90..f4db497002 100644 --- a/src/gromacs/awh/biasparams.cpp +++ b/src/gromacs/awh/biasparams.cpp @@ -74,10 +74,10 @@ namespace * \param[in] awhBiasParams Bias parameters. * \returns the target update interval in steps. */ -gmx_int64_t calcTargetUpdateInterval(const AwhParams &awhParams, - const AwhBiasParams &awhBiasParams) +int64_t calcTargetUpdateInterval(const AwhParams &awhParams, + const AwhBiasParams &awhBiasParams) { - gmx_int64_t numStepsUpdateTarget = 0; + int64_t numStepsUpdateTarget = 0; /* Set the target update frequency based on the target distrbution type * (this could be made a user-option but there is most likely no big need * for tweaking this for most users). @@ -119,9 +119,9 @@ gmx_int64_t calcTargetUpdateInterval(const AwhParams &awhParams, * \param[in] gridAxis The Grid axes. * \returns the check interval in steps. */ -gmx_int64_t calcCheckCoveringInterval(const AwhParams &awhParams, - const std::vector &dimParams, - const std::vector &gridAxis) +int64_t calcCheckCoveringInterval(const AwhParams &awhParams, + const std::vector &dimParams, + const std::vector &gridAxis) { /* Each sample will have a width of sigma. To cover the axis a minimum number of samples of width sigma is required. */ diff --git a/src/gromacs/awh/biasparams.h b/src/gromacs/awh/biasparams.h index be7e021843..d8eb69c317 100644 --- a/src/gromacs/awh/biasparams.h +++ b/src/gromacs/awh/biasparams.h @@ -116,7 +116,7 @@ class BiasParams * * \param[in] step The MD step number. */ - inline bool isSampleCoordStep(gmx_int64_t step) const + inline bool isSampleCoordStep(int64_t step) const { return (step > 0 && step % numStepsSampleCoord_ == 0); } @@ -126,7 +126,7 @@ class BiasParams * * \param[in] step The MD step number. */ - inline bool isUpdateFreeEnergyStep(gmx_int64_t step) const + inline bool isUpdateFreeEnergyStep(int64_t step) const { int stepIntervalUpdateFreeEnergy = numSamplesUpdateFreeEnergy_*numStepsSampleCoord_; return (step > 0 && step % stepIntervalUpdateFreeEnergy == 0); @@ -137,7 +137,7 @@ class BiasParams * * \param[in] step The MD step number. */ - inline bool isUpdateTargetStep(gmx_int64_t step) const + inline bool isUpdateTargetStep(int64_t step) const { return step % numStepsUpdateTarget_ == 0; } @@ -154,7 +154,7 @@ class BiasParams * \returns true at steps where checks should be performed. * \note Only returns true at free energy update steps. */ - bool isCheckCoveringStep(gmx_int64_t step) const + bool isCheckCoveringStep(int64_t step) const { return step % numStepsCheckCovering_ == 0; } @@ -172,7 +172,7 @@ class BiasParams * \note Only returns true at free energy update steps. * \todo Currently this function just calls isCheckCoveringStep but the checks could be done less frequently. */ - bool isCheckHistogramForAnomaliesStep(gmx_int64_t step) const + bool isCheckHistogramForAnomaliesStep(int64_t step) const { return isCheckCoveringStep(step); } @@ -213,12 +213,12 @@ class BiasParams /* Data members */ const double invBeta; /**< 1/beta = kT in kJ/mol */ private: - const gmx_int64_t numStepsSampleCoord_; /**< Number of steps per coordinate value sample. */ + const int64_t numStepsSampleCoord_; /**< Number of steps per coordinate value sample. */ public: const int numSamplesUpdateFreeEnergy_; /**< Number of samples per free energy update. */ private: - const gmx_int64_t numStepsUpdateTarget_; /**< Number of steps per updating the target distribution. */ - const gmx_int64_t numStepsCheckCovering_; /**< Number of steps per checking for covering. */ + const int64_t numStepsUpdateTarget_; /**< Number of steps per updating the target distribution. */ + const int64_t numStepsCheckCovering_; /**< Number of steps per checking for covering. */ public: const int eTarget; /**< Type of target distribution. */ const double freeEnergyCutoffInKT; /**< Free energy cut-off in kT for cut-off target distribution. */ diff --git a/src/gromacs/awh/biassharing.cpp b/src/gromacs/awh/biassharing.cpp index 3bd98b82b0..0dfe8acec3 100644 --- a/src/gromacs/awh/biassharing.cpp +++ b/src/gromacs/awh/biassharing.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017, by the GROMACS development team, led by + * Copyright (c) 2017,2018, 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. @@ -135,7 +135,7 @@ void biasesAreCompatibleForSharingBetweenSimulations(const AwhParams & { if (awhParams.awhBiasParams[b].shareGroup > 0) { - std::vector pointSizes(numSim); + std::vector pointSizes(numSim); pointSizes[multiSimComm->sim] = pointSize[b]; gmx_sumli_sim(pointSizes.size(), pointSizes.data(), multiSimComm); for (int sim = 1; sim < numSim; sim++) diff --git a/src/gromacs/awh/biasstate.cpp b/src/gromacs/awh/biasstate.cpp index 029620dc07..b526ebee07 100644 --- a/src/gromacs/awh/biasstate.cpp +++ b/src/gromacs/awh/biasstate.cpp @@ -476,8 +476,8 @@ double BiasState::moveUmbrella(const std::vector &dimParams, const Grid &grid, gmx::ArrayRef probWeightNeighbor, gmx::ArrayRef biasForce, - gmx_int64_t step, - gmx_int64_t seed, + int64_t step, + int64_t seed, int indexSeed) { /* Generate and set a new coordinate reference value */ @@ -1011,7 +1011,7 @@ void BiasState::updateFreeEnergyAndAddSamplesToHistogram(const std::vector *updateList) { diff --git a/src/gromacs/awh/biasstate.h b/src/gromacs/awh/biasstate.h index 92f320bd4e..5fd7ccd204 100644 --- a/src/gromacs/awh/biasstate.h +++ b/src/gromacs/awh/biasstate.h @@ -268,8 +268,8 @@ class BiasState const Grid &grid, gmx::ArrayRef probWeightNeighbor, gmx::ArrayRef biasForce, - gmx_int64_t step, - gmx_int64_t seed, + int64_t step, + int64_t seed, int indexSeed); private: @@ -411,7 +411,7 @@ class BiasState const t_commrec *commRecord, const gmx_multisim_t *ms, double t, - gmx_int64_t step, + int64_t step, FILE *fplog, std::vector *updateList); diff --git a/src/gromacs/awh/coordstate.cpp b/src/gromacs/awh/coordstate.cpp index d591580be1..efd58c3397 100644 --- a/src/gromacs/awh/coordstate.cpp +++ b/src/gromacs/awh/coordstate.cpp @@ -95,9 +95,9 @@ namespace * \returns a sample index in [0, distr.size() - 1] */ int getSampleFromDistribution(ArrayRef distr, - gmx_int64_t seed, - gmx_int64_t indexSeed0, - gmx_int64_t indexSeed1) + int64_t seed, + int64_t indexSeed0, + int64_t indexSeed1) { gmx::ThreeFry2x64<0> rng(seed, gmx::RandomDomain::AwhBiasing); gmx::UniformRealDistribution uniformRealDistr; @@ -131,8 +131,8 @@ void CoordState::sampleUmbrellaGridpoint(const Grid &grid, int gridpointIndex, gmx::ArrayRef probWeightNeighbor, - gmx_int64_t step, - gmx_int64_t seed, + int64_t step, + int64_t seed, int indexSeed) { /* Sample new umbrella reference value from the probability distribution diff --git a/src/gromacs/awh/coordstate.h b/src/gromacs/awh/coordstate.h index 55a0faeead..3dfec0898c 100644 --- a/src/gromacs/awh/coordstate.h +++ b/src/gromacs/awh/coordstate.h @@ -97,8 +97,8 @@ class CoordState void sampleUmbrellaGridpoint(const Grid &grid, int gridpointIndex, gmx::ArrayRef probWeightNeighbor, - gmx_int64_t step, - gmx_int64_t seed, + int64_t step, + int64_t seed, int indexSeed); /*! \brief Update the coordinate value with coordValue. diff --git a/src/gromacs/awh/histogramsize.h b/src/gromacs/awh/histogramsize.h index 4ad7bcdc11..112fdbc999 100644 --- a/src/gromacs/awh/histogramsize.h +++ b/src/gromacs/awh/histogramsize.h @@ -185,7 +185,7 @@ class HistogramSize } private: - gmx_int64_t numUpdates_; /**< The number of updates performed since the start of the simulation. */ + int64_t numUpdates_; /**< The number of updates performed since the start of the simulation. */ /* The histogram size sets the update size and so controls the convergence rate of the free energy and bias. */ double histogramSize_; /**< Size of reference weight histogram. */ diff --git a/src/gromacs/awh/pointstate.h b/src/gromacs/awh/pointstate.h index 5f8a5d1765..aad5ee2641 100644 --- a/src/gromacs/awh/pointstate.h +++ b/src/gromacs/awh/pointstate.h @@ -295,7 +295,7 @@ class PointState * \returns true if at least one update was applied. */ bool performPreviouslySkippedUpdates(const BiasParams ¶ms, - gmx_int64_t numUpdates, + int64_t numUpdates, double weighthistScaling, double logPmfSumScaling) { @@ -307,8 +307,8 @@ class PointState } /* The most current past update */ - gmx_int64_t lastUpdateIndex = numUpdates; - gmx_int64_t numUpdatesSkipped = lastUpdateIndex - lastUpdateIndex_; + int64_t lastUpdateIndex = numUpdates; + int64_t numUpdatesSkipped = lastUpdateIndex - lastUpdateIndex_; if (numUpdatesSkipped == 0) { @@ -339,7 +339,7 @@ class PointState * \param[in] logPmfSumScaling Log of the scaling factor for the PMF histogram. */ void updateWithNewSampling(const BiasParams ¶ms, - gmx_int64_t numUpdates, + int64_t numUpdates, double weighthistScaling, double logPmfSumScaling) { @@ -503,17 +503,17 @@ class PointState } private: - double bias_; /**< Current biasing function estimate */ - double freeEnergy_; /**< Current estimate of the convolved free energy/PMF. */ - double target_; /**< Current target distribution, normalized to 1 */ - double targetConstantWeight_; /**< Constant target weight, from user data. */ - double weightSumIteration_; /**< Accumulated weight this iteration; note: only contains data for this Bias, even when sharing biases. */ - double weightSumTot_; /**< Accumulated weights, never reset */ - double weightSumRef_; /**< The reference weight histogram determining the free energy updates */ - gmx_int64_t lastUpdateIndex_; /**< The last update that was performed at this point, in units of number of updates. */ - double logPmfSum_; /**< Logarithm of the PMF histogram */ - double numVisitsIteration_; /**< Visits to this bin this iteration; note: only contains data for this Bias, even when sharing biases. */ - double numVisitsTot_; /**< Accumulated visits to this bin */ + double bias_; /**< Current biasing function estimate */ + double freeEnergy_; /**< Current estimate of the convolved free energy/PMF. */ + double target_; /**< Current target distribution, normalized to 1 */ + double targetConstantWeight_; /**< Constant target weight, from user data. */ + double weightSumIteration_; /**< Accumulated weight this iteration; note: only contains data for this Bias, even when sharing biases. */ + double weightSumTot_; /**< Accumulated weights, never reset */ + double weightSumRef_; /**< The reference weight histogram determining the free energy updates */ + int64_t lastUpdateIndex_; /**< The last update that was performed at this point, in units of number of updates. */ + double logPmfSum_; /**< Logarithm of the PMF histogram */ + double numVisitsIteration_; /**< Visits to this bin this iteration; note: only contains data for this Bias, even when sharing biases. */ + double numVisitsTot_; /**< Accumulated visits to this bin */ }; } // namespace gmx diff --git a/src/gromacs/awh/read-params.cpp b/src/gromacs/awh/read-params.cpp index c8008f1598..45ece6574b 100644 --- a/src/gromacs/awh/read-params.cpp +++ b/src/gromacs/awh/read-params.cpp @@ -489,7 +489,7 @@ AwhParams *readAndCheckAwhParams(std::vector *inp, const t_inputrec * if (awhParams->seed == -1) { awhParams->seed = static_cast(gmx::makeRandomSeed()); - fprintf(stderr, "Setting the AWH bias MC random seed to %" GMX_PRId64 "\n", awhParams->seed); + fprintf(stderr, "Setting the AWH bias MC random seed to %" PRId64 "\n", awhParams->seed); } printStringNoNewline(inp, "Data output interval in number of steps"); diff --git a/src/gromacs/awh/tests/bias.cpp b/src/gromacs/awh/tests/bias.cpp index 663a6b3dd8..51fb32b0b8 100644 --- a/src/gromacs/awh/tests/bias.cpp +++ b/src/gromacs/awh/tests/bias.cpp @@ -105,7 +105,7 @@ static AwhTestParameters getAwhTestParameters(int eawhgrowth, double convFactor = 1; double k = 1000; - gmx_int64_t seed = 93471803; + int64_t seed = 93471803; params.dimParams.push_back(DimParams(convFactor, k, params.beta)); @@ -157,7 +157,7 @@ class BiasTest : public ::testing::TestWithParam { public: //! Random seed for AWH MC sampling - gmx_int64_t seed_; + int64_t seed_; //! Coordinates representing a trajectory in time std::vector coordinates_; @@ -227,7 +227,7 @@ TEST_P(BiasTest, ForcesBiasPmf) double coordMaxValue = 0; double potentialJump = 0; - gmx_int64_t step = 0; + int64_t step = 0; for (auto &coord : coordinates_) { coordMaxValue = std::max(coordMaxValue, std::abs(coord)); @@ -305,13 +305,13 @@ TEST(BiasTest, DetectsCovering) * coordinate range in a semi-realistic way. The period is 4*pi=12.57. * We get out of the initial stage after 4 coverings at step 300. */ - const gmx_int64_t exitStepRef = 300; + const int64_t exitStepRef = 300; const double midPoint = 0.5*(awhDimParams.end + awhDimParams.origin); const double halfWidth = 0.5*(awhDimParams.end - awhDimParams.origin); bool inInitialStage = bias.state().inInitialStage(); /* Normally this loop exits at exitStepRef, but we extend with failure */ - gmx_int64_t step; + int64_t step; for (step = 0; step <= 2*exitStepRef; step++) { double t = step*mdTimeStep; diff --git a/src/gromacs/commandline/pargs.h b/src/gromacs/commandline/pargs.h index b09454ff87..6638692d5b 100644 --- a/src/gromacs/commandline/pargs.h +++ b/src/gromacs/commandline/pargs.h @@ -99,7 +99,7 @@ typedef struct /** Integer value for etINT. */ int *i; /** Integer value for etINT64. */ - gmx_int64_t *is; + int64_t *is; /** Real value for etREAL and etTIME. */ real *r; /*! \brief diff --git a/src/gromacs/commandline/tests/pargs.cpp b/src/gromacs/commandline/tests/pargs.cpp index e7a1062d0a..f38c38ee12 100644 --- a/src/gromacs/commandline/tests/pargs.cpp +++ b/src/gromacs/commandline/tests/pargs.cpp @@ -160,7 +160,7 @@ TEST_F(ParseCommonArgsTest, ParsesIntegerArgs) TEST_F(ParseCommonArgsTest, ParsesInt64Args) { - gmx_int64_t value1 = 0, value2 = 0, value3 = 3; + int64_t value1 = 0, value2 = 0, value3 = 3; t_pargs pa[] = { { "-i1", FALSE, etINT64, {&value1}, "Description" }, { "-i2", FALSE, etINT64, {&value2}, "Description" }, diff --git a/src/gromacs/domdec/cellsizes.cpp b/src/gromacs/domdec/cellsizes.cpp index 4db4992a24..e85f2e726f 100644 --- a/src/gromacs/domdec/cellsizes.cpp +++ b/src/gromacs/domdec/cellsizes.cpp @@ -336,7 +336,7 @@ set_dd_cell_sizes_slb(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox, static void dd_cell_sizes_dlb_root_enforce_limits(gmx_domdec_t *dd, int d, int dim, RowMaster *rowMaster, const gmx_ddbox_t *ddbox, - gmx_bool bUniform, gmx_int64_t step, real cellsize_limit_f, int range[]) + gmx_bool bUniform, int64_t step, real cellsize_limit_f, int range[]) { gmx_domdec_comm_t *comm; real halfway, cellsize_limit_f_i, region_size; @@ -549,7 +549,7 @@ static void set_dd_cell_sizes_dlb_root(gmx_domdec_t *dd, int d, int dim, RowMaster *rowMaster, const gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_int64_t step) + gmx_bool bUniform, int64_t step) { gmx_domdec_comm_t *comm = dd->comm; constexpr real c_relax = 0.5; @@ -769,7 +769,7 @@ static void distribute_dd_cell_sizes_dlb(gmx_domdec_t *dd, static void set_dd_cell_sizes_dlb_change(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_int64_t step) + gmx_bool bUniform, int64_t step) { for (int d = 0; d < dd->ndim; d++) { @@ -827,7 +827,7 @@ static void set_dd_cell_sizes_dlb_nochange(gmx_domdec_t *dd, static void set_dd_cell_sizes_dlb(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_bool bDoDLB, gmx_int64_t step, + gmx_bool bUniform, gmx_bool bDoDLB, int64_t step, gmx_wallcycle_t wcycle) { gmx_domdec_comm_t *comm; @@ -864,7 +864,7 @@ static void set_dd_cell_sizes_dlb(gmx_domdec_t *dd, void set_dd_cell_sizes(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_bool bDoDLB, gmx_int64_t step, + gmx_bool bUniform, gmx_bool bDoDLB, int64_t step, gmx_wallcycle_t wcycle) { gmx_domdec_comm_t *comm = dd->comm; diff --git a/src/gromacs/domdec/cellsizes.h b/src/gromacs/domdec/cellsizes.h index 2a06e40f30..9238f01332 100644 --- a/src/gromacs/domdec/cellsizes.h +++ b/src/gromacs/domdec/cellsizes.h @@ -81,7 +81,7 @@ set_dd_cell_sizes_slb(gmx_domdec_t *dd, /*! \brief General cell size adjustment, possibly applying dynamic load balancing */ void set_dd_cell_sizes(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_bool bDoDLB, gmx_int64_t step, + gmx_bool bUniform, gmx_bool bDoDLB, int64_t step, gmx_wallcycle_t wcycle); #endif diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index 3c8949c5c0..b89a53f46d 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -1009,7 +1009,7 @@ static void dd_move_cellx(gmx_domdec_t *dd, } } -static void write_dd_grid_pdb(const char *fn, gmx_int64_t step, +static void write_dd_grid_pdb(const char *fn, int64_t step, gmx_domdec_t *dd, matrix box, gmx_ddbox_t *ddbox) { rvec grid_s[2], *grid_r = nullptr, cx, r; @@ -1097,7 +1097,7 @@ static void write_dd_grid_pdb(const char *fn, gmx_int64_t step, } } -void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title, +void write_dd_pdb(const char *fn, int64_t step, const char *title, const gmx_mtop_t *mtop, const t_commrec *cr, int natoms, const rvec x[], const matrix box) { @@ -1757,7 +1757,7 @@ static void clearDDStateIndices(gmx_domdec_t *dd, } } -static bool check_grid_jump(gmx_int64_t step, +static bool check_grid_jump(int64_t step, const gmx_domdec_t *dd, real cutoff, const gmx_ddbox_t *ddbox, @@ -1967,7 +1967,7 @@ int dd_pme_maxshift_y(const gmx_domdec_t *dd) static void comm_dd_ns_cell_sizes(gmx_domdec_t *dd, gmx_ddbox_t *ddbox, rvec cell_ns_x0, rvec cell_ns_x1, - gmx_int64_t step) + int64_t step) { gmx_domdec_comm_t *comm; int dim_ind, dim; @@ -2487,7 +2487,7 @@ float dd_pme_f_ratio(gmx_domdec_t *dd) } } -static void dd_print_load(FILE *fplog, gmx_domdec_t *dd, gmx_int64_t step) +static void dd_print_load(FILE *fplog, gmx_domdec_t *dd, int64_t step) { int flags, d; char buf[22]; @@ -3902,7 +3902,7 @@ static void set_dlb_limits(gmx_domdec_t *dd) } -static void turn_on_dlb(FILE *fplog, const t_commrec *cr, gmx_int64_t step) +static void turn_on_dlb(FILE *fplog, const t_commrec *cr, int64_t step) { gmx_domdec_t *dd = cr->dd; gmx_domdec_comm_t *comm = dd->comm; @@ -3916,7 +3916,7 @@ static void turn_on_dlb(FILE *fplog, const t_commrec *cr, gmx_int64_t step) /* Turn off DLB if we're too close to the cell size limit. */ if (cellsize_min < comm->cellsize_limit*1.05) { - auto str = gmx::formatString("step %" GMX_PRId64 " Measured %.1f %% performance loss due to load imbalance, " + auto str = gmx::formatString("step %" PRId64 " Measured %.1f %% performance loss due to load imbalance, " "but the minimum cell size is smaller than 1.05 times the cell size limit." "Will no longer try dynamic load balancing.\n", step, dd_force_imb_perf_loss(dd)*100); dd_warning(cr, fplog, str.c_str()); @@ -3926,7 +3926,7 @@ static void turn_on_dlb(FILE *fplog, const t_commrec *cr, gmx_int64_t step) } char buf[STRLEN]; - sprintf(buf, "step %" GMX_PRId64 " Turning on dynamic load balancing, because the performance loss due to load imbalance is %.1f %%.\n", step, dd_force_imb_perf_loss(dd)*100); + sprintf(buf, "step %" PRId64 " Turning on dynamic load balancing, because the performance loss due to load imbalance is %.1f %%.\n", step, dd_force_imb_perf_loss(dd)*100); dd_warning(cr, fplog, buf); comm->dlbState = edlbsOnCanTurnOff; @@ -3965,23 +3965,23 @@ static void turn_on_dlb(FILE *fplog, const t_commrec *cr, gmx_int64_t step) } } -static void turn_off_dlb(FILE *fplog, const t_commrec *cr, gmx_int64_t step) +static void turn_off_dlb(FILE *fplog, const t_commrec *cr, int64_t step) { gmx_domdec_t *dd = cr->dd; char buf[STRLEN]; - sprintf(buf, "step %" GMX_PRId64 " Turning off dynamic load balancing, because it is degrading performance.\n", step); + sprintf(buf, "step %" PRId64 " Turning off dynamic load balancing, because it is degrading performance.\n", step); dd_warning(cr, fplog, buf); dd->comm->dlbState = edlbsOffCanTurnOn; dd->comm->haveTurnedOffDlb = true; dd->comm->ddPartioningCountFirstDlbOff = dd->ddp_count; } -static void turn_off_dlb_forever(FILE *fplog, const t_commrec *cr, gmx_int64_t step) +static void turn_off_dlb_forever(FILE *fplog, const t_commrec *cr, int64_t step) { GMX_RELEASE_ASSERT(cr->dd->comm->dlbState == edlbsOffCanTurnOn, "Can only turn off DLB forever when it was in the can-turn-on state"); char buf[STRLEN]; - sprintf(buf, "step %" GMX_PRId64 " Will no longer try dynamic load balancing, as it degraded performance.\n", step); + sprintf(buf, "step %" PRId64 " Will no longer try dynamic load balancing, as it degraded performance.\n", step); dd_warning(cr, fplog, buf); cr->dd->comm->dlbState = edlbsOffForever; } @@ -6214,7 +6214,7 @@ void print_dd_statistics(const t_commrec *cr, const t_inputrec *ir, FILE *fplog) } void dd_partition_system(FILE *fplog, - gmx_int64_t step, + int64_t step, const t_commrec *cr, gmx_bool bMasterState, int nstglobalcomm, @@ -6237,7 +6237,7 @@ void dd_partition_system(FILE *fplog, gmx_domdec_comm_t *comm; gmx_ddbox_t ddbox = {0}; t_block *cgs_gl; - gmx_int64_t step_pcoupl; + int64_t step_pcoupl; rvec cell_ns_x0, cell_ns_x1; int ncgindex_set, ncg_home_old = -1, ncg_moved, nat_f_novirsum; gmx_bool bBoxChanged, bNStGlobalComm, bDoDLB, bCheckWhetherToTurnDlbOn, bLogLoad; diff --git a/src/gromacs/domdec/domdec.h b/src/gromacs/domdec/domdec.h index 3ebbfe64ef..707e45c305 100644 --- a/src/gromacs/domdec/domdec.h +++ b/src/gromacs/domdec/domdec.h @@ -318,7 +318,7 @@ void dd_atom_sum_real(struct gmx_domdec_t *dd, real v[]); * When f!=NULL, *f will be reallocated to the size of state_local. */ void dd_partition_system(FILE *fplog, - gmx_int64_t step, + int64_t step, const t_commrec *cr, gmx_bool bMasterState, int nstglobalcomm, @@ -440,7 +440,7 @@ void dd_bonded_cg_distance(FILE *fplog, const gmx_mtop_t *mtop, * * When natoms=-1, dump all known atoms. */ -void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title, +void write_dd_pdb(const char *fn, int64_t step, const char *title, const gmx_mtop_t *mtop, const t_commrec *cr, int natoms, const rvec x[], const matrix box); diff --git a/src/gromacs/domdec/domdec_internal.h b/src/gromacs/domdec/domdec_internal.h index 16bb545212..819a2d4b48 100644 --- a/src/gromacs/domdec/domdec_internal.h +++ b/src/gromacs/domdec/domdec_internal.h @@ -470,7 +470,7 @@ struct gmx_domdec_comm_t /** Which cg distribution is stored on the master node, * stored as DD partitioning call count. */ - gmx_int64_t master_cg_ddp_count; + int64_t master_cg_ddp_count; /** The number of cg's received from the direct neighbors */ int zone_ncg1[DD_MAXZONE]; @@ -531,7 +531,7 @@ struct gmx_domdec_comm_t float cyclesPerStepBeforeDLB; /**< The averaged cycles per step over the last nstlist step before turning on DLB */ float cyclesPerStepDlbExpAverage; /**< The running average of the cycles per step during DLB */ bool haveTurnedOffDlb; /**< Have we turned off DLB (after turning DLB on)? */ - gmx_int64_t dlbSlowerPartitioningCount; /**< The DD step at which we last measured that DLB off was faster than DLB on, 0 if there was no such step */ + int64_t dlbSlowerPartitioningCount; /**< The DD step at which we last measured that DLB off was faster than DLB on, 0 if there was no such step */ /* Statistics for atoms */ double sum_nat[static_cast(DDAtomRanges::Type::Number)]; /**< The atoms per range, summed over the steps */ @@ -547,7 +547,7 @@ struct gmx_domdec_comm_t double load_pme; /**< Total time on our PME-only rank */ /** The last partition step */ - gmx_int64_t partition_step; + int64_t partition_step; /* Debugging */ int nstDDDump; /**< Step interval for dumping the local+non-local atoms to pdb */ diff --git a/src/gromacs/domdec/domdec_setup.cpp b/src/gromacs/domdec/domdec_setup.cpp index 2e3f2a8fdd..6be8f7971d 100644 --- a/src/gromacs/domdec/domdec_setup.cpp +++ b/src/gromacs/domdec/domdec_setup.cpp @@ -734,7 +734,7 @@ real dd_choose_grid(FILE *fplog, real cellsize_limit, real cutoff_dd, gmx_bool bInterCGBondeds) { - gmx_int64_t nnodes_div, ldiv; + int64_t nnodes_div, ldiv; real limit; if (MASTER(cr)) diff --git a/src/gromacs/domdec/domdec_struct.h b/src/gromacs/domdec/domdec_struct.h index 46acb33126..f923190ddc 100644 --- a/src/gromacs/domdec/domdec_struct.h +++ b/src/gromacs/domdec/domdec_struct.h @@ -209,7 +209,7 @@ struct gmx_domdec_t { gmx_domdec_comm_t *comm; /* The partioning count, to keep track of the state */ - gmx_int64_t ddp_count; + int64_t ddp_count; /* The managed atom sets that are updated in domain decomposition */ gmx::LocalAtomSetManager * atomSets; diff --git a/src/gromacs/domdec/redistribute.cpp b/src/gromacs/domdec/redistribute.cpp index 2d416ce94d..9a25296ffd 100644 --- a/src/gromacs/domdec/redistribute.cpp +++ b/src/gromacs/domdec/redistribute.cpp @@ -233,7 +233,7 @@ static void clear_and_mark_ind(int numAtomGroups, static void print_cg_move(FILE *fplog, gmx_domdec_t *dd, - gmx_int64_t step, int cg, int dim, int dir, + int64_t step, int cg, int dim, int dir, gmx_bool bHaveCgcmOld, real limitd, rvec cm_old, rvec cm_new, real pos_d) { @@ -276,7 +276,7 @@ static void print_cg_move(FILE *fplog, [[ noreturn ]] static void cg_move_error(FILE *fplog, gmx_domdec_t *dd, - gmx_int64_t step, int cg, int dim, int dir, + int64_t step, int cg, int dim, int dir, gmx_bool bHaveCgcmOld, real limitd, rvec cm_old, rvec cm_new, real pos_d) { @@ -342,7 +342,7 @@ static int *getMovedBuffer(gmx_domdec_comm_t *comm, * * \TODO Rename cg to atomGroup. */ -static void calc_cg_move(FILE *fplog, gmx_int64_t step, +static void calc_cg_move(FILE *fplog, int64_t step, gmx_domdec_t *dd, t_state *state, const ivec tric_dir, matrix tcm, @@ -510,7 +510,7 @@ static void calc_cg_move(FILE *fplog, gmx_int64_t step, } } -void dd_redistribute_cg(FILE *fplog, gmx_int64_t step, +void dd_redistribute_cg(FILE *fplog, int64_t step, gmx_domdec_t *dd, ivec tric_dir, t_state *state, PaddedRVecVector *f, t_forcerec *fr, diff --git a/src/gromacs/domdec/redistribute.h b/src/gromacs/domdec/redistribute.h index 3d899a43a0..0b9d3a5d2f 100644 --- a/src/gromacs/domdec/redistribute.h +++ b/src/gromacs/domdec/redistribute.h @@ -54,7 +54,7 @@ class t_state; /*! \brief Redistribute the atoms to their, new, local domains */ void dd_redistribute_cg(FILE *fplog, - gmx_int64_t step, + int64_t step, gmx_domdec_t *dd, ivec tric_dir, t_state *state, diff --git a/src/gromacs/essentialdynamics/edsam.cpp b/src/gromacs/essentialdynamics/edsam.cpp index 78cff0ea6c..e535c5f5cc 100644 --- a/src/gromacs/essentialdynamics/edsam.cpp +++ b/src/gromacs/essentialdynamics/edsam.cpp @@ -733,7 +733,7 @@ static void write_edo_flood(t_edpar *edi, FILE *fp, real rmsd) /* From flood.xproj compute the Vfl(x) at this point */ -static real flood_energy(t_edpar *edi, gmx_int64_t step) +static real flood_energy(t_edpar *edi, int64_t step) { /* compute flooding energy Vfl Vfl = Efl * exp( - \frac {kT} {2Efl alpha^2} * sum_i { \lambda_i c_i^2 } ) @@ -881,7 +881,7 @@ static void do_single_flood( const rvec x[], rvec force[], t_edpar *edi, - gmx_int64_t step, + int64_t step, matrix box, const t_commrec *cr, gmx_bool bNS) /* Are we in a neighbor searching step? */ @@ -987,7 +987,7 @@ extern void do_flood(const t_commrec *cr, rvec force[], const gmx_edsam *ed, matrix box, - gmx_int64_t step, + int64_t step, gmx_bool bNS) { t_edpar *edi; @@ -1938,7 +1938,7 @@ static inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec } -static void do_linfix(rvec *xcoll, t_edpar *edi, gmx_int64_t step) +static void do_linfix(rvec *xcoll, t_edpar *edi, int64_t step) { int i, j; real proj, add; @@ -2176,7 +2176,7 @@ static void do_radcon(rvec *xcoll, t_edpar *edi) } -static void ed_apply_constraints(rvec *xcoll, t_edpar *edi, gmx_int64_t step) +static void ed_apply_constraints(rvec *xcoll, t_edpar *edi, int64_t step) { int i; @@ -2990,7 +2990,7 @@ gmx_edsam_t init_edsam( void do_edsam(const t_inputrec *ir, - gmx_int64_t step, + int64_t step, const t_commrec *cr, rvec xs[], rvec v[], diff --git a/src/gromacs/essentialdynamics/edsam.h b/src/gromacs/essentialdynamics/edsam.h index 9415744d81..8540a4d8e4 100644 --- a/src/gromacs/essentialdynamics/edsam.h +++ b/src/gromacs/essentialdynamics/edsam.h @@ -82,7 +82,7 @@ class Constraints; * \param box The simulation box. * \param ed The essential dynamics data. */ -void do_edsam(const t_inputrec *ir, gmx_int64_t step, +void do_edsam(const t_inputrec *ir, int64_t step, const t_commrec *cr, rvec xs[], rvec v[], matrix box, gmx_edsam *ed); @@ -140,7 +140,7 @@ void do_flood(const t_commrec *cr, rvec force[], const gmx_edsam *ed, matrix box, - gmx_int64_t step, + int64_t step, gmx_bool bNS); /*! \brief Clean up diff --git a/src/gromacs/ewald/pme-load-balancing.cpp b/src/gromacs/ewald/pme-load-balancing.cpp index e08289db77..6aa4e512b7 100644 --- a/src/gromacs/ewald/pme-load-balancing.cpp +++ b/src/gromacs/ewald/pme-load-balancing.cpp @@ -134,7 +134,7 @@ static const char *pmelblim_str[epmelblimNR] = struct pme_load_balancing_t { gmx_bool bSepPMERanks; /**< do we have separate PME ranks? */ gmx_bool bActive; /**< is PME tuning active? */ - gmx_int64_t step_rel_stop; /**< stop the tuning after this value of step_rel */ + int64_t step_rel_stop; /**< stop the tuning after this value of step_rel */ gmx_bool bTriggerOnDLB; /**< trigger balancing only on DD DLB */ gmx_bool bBalance; /**< are we in the balancing phase, i.e. trying different setups? */ int nstage; /**< the current maximum number of stages */ @@ -471,7 +471,7 @@ static int pme_loadbal_end(pme_load_balancing_t *pme_lb) /*! \brief Print descriptive string about what limits PME load balancing */ static void print_loadbal_limited(FILE *fp_err, FILE *fp_log, - gmx_int64_t step, + int64_t step, pme_load_balancing_t *pme_lb) { char buf[STRLEN], sbuf[22]; @@ -559,7 +559,7 @@ pme_load_balance(pme_load_balancing_t *pme_lb, interaction_const_t *ic, struct nonbonded_verlet_t *nbv, struct gmx_pme_t ** pmedata, - gmx_int64_t step) + int64_t step) { gmx_bool OK; pme_setup_t *set; @@ -910,8 +910,8 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb, t_forcerec *fr, t_state *state, gmx_wallcycle_t wcycle, - gmx_int64_t step, - gmx_int64_t step_rel, + int64_t step, + int64_t step_rel, gmx_bool *bPrinting) { int n_prev; diff --git a/src/gromacs/ewald/pme-load-balancing.h b/src/gromacs/ewald/pme-load-balancing.h index 3edce7e718..e074115936 100644 --- a/src/gromacs/ewald/pme-load-balancing.h +++ b/src/gromacs/ewald/pme-load-balancing.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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. @@ -101,8 +101,8 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb, t_forcerec *fr, t_state *state, gmx_wallcycle_t wcycle, - gmx_int64_t step, - gmx_int64_t step_rel, + int64_t step, + int64_t step_rel, gmx_bool *bPrinting); /*! \brief Finish the PME load balancing and print the settings when fplog!=NULL */ diff --git a/src/gromacs/ewald/pme-only.cpp b/src/gromacs/ewald/pme-only.cpp index 39327e8bdd..b3119b843c 100644 --- a/src/gromacs/ewald/pme-only.cpp +++ b/src/gromacs/ewald/pme-only.cpp @@ -158,7 +158,7 @@ static std::unique_ptr gmx_pme_pp_init(const t_commrec *cr) static void reset_pmeonly_counters(gmx_wallcycle_t wcycle, gmx_walltime_accounting_t walltime_accounting, t_nrnb *nrnb, t_inputrec *ir, - gmx_int64_t step, + int64_t step, bool useGpuForPme) { /* Reset all the counters related to performance over the run */ @@ -242,7 +242,7 @@ static int gmx_pme_recv_coeffs_coords(gmx_pme_pp *pme_pp, real *lambda_q, real *lambda_lj, gmx_bool *bEnerVir, - gmx_int64_t *step, + int64_t *step, ivec *grid_size, real *ewaldcoeff_q, real *ewaldcoeff_lj, @@ -549,7 +549,7 @@ int gmx_pmeonly(struct gmx_pme_t *pme, float cycles; int count; gmx_bool bEnerVir = FALSE; - gmx_int64_t step; + int64_t step; /* This data will only use with PME tuning, i.e. switching PME grids */ std::vector pmedata; diff --git a/src/gromacs/ewald/pme-pp-communication.h b/src/gromacs/ewald/pme-pp-communication.h index a69726550c..5d66cf3d5d 100644 --- a/src/gromacs/ewald/pme-pp-communication.h +++ b/src/gromacs/ewald/pme-pp-communication.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -100,7 +100,7 @@ struct gmx_pme_comm_n_box_t real lambda_q; /**< Free-energy lambda for electrostatics */ real lambda_lj; /**< Free-energy lambda for Lennard-Jones */ unsigned int flags; /**< Control flags */ - gmx_int64_t step; /**< MD integration step number */ + int64_t step; /**< MD integration step number */ //@{ /*! \brief Used in PME grid tuning */ ivec grid_size; diff --git a/src/gromacs/ewald/pme-pp.cpp b/src/gromacs/ewald/pme-pp.cpp index 0fe3266516..eaa7339ab7 100644 --- a/src/gromacs/ewald/pme-pp.cpp +++ b/src/gromacs/ewald/pme-pp.cpp @@ -96,7 +96,7 @@ static void gmx_pme_send_coeffs_coords(const t_commrec *cr, unsigned int flags, matrix box, rvec gmx_unused *x, real lambda_q, real lambda_lj, int maxshift_x, int maxshift_y, - gmx_int64_t step) + int64_t step) { gmx_domdec_t *dd; gmx_pme_comm_n_box_t *cnb; @@ -248,7 +248,7 @@ void gmx_pme_send_parameters(const t_commrec *cr, void gmx_pme_send_coordinates(const t_commrec *cr, matrix box, rvec *x, real lambda_q, real lambda_lj, gmx_bool bEnerVir, - gmx_int64_t step, gmx_wallcycle *wcycle) + int64_t step, gmx_wallcycle *wcycle) { wallcycle_start(wcycle, ewcPP_PMESENDX); @@ -298,7 +298,7 @@ void gmx_pme_send_switchgrid(const t_commrec *cr, #endif } -void gmx_pme_send_resetcounters(const t_commrec gmx_unused *cr, gmx_int64_t gmx_unused step) +void gmx_pme_send_resetcounters(const t_commrec gmx_unused *cr, int64_t gmx_unused step) { #if GMX_MPI gmx_pme_comm_n_box_t cnb; diff --git a/src/gromacs/ewald/pme.h b/src/gromacs/ewald/pme.h index d73343c831..0e3cf61391 100644 --- a/src/gromacs/ewald/pme.h +++ b/src/gromacs/ewald/pme.h @@ -216,13 +216,13 @@ void gmx_pme_send_parameters(const t_commrec *cr, void gmx_pme_send_coordinates(const t_commrec *cr, matrix box, rvec *x, real lambda_q, real lambda_lj, gmx_bool bEnerVir, - gmx_int64_t step, gmx_wallcycle *wcycle); + int64_t step, gmx_wallcycle *wcycle); /*! \brief Tell our PME-only node to finish */ void gmx_pme_send_finish(const t_commrec *cr); /*! \brief Tell our PME-only node to reset all cycle and flop counters */ -void gmx_pme_send_resetcounters(const t_commrec *cr, gmx_int64_t step); +void gmx_pme_send_resetcounters(const t_commrec *cr, int64_t step); /*! \brief PP nodes receive the long range forces from the PME nodes */ void gmx_pme_receive_f(const t_commrec *cr, diff --git a/src/gromacs/ewald/tests/pmesolvetest.cpp b/src/gromacs/ewald/tests/pmesolvetest.cpp index 6f418fabe2..532ba51bb9 100644 --- a/src/gromacs/ewald/tests/pmesolvetest.cpp +++ b/src/gromacs/ewald/tests/pmesolvetest.cpp @@ -164,13 +164,13 @@ class PmeSolveTest : public ::testing::TestWithParam gridValuesMagnitude = std::max(std::fabs(point.second.im), gridValuesMagnitude); } // Spline moduli participate 3 times in the computation; 2 is an additional factor for SIMD exp() precision - gmx_uint64_t gridUlpToleranceFactor = DIM * 2; + uint64_t gridUlpToleranceFactor = DIM * 2; if (method == PmeSolveAlgorithm::LennardJones) { // Lennard Jones is more complex and also uses erfc(), relax more gridUlpToleranceFactor *= 2; } - const gmx_uint64_t splineModuliDoublePrecisionUlps + const uint64_t splineModuliDoublePrecisionUlps = getSplineModuliDoublePrecisionUlps(inputRec.pme_order + 1); auto gridTolerance = relativeToleranceAsPrecisionDependentUlp(gridValuesMagnitude, @@ -206,7 +206,7 @@ class PmeSolveTest : public ::testing::TestWithParam /* Energy */ double energyMagnitude = 10.0; // TODO This factor is arbitrary, do a proper error-propagation analysis - gmx_uint64_t energyUlpToleranceFactor = gridUlpToleranceFactor * 2; + uint64_t energyUlpToleranceFactor = gridUlpToleranceFactor * 2; auto energyTolerance = relativeToleranceAsPrecisionDependentUlp(energyMagnitude, energyUlpToleranceFactor * c_splineModuliSinglePrecisionUlps, @@ -218,7 +218,7 @@ class PmeSolveTest : public ::testing::TestWithParam /* Virial */ double virialMagnitude = 1000.0; // TODO This factor is arbitrary, do a proper error-propagation analysis - gmx_uint64_t virialUlpToleranceFactor = energyUlpToleranceFactor * 2; + uint64_t virialUlpToleranceFactor = energyUlpToleranceFactor * 2; auto virialTolerance = relativeToleranceAsPrecisionDependentUlp(virialMagnitude, virialUlpToleranceFactor * c_splineModuliSinglePrecisionUlps, diff --git a/src/gromacs/ewald/tests/pmetestcommon.cpp b/src/gromacs/ewald/tests/pmetestcommon.cpp index d75672363d..8faab8c2af 100644 --- a/src/gromacs/ewald/tests/pmetestcommon.cpp +++ b/src/gromacs/ewald/tests/pmetestcommon.cpp @@ -89,12 +89,12 @@ bool pmeSupportsInputForMode(const t_inputrec *inputRec, CodePath mode) return implemented; } -gmx_uint64_t getSplineModuliDoublePrecisionUlps(int splineOrder) +uint64_t getSplineModuliDoublePrecisionUlps(int splineOrder) { /* Arbitrary ulp tolerance for sine/cosine implementation. It's * hard to know what to pick without testing lots of * implementations. */ - const gmx_uint64_t sineUlps = 10; + const uint64_t sineUlps = 10; return 4 * (splineOrder - 2) + 2 * sineUlps * splineOrder; } diff --git a/src/gromacs/ewald/tests/pmetestcommon.h b/src/gromacs/ewald/tests/pmetestcommon.h index 4378d1528c..5396cbb13e 100644 --- a/src/gromacs/ewald/tests/pmetestcommon.h +++ b/src/gromacs/ewald/tests/pmetestcommon.h @@ -109,11 +109,11 @@ typedef std::tuple PmeSolveOutput; bool pmeSupportsInputForMode(const t_inputrec *inputRec, CodePath mode); //! Spline moduli are computed in double precision, so they're very good in single precision -constexpr gmx_int64_t c_splineModuliSinglePrecisionUlps = 1; +constexpr int64_t c_splineModuliSinglePrecisionUlps = 1; /*! \brief For double precision checks, the recursive interpolation * and use of trig functions in make_dft_mod require a lot more flops, * and thus opportunity for deviation between implementations. */ -gmx_uint64_t getSplineModuliDoublePrecisionUlps(int splineOrder); +uint64_t getSplineModuliDoublePrecisionUlps(int splineOrder); // PME stages diff --git a/src/gromacs/fileio/checkpoint.cpp b/src/gromacs/fileio/checkpoint.cpp index 67a6fed490..e47d2eef12 100644 --- a/src/gromacs/fileio/checkpoint.cpp +++ b/src/gromacs/fileio/checkpoint.cpp @@ -294,7 +294,7 @@ static void do_cpt_int_err(XDR *xd, const char *desc, int *i, FILE *list) } } -static void do_cpt_step_err(XDR *xd, const char *desc, gmx_int64_t *i, FILE *list) +static void do_cpt_step_err(XDR *xd, const char *desc, int64_t *i, FILE *list) { char buf[STEPSTRSIZE]; @@ -897,7 +897,7 @@ struct CheckpointHeaderContents char ftime[CPTSTRLEN]; int eIntegrator; int simulation_part; - gmx_int64_t step; + int64_t step; double t; int nnodes; ivec dd_nc; @@ -1013,7 +1013,7 @@ static void do_cpt_header(XDR *xd, gmx_bool bRead, FILE *list, { int idum = 0; do_cpt_int_err(xd, "step", &idum, list); - contents->step = static_cast(idum); + contents->step = static_cast(idum); } do_cpt_double_err(xd, "t", &contents->t, list); do_cpt_int_err(xd, "#PP-ranks", &contents->nnodes, list); @@ -1785,7 +1785,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep, ivec domdecCells, int nppnodes, int eIntegrator, int simulation_part, gmx_bool bExpanded, int elamstats, - gmx_int64_t step, double t, + int64_t step, double t, t_state *state, ObservablesHistory *observablesHistory) { t_fileio *fp; @@ -2533,7 +2533,7 @@ void load_checkpoint(const char *fn, FILE **fplog, void read_checkpoint_part_and_step(const char *filename, int *simulation_part, - gmx_int64_t *step) + int64_t *step) { t_fileio *fp; @@ -2554,7 +2554,7 @@ void read_checkpoint_part_and_step(const char *filename, } static void read_checkpoint_data(t_fileio *fp, int *simulation_part, - gmx_int64_t *step, double *t, t_state *state, + int64_t *step, double *t, t_state *state, std::vector *outputfiles) { int ret; @@ -2635,7 +2635,7 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr) { t_state state; int simulation_part; - gmx_int64_t step; + int64_t step; double t; std::vector outputfiles; @@ -2643,8 +2643,8 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr) fr->natoms = state.natoms; fr->bStep = TRUE; - fr->step = gmx_int64_to_int(step, - "conversion of checkpoint to trajectory"); + fr->step = int64_to_int(step, + "conversion of checkpoint to trajectory"); fr->bTime = TRUE; fr->time = t; fr->bLambda = TRUE; @@ -2750,7 +2750,7 @@ read_checkpoint_simulation_part_and_filenames(t_fileio * int *simulation_part, std::vector *outputfiles) { - gmx_int64_t step = 0; + int64_t step = 0; double t; t_state state; diff --git a/src/gromacs/fileio/checkpoint.h b/src/gromacs/fileio/checkpoint.h index 3d3e73686c..3678cf149a 100644 --- a/src/gromacs/fileio/checkpoint.h +++ b/src/gromacs/fileio/checkpoint.h @@ -66,7 +66,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep, ivec domdecCells, int nppnodes, int eIntegrator, int simulation_part, gmx_bool bExpanded, int elamstats, - gmx_int64_t step, double t, + int64_t step, double t, t_state *state, ObservablesHistory *observablesHistory); /* Loads a checkpoint from fn for run continuation. @@ -106,7 +106,7 @@ void list_checkpoint(const char *fn, FILE *out); * does not exist, or is not readable. */ void read_checkpoint_part_and_step(const char *filename, int *simulation_part, - gmx_int64_t *step); + int64_t *step); /* ! \brief Read simulation part and output filenames from a checkpoint file * diff --git a/src/gromacs/fileio/enxio.cpp b/src/gromacs/fileio/enxio.cpp index 4990ce5de2..57dbd83469 100644 --- a/src/gromacs/fileio/enxio.cpp +++ b/src/gromacs/fileio/enxio.cpp @@ -1005,7 +1005,7 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr) { fprintf(stderr, "\nWARNING: there may be something wrong with energy file %s\n", gmx_fio_getname(ef->fio)); - fprintf(stderr, "Found: step=%" GMX_PRId64 ", nre=%d, nblock=%d, time=%g.\n", + fprintf(stderr, "Found: step=%" PRId64 ", nre=%d, nblock=%d, time=%g.\n", fr->step, fr->nre, fr->nblock, fr->t); } if (bRead && fr->nre > fr->e_alloc) diff --git a/src/gromacs/fileio/enxio.h b/src/gromacs/fileio/enxio.h index a4b1743446..fa11a2056e 100644 --- a/src/gromacs/fileio/enxio.h +++ b/src/gromacs/fileio/enxio.h @@ -106,7 +106,7 @@ struct t_enxsubblock float* fval; double* dval; int* ival; - gmx_int64_t* lval; + int64_t * lval; unsigned char* cval; char** sval; diff --git a/src/gromacs/fileio/g96io.cpp b/src/gromacs/fileio/g96io.cpp index 208c42d9cc..9773d3ef21 100644 --- a/src/gromacs/fileio/g96io.cpp +++ b/src/gromacs/fileio/g96io.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -284,7 +284,7 @@ int read_g96_conf(FILE *fp, const char *infile, char **name, t_trxframe *fr, bFinished = (fgets2(line, STRLEN, fp) == nullptr); } while (!bFinished && (line[0] == '#')); - sscanf(line, "%15" GMX_SCNd64 "%15lf", &(fr->step), &db1); + sscanf(line, "%15" SCNd64 "%15lf", &(fr->step), &db1); fr->time = db1; } else @@ -371,7 +371,7 @@ void write_g96_conf(FILE *out, const char *title, const t_trxframe *fr, if (fr->bStep || fr->bTime) { /* Officially the time format is %15.9, which is not enough for 10 ns */ - fprintf(out, "TIMESTEP\n%15" GMX_PRId64 "%15.6f\nEND\n", fr->step, fr->time); + fprintf(out, "TIMESTEP\n%15" PRId64 "%15.6f\nEND\n", fr->step, fr->time); } if (fr->bX) { diff --git a/src/gromacs/fileio/gmxfio-xdr.cpp b/src/gromacs/fileio/gmxfio-xdr.cpp index 84ed0ffb51..cd8789d7ac 100644 --- a/src/gromacs/fileio/gmxfio-xdr.cpp +++ b/src/gromacs/fileio/gmxfio-xdr.cpp @@ -112,7 +112,7 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio, float fvec[DIM]; double dvec[DIM]; int j, m, *iptr, idum; - gmx_int64_t sdum; + int64_t sdum; real *ptr; unsigned short us; double d = 0; @@ -184,12 +184,12 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio, case eioINT64: if (item && !fio->bRead) { - sdum = *(gmx_int64_t *) item; + sdum = *(int64_t *) item; } res = xdr_int64(fio->xdr, &sdum); if (item) { - *(gmx_int64_t *) item = sdum; + *(int64_t *) item = sdum; } break; case eioUCHAR: @@ -427,7 +427,7 @@ gmx_bool gmx_fio_doe_int(t_fileio *fio, int *item, return ret; } -gmx_bool gmx_fio_doe_int64(t_fileio *fio, gmx_int64_t *item, +gmx_bool gmx_fio_doe_int64(t_fileio *fio, int64_t *item, const char *desc, const char *srcfile, int line) { gmx_bool ret; @@ -583,7 +583,7 @@ gmx_bool gmx_fio_ndoe_int(t_fileio *fio, int *item, int n, -gmx_bool gmx_fio_ndoe_int64(t_fileio *fio, gmx_int64_t *item, int n, +gmx_bool gmx_fio_ndoe_int64(t_fileio *fio, int64_t *item, int n, const char *desc, const char *srcfile, int line) { gmx_bool ret = TRUE; @@ -699,7 +699,7 @@ void FileIOXdrSerializer::doInt(int *value) gmx_fio_do_int(fio_, *value); } -void FileIOXdrSerializer::doInt64(gmx_int64_t *value) +void FileIOXdrSerializer::doInt64(int64_t *value) { gmx_fio_do_int64(fio_, *value); } diff --git a/src/gromacs/fileio/gmxfio-xdr.h b/src/gromacs/fileio/gmxfio-xdr.h index 6980cc04a3..402ea39501 100644 --- a/src/gromacs/fileio/gmxfio-xdr.h +++ b/src/gromacs/fileio/gmxfio-xdr.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -67,7 +67,7 @@ gmx_bool gmx_fio_doe_gmx_bool(struct t_fileio *fio, gmx_bool *item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_doe_int(struct t_fileio *fio, int *item, const char *desc, const char *srcfile, int line); -gmx_bool gmx_fio_doe_int64(struct t_fileio *fio, gmx_int64_t *item, +gmx_bool gmx_fio_doe_int64(struct t_fileio *fio, int64_t *item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_doe_uchar(struct t_fileio *fio, unsigned char *item, const char *desc, const char *srcfile, int line); @@ -91,7 +91,7 @@ gmx_bool gmx_fio_ndoe_gmx_bool(struct t_fileio *fio, gmx_bool *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_ndoe_int(struct t_fileio *fio, int *item, int n, const char *desc, const char *srcfile, int line); -gmx_bool gmx_fio_ndoe_int64(struct t_fileio *fio, gmx_int64_t *item, int n, +gmx_bool gmx_fio_ndoe_int64(struct t_fileio *fio, int64_t *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_ndoe_uchar(struct t_fileio *fio, unsigned char *item, int n, @@ -148,7 +148,7 @@ class FileIOXdrSerializer : public ISerializer virtual void doBool(bool *value); virtual void doUChar(unsigned char *value); virtual void doInt(int *value); - virtual void doInt64(gmx_int64_t *value); + virtual void doInt64(int64_t *value); virtual void doFloat(float *value); virtual void doDouble(double *value); virtual void doString(std::string *value); diff --git a/src/gromacs/fileio/groio.cpp b/src/gromacs/fileio/groio.cpp index 4a97b9fbd3..8833b4b3d7 100644 --- a/src/gromacs/fileio/groio.cpp +++ b/src/gromacs/fileio/groio.cpp @@ -389,7 +389,7 @@ gmx_bool gro_next_x_or_v(FILE *status, t_trxframe *fr) { p += 5; fr->step = 0; // Default value if fr-bStep is false - fr->bStep = (sscanf(p, "%" GMX_SCNd64, &fr->step) == 1); + fr->bStep = (sscanf(p, "%" SCNd64, &fr->step) == 1); } if (atoms.nr != fr->natoms) diff --git a/src/gromacs/fileio/readinp.cpp b/src/gromacs/fileio/readinp.cpp index dbf0f08450..9d911c9b78 100644 --- a/src/gromacs/fileio/readinp.cpp +++ b/src/gromacs/fileio/readinp.cpp @@ -371,9 +371,9 @@ int get_eint(std::vector *inp, const char *name, int def, } /* Note that sanitizing the trailing part of inp[ii].value was the responsibility of read_inpfile() */ -gmx_int64_t get_eint64(std::vector *inp, - const char *name, gmx_int64_t def, - warninp_t wi) +int64_t get_eint64(std::vector *inp, + const char *name, int64_t def, + warninp_t wi) { std::vector &inpRef = *inp; char buf[32], *ptr, warn_buf[STRLEN]; @@ -382,14 +382,14 @@ gmx_int64_t get_eint64(std::vector *inp, if (ii == -1) { - sprintf(buf, "%" GMX_PRId64, def); + sprintf(buf, "%" PRId64, def); inpRef.back().value_.assign(buf); return def; } else { - gmx_int64_t ret = str_to_int64_t(inpRef[ii].value_.c_str(), &ptr); + int64_t ret = str_to_int64_t(inpRef[ii].value_.c_str(), &ptr); if (*ptr != '\0') { sprintf(warn_buf, "Right hand side '%s' for parameter '%s' in parameter file is not an integer value\n", inpRef[ii].value_.c_str(), inpRef[ii].name_.c_str()); diff --git a/src/gromacs/fileio/readinp.h b/src/gromacs/fileio/readinp.h index 2ed89b4c49..fa3a8e0724 100644 --- a/src/gromacs/fileio/readinp.h +++ b/src/gromacs/fileio/readinp.h @@ -135,9 +135,9 @@ void mark_einp_set(gmx::ArrayRef inp, const char *name); int get_eint(std::vector *inp, const char *name, int def, warninp_t wi); -gmx_int64_t get_eint64(std::vector *inp, - const char *name, gmx_int64_t def, - warninp_t); +int64_t get_eint64(std::vector *inp, + const char *name, int64_t def, + warninp_t); double get_ereal(std::vector *inp, const char *name, double def, warninp_t wi); diff --git a/src/gromacs/fileio/tngio.cpp b/src/gromacs/fileio/tngio.cpp index f068e9fdd2..268b4fbd42 100644 --- a/src/gromacs/fileio/tngio.cpp +++ b/src/gromacs/fileio/tngio.cpp @@ -225,7 +225,7 @@ void gmx_tng_close(gmx_tng_trajectory_t *gmx_tng) static void addTngMoleculeFromTopology(gmx_tng_trajectory_t gmx_tng, const char *moleculeName, const t_atoms *atoms, - gmx_int64_t numMolecules, + int64_t numMolecules, tng_molecule_t *tngMol) { tng_trajectory_t tng = gmx_tng->tng; @@ -448,9 +448,9 @@ static void set_writing_intervals(gmx_tng_trajectory_t gmx_tng, /* Define pointers to specific writing functions depending on if we * write float or double data */ typedef tng_function_status (*set_writing_interval_func_pointer)(tng_trajectory_t, - const gmx_int64_t, - const gmx_int64_t, - const gmx_int64_t, + const int64_t, + const int64_t, + const int64_t, const char*, const char, const char); @@ -620,7 +620,7 @@ static void add_selection_groups(gmx_tng_trajectory_t gmx_tng, tng_residue_t res; tng_atom_t atom; tng_bond_t tngBond; - gmx_int64_t nMols; + int64_t nMols; char *groupName; tng_trajectory_t tng = gmx_tng->tng; @@ -757,7 +757,7 @@ static void add_selection_groups(gmx_tng_trajectory_t gmx_tng, tng_molecule_existing_add(tng, &mol); tng_molecule_cnt_set(tng, mol, 1); tng_num_molecule_types_get(tng, &nMols); - for (gmx_int64_t k = 0; k < nMols; k++) + for (int64_t k = 0; k < nMols; k++) { tng_molecule_of_index_get(tng, k, &iterMol); if (iterMol == mol) @@ -800,7 +800,7 @@ void gmx_tng_prepare_low_prec_writing(gmx_tng_trajectory_t gmx_tng, void gmx_fwrite_tng(gmx_tng_trajectory_t gmx_tng, const gmx_bool bUseLossyCompression, - gmx_int64_t step, + int64_t step, real elapsedPicoSeconds, real lambda, const rvec *box, @@ -811,11 +811,11 @@ void gmx_fwrite_tng(gmx_tng_trajectory_t gmx_tng, { #if GMX_USE_TNG typedef tng_function_status (*write_data_func_pointer)(tng_trajectory_t, - const gmx_int64_t, + const int64_t, const double, const real*, - const gmx_int64_t, - const gmx_int64_t, + const int64_t, + const int64_t, const char*, const char, const char); @@ -825,7 +825,7 @@ void gmx_fwrite_tng(gmx_tng_trajectory_t gmx_tng, static write_data_func_pointer write_data = tng_util_generic_with_time_write; #endif double elapsedSeconds = elapsedPicoSeconds * PICO; - gmx_int64_t nParticles; + int64_t nParticles; char compression; @@ -994,7 +994,7 @@ void fflush_tng(gmx_tng_trajectory_t gmx_tng) float gmx_tng_get_time_of_final_frame(gmx_tng_trajectory_t gmx_tng) { #if GMX_USE_TNG - gmx_int64_t nFrames; + int64_t nFrames; double time; float fTime; tng_trajectory_t tng = gmx_tng->tng; @@ -1023,7 +1023,7 @@ void gmx_prepare_tng_writing(const char *filename, tng_trajectory_t *input = (gmx_tng_input && *gmx_tng_input) ? &(*gmx_tng_input)->tng : nullptr; /* FIXME after 5.0: Currently only standard block types are read */ const int defaultNumIds = 5; - static gmx_int64_t fallbackIds[defaultNumIds] = + static int64_t fallbackIds[defaultNumIds] = { TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS, TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES, @@ -1036,9 +1036,9 @@ void gmx_prepare_tng_writing(const char *filename, }; typedef tng_function_status (*set_writing_interval_func_pointer)(tng_trajectory_t, - const gmx_int64_t, - const gmx_int64_t, - const gmx_int64_t, + const int64_t, + const int64_t, + const int64_t, const char*, const char, const char); @@ -1061,7 +1061,7 @@ void gmx_prepare_tng_writing(const char *filename, * output tng container based on their respective values int * the input tng container */ double time, compression_precision; - gmx_int64_t n_frames_per_frame_set, interval = -1; + int64_t n_frames_per_frame_set, interval = -1; tng_compression_precision_get(*input, &compression_precision); tng_compression_precision_set(*output, compression_precision); @@ -1229,7 +1229,7 @@ convert_array_to_real_array(void *from, { for (j = 0; j < nValues; j++) { - to[i*nValues+j] = reinterpret_cast(from)[i*nValues+j] * fact; + to[i*nValues+j] = reinterpret_cast(from)[i*nValues+j] * fact; } } break; @@ -1269,7 +1269,7 @@ convert_array_to_real_array(void *from, real getDistanceScaleFactor(gmx_tng_trajectory_t in) { - gmx_int64_t exp = -1; + int64_t exp = -1; real distanceScaleFactor; // TODO Hopefully, TNG 2.0 will do this kind of thing for us @@ -1300,7 +1300,7 @@ void gmx_tng_setup_atom_subgroup(gmx_tng_trajectory_t gmx_tng, const char *name) { #if GMX_USE_TNG - gmx_int64_t nAtoms, cnt, nMols; + int64_t nAtoms, cnt, nMols; tng_molecule_t mol, iterMol; tng_chain_t chain; tng_residue_t res; @@ -1371,7 +1371,7 @@ void gmx_tng_setup_atom_subgroup(gmx_tng_trajectory_t gmx_tng, * other molecules to 0 */ tng_molecule_cnt_set(tng, mol, 1); tng_num_molecule_types_get(tng, &nMols); - for (gmx_int64_t k = 0; k < nMols; k++) + for (int64_t k = 0; k < nMols; k++) { tng_molecule_of_index_get(tng, k, &iterMol); if (iterMol == mol) @@ -1394,22 +1394,22 @@ void gmx_tng_setup_atom_subgroup(gmx_tng_trajectory_t gmx_tng, * and lose no information. */ gmx_bool gmx_read_next_tng_frame(gmx_tng_trajectory_t gmx_tng_input, t_trxframe *fr, - gmx_int64_t *requestedIds, + int64_t *requestedIds, int numRequestedIds) { #if GMX_USE_TNG tng_trajectory_t input = gmx_tng_input->tng; gmx_bool bOK = TRUE; tng_function_status stat; - gmx_int64_t numberOfAtoms = -1, frameNumber = -1; - gmx_int64_t nBlocks, blockId, *blockIds = nullptr, codecId; + int64_t numberOfAtoms = -1, frameNumber = -1; + int64_t nBlocks, blockId, *blockIds = nullptr, codecId; char datatype = -1; void *values = nullptr; double frameTime = -1.0; int size, blockDependency; double prec; const int defaultNumIds = 5; - static gmx_int64_t fallbackRequestedIds[defaultNumIds] = + static int64_t fallbackRequestedIds[defaultNumIds] = { TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS, TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES, @@ -1449,7 +1449,7 @@ gmx_bool gmx_read_next_tng_frame(gmx_tng_trajectory_t gmx_tng_input, &frameNumber, &nBlocks, &blockIds); - gmx::unique_cptr blockIdsGuard(blockIds); + gmx::unique_cptr blockIdsGuard(blockIds); if (!nextFrameExists) { return FALSE; @@ -1460,7 +1460,7 @@ gmx_bool gmx_read_next_tng_frame(gmx_tng_trajectory_t gmx_tng_input, return FALSE; } - for (gmx_int64_t i = 0; i < nBlocks; i++) + for (int64_t i = 0; i < nBlocks; i++) { blockId = blockIds[i]; tng_data_block_dependency_get(input, blockId, &blockDependency); @@ -1497,7 +1497,7 @@ gmx_bool gmx_read_next_tng_frame(gmx_tng_trajectory_t gmx_tng_input, switch (datatype) { case TNG_INT_DATA: - size = sizeof(gmx_int64_t); + size = sizeof(int64_t); break; case TNG_FLOAT_DATA: size = sizeof(float); @@ -1609,8 +1609,8 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, FILE *stream) { #if GMX_USE_TNG - gmx_int64_t nMolecules, nChains, nResidues, nAtoms, nFramesRead; - gmx_int64_t strideLength, nParticlesRead, nValuesPerFrameRead, *molCntList; + int64_t nMolecules, nChains, nResidues, nAtoms, nFramesRead; + int64_t strideLength, nParticlesRead, nValuesPerFrameRead, *molCntList; tng_molecule_t molecule; tng_chain_t chain; tng_residue_t residue; @@ -1629,7 +1629,7 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, /* Can the number of particles change in the trajectory or is it constant? */ tng_num_particles_variable_get(input, &varNAtoms); - for (gmx_int64_t i = 0; i < nMolecules; i++) + for (int64_t i = 0; i < nMolecules; i++) { tng_molecule_of_index_get(input, i, &molecule); tng_molecule_name_get(input, molecule, str, 256); @@ -1648,19 +1648,19 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, tng_molecule_num_chains_get(input, molecule, &nChains); if (nChains > 0) { - for (gmx_int64_t j = 0; j < nChains; j++) + for (int64_t j = 0; j < nChains; j++) { tng_molecule_chain_of_index_get(input, molecule, j, &chain); tng_chain_name_get(input, chain, str, 256); fprintf(stream, "\tChain: %s\n", str); tng_chain_num_residues_get(input, chain, &nResidues); - for (gmx_int64_t k = 0; k < nResidues; k++) + for (int64_t k = 0; k < nResidues; k++) { tng_chain_residue_of_index_get(input, chain, k, &residue); tng_residue_name_get(input, residue, str, 256); fprintf(stream, "\t\tResidue: %s\n", str); tng_residue_num_atoms_get(input, residue, &nAtoms); - for (gmx_int64_t l = 0; l < nAtoms; l++) + for (int64_t l = 0; l < nAtoms; l++) { tng_residue_atom_of_index_get(input, residue, l, &atom); tng_atom_name_get(input, atom, str, 256); @@ -1679,13 +1679,13 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, tng_molecule_num_residues_get(input, molecule, &nResidues); if (nResidues > 0) { - for (gmx_int64_t k = 0; k < nResidues; k++) + for (int64_t k = 0; k < nResidues; k++) { tng_molecule_residue_of_index_get(input, molecule, k, &residue); tng_residue_name_get(input, residue, str, 256); fprintf(stream, "\t\tResidue: %s\n", str); tng_residue_num_atoms_get(input, residue, &nAtoms); - for (gmx_int64_t l = 0; l < nAtoms; l++) + for (int64_t l = 0; l < nAtoms; l++) { tng_residue_atom_of_index_get(input, residue, l, &atom); tng_atom_name_get(input, atom, str, 256); @@ -1698,7 +1698,7 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, else { tng_molecule_num_atoms_get(input, molecule, &nAtoms); - for (gmx_int64_t l = 0; l < nAtoms; l++) + for (int64_t l = 0; l < nAtoms; l++) { tng_molecule_atom_of_index_get(input, molecule, l, &atom); tng_atom_name_get(input, atom, str, 256); @@ -1725,10 +1725,10 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, datatype); fprintf(stream, "Atom Charges (%d):\n", int(nAtoms)); - for (gmx_int64_t i = 0; i < nAtoms; i += 10) + for (int64_t i = 0; i < nAtoms; i += 10) { fprintf(stream, "Atom Charges [%8d-]=[", int(i)); - for (gmx_int64_t j = 0; (j < 10 && i + j < nAtoms); j++) + for (int64_t j = 0; (j < 10 && i + j < nAtoms); j++) { fprintf(stream, " %12.5e", atomCharges[i + j]); } @@ -1750,10 +1750,10 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, datatype); fprintf(stream, "Atom Masses (%d):\n", int(nAtoms)); - for (gmx_int64_t i = 0; i < nAtoms; i += 10) + for (int64_t i = 0; i < nAtoms; i += 10) { fprintf(stream, "Atom Masses [%8d-]=[", int(i)); - for (gmx_int64_t j = 0; (j < 10 && i + j < nAtoms); j++) + for (int64_t j = 0; (j < 10 && i + j < nAtoms); j++) { fprintf(stream, " %12.5e", atomMasses[i + j]); } @@ -1771,10 +1771,10 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t gmx_tng_input, gmx_bool gmx_get_tng_data_block_types_of_next_frame(gmx_tng_trajectory_t gmx_tng_input, int frame, int nRequestedIds, - gmx_int64_t *requestedIds, - gmx_int64_t *nextFrame, - gmx_int64_t *nBlocks, - gmx_int64_t **blockIds) + int64_t *requestedIds, + int64_t *nextFrame, + int64_t *nBlocks, + int64_t **blockIds) { #if GMX_USE_TNG tng_function_status stat; @@ -1807,12 +1807,12 @@ gmx_bool gmx_get_tng_data_block_types_of_next_frame(gmx_tng_trajectory_t gmx_tng } gmx_bool gmx_get_tng_data_next_frame_of_block_type(gmx_tng_trajectory_t gmx_tng_input, - gmx_int64_t blockId, + int64_t blockId, real **values, - gmx_int64_t *frameNumber, + int64_t *frameNumber, double *frameTime, - gmx_int64_t *nValuesPerFrame, - gmx_int64_t *nAtoms, + int64_t *nValuesPerFrame, + int64_t *nAtoms, real *prec, char *name, int maxLen, @@ -1821,7 +1821,7 @@ gmx_bool gmx_get_tng_data_next_frame_of_block_type(gmx_tng_trajectory_t gmx_tng_ #if GMX_USE_TNG tng_function_status stat; char datatype = -1; - gmx_int64_t codecId; + int64_t codecId; int blockDependency; void *data = nullptr; double localPrec; diff --git a/src/gromacs/fileio/tngio.h b/src/gromacs/fileio/tngio.h index d45e10858e..9af0a7f27c 100644 --- a/src/gromacs/fileio/tngio.h +++ b/src/gromacs/fileio/tngio.h @@ -118,7 +118,7 @@ void gmx_tng_prepare_low_prec_writing(gmx_tng_trajectory_t tng, * (that component). box can only be NULL if x is also NULL. */ void gmx_fwrite_tng(gmx_tng_trajectory_t tng, const gmx_bool bUseLossyCompression, - gmx_int64_t step, + int64_t step, real elapsedPicoSeconds, real lambda, const rvec *box, @@ -176,7 +176,7 @@ void gmx_tng_setup_atom_subgroup(gmx_tng_trajectory_t tng, /*! \brief Read the first/next TNG frame. */ gmx_bool gmx_read_next_tng_frame(gmx_tng_trajectory_t input, struct t_trxframe *fr, - gmx_int64_t *requestedIds, + int64_t *requestedIds, int numRequestedIds); /*! \brief Print the molecule system to stream */ @@ -187,20 +187,20 @@ void gmx_print_tng_molecule_system(gmx_tng_trajectory_t input, gmx_bool gmx_get_tng_data_block_types_of_next_frame(gmx_tng_trajectory_t input, int frame, int nRequestedIds, - gmx_int64_t *requestedIds, - gmx_int64_t *nextFrame, - gmx_int64_t *nBlocks, - gmx_int64_t **blockIds); + int64_t *requestedIds, + int64_t *nextFrame, + int64_t *nBlocks, + int64_t **blockIds); /*! \brief Get data of the next frame with data from the data block * with the specified block ID. */ gmx_bool gmx_get_tng_data_next_frame_of_block_type(gmx_tng_trajectory_t input, - gmx_int64_t blockId, + int64_t blockId, real **values, - gmx_int64_t *frameNumber, + int64_t *frameNumber, double *frameTime, - gmx_int64_t *nValuesPerFrame, - gmx_int64_t *nAtoms, + int64_t *nValuesPerFrame, + int64_t *nAtoms, real *prec, char *name, int maxLen, diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index 2db4da4b22..10f1c165aa 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -102,7 +102,7 @@ static const char *tpx_tag = TPX_TAG_RELEASE; */ enum tpxv { tpxv_ComputationalElectrophysiology = 96, /**< support for ion/water position swaps (computational electrophysiology) */ - tpxv_Use64BitRandomSeed, /**< change ld_seed from int to gmx_int64_t */ + tpxv_Use64BitRandomSeed, /**< change ld_seed from int to int64_t */ tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, /**< potentials for supporting coarse-grained force fields */ tpxv_InteractiveMolecularDynamics, /**< interactive molecular dynamics (IMD) */ tpxv_RemoveObsoleteParameters1, /**< remove optimize_fft, dihre_fc, nstcheckpoint */ diff --git a/src/gromacs/fileio/trrio.cpp b/src/gromacs/fileio/trrio.cpp index 50b3282af2..2fe6ff8afb 100644 --- a/src/gromacs/fileio/trrio.cpp +++ b/src/gromacs/fileio/trrio.cpp @@ -202,7 +202,7 @@ do_trr_frame_data(t_fileio *fio, gmx_trr_header_t *sh, } static gmx_bool -do_trr_frame(t_fileio *fio, bool bRead, gmx_int64_t *step, real *t, real *lambda, +do_trr_frame(t_fileio *fio, bool bRead, int64_t *step, real *t, real *lambda, rvec *box, int *natoms, rvec *x, rvec *v, rvec *f) { gmx_trr_header_t *sh; @@ -277,7 +277,7 @@ gmx_bool gmx_trr_read_frame_header(t_fileio *fio, gmx_trr_header_t *header, gmx_ return do_trr_frame_header(fio, true, header, bOK); } -void gmx_trr_write_single_frame(const char *fn, gmx_int64_t step, real t, real lambda, +void gmx_trr_write_single_frame(const char *fn, int64_t step, real t, real lambda, const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f) { t_fileio *fio = gmx_trr_open(fn, "w"); @@ -285,7 +285,7 @@ void gmx_trr_write_single_frame(const char *fn, gmx_int64_t step, real t, real l gmx_trr_close(fio); } -void gmx_trr_read_single_frame(const char *fn, gmx_int64_t *step, real *t, real *lambda, +void gmx_trr_read_single_frame(const char *fn, int64_t *step, real *t, real *lambda, rvec *box, int *natoms, rvec *x, rvec *v, rvec *f) { t_fileio *fio = gmx_trr_open(fn, "r"); @@ -293,7 +293,7 @@ void gmx_trr_read_single_frame(const char *fn, gmx_int64_t *step, real *t, real gmx_trr_close(fio); } -void gmx_trr_write_frame(t_fileio *fio, gmx_int64_t step, real t, real lambda, +void gmx_trr_write_frame(t_fileio *fio, int64_t step, real t, real lambda, const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f) { if (!do_trr_frame(fio, false, &step, &t, &lambda, const_cast(box), &natoms, const_cast(x), const_cast(v), const_cast(f))) @@ -303,7 +303,7 @@ void gmx_trr_write_frame(t_fileio *fio, gmx_int64_t step, real t, real lambda, } -gmx_bool gmx_trr_read_frame(t_fileio *fio, gmx_int64_t *step, real *t, real *lambda, +gmx_bool gmx_trr_read_frame(t_fileio *fio, int64_t *step, real *t, real *lambda, rvec *box, int *natoms, rvec *x, rvec *v, rvec *f) { return do_trr_frame(fio, true, step, t, lambda, box, natoms, x, v, f); diff --git a/src/gromacs/fileio/trrio.h b/src/gromacs/fileio/trrio.h index 6d60ba5012..814bf4f481 100644 --- a/src/gromacs/fileio/trrio.h +++ b/src/gromacs/fileio/trrio.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2018, 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. @@ -60,7 +60,7 @@ * fix the fact that after 2^31 frames, step numbers will wrap to be * negative. Fortunately, this tends not to cause serious problems, * and we've fixed it in TNG. Meanwhile, the implementation pretends - * to the rest of GROMACS that it functions with gmx_int64_t like all + * to the rest of GROMACS that it functions with int64_t like all * other step numbers, but the actual range in practice depends on the * defaults of the implementation in use now (or when the file was * written). @@ -90,7 +90,7 @@ typedef struct gmx_trr_header_t int f_size; /* Non zero if forces are present */ int natoms; /* The total number of atoms */ - gmx_int64_t step; /* Current step number */ + int64_t step; /* Current step number */ int nre; /* Backward compatibility */ real t; /* Current time */ real lambda; /* Current value of lambda */ @@ -115,14 +115,14 @@ gmx_bool gmx_trr_read_frame_data(struct t_fileio *fio, gmx_trr_header_t *sh, * Return FALSE on error */ -gmx_bool gmx_trr_read_frame(struct t_fileio *fio, gmx_int64_t *step, real *t, real *lambda, +gmx_bool gmx_trr_read_frame(struct t_fileio *fio, int64_t *step, real *t, real *lambda, rvec *box, int *natoms, rvec *x, rvec *v, rvec *f); /* Read a trr frame, including the header from fp. box, x, v, f may * be NULL, in which case the data will be skipped over. * return FALSE on error */ -void gmx_trr_write_frame(struct t_fileio *fio, gmx_int64_t step, real t, real lambda, +void gmx_trr_write_frame(struct t_fileio *fio, int64_t step, real t, real lambda, const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f); /* Write a trr frame to file fp, box, x, v, f may be NULL */ @@ -130,12 +130,12 @@ void gmx_trr_read_single_header(const char *fn, gmx_trr_header_t *header); /* Read the header of a trr file from fn, and close the file afterwards. */ -void gmx_trr_read_single_frame(const char *fn, gmx_int64_t *step, real *t, real *lambda, +void gmx_trr_read_single_frame(const char *fn, int64_t *step, real *t, real *lambda, rvec *box, int *natoms, rvec *x, rvec *v, rvec *f); /* Read a single trr frame from file fn, which is closed afterwards */ -void gmx_trr_write_single_frame(const char *fn, gmx_int64_t step, real t, real lambda, +void gmx_trr_write_single_frame(const char *fn, int64_t step, real t, real lambda, const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f); /* Write a single trr frame to file fn, which is closed afterwards */ diff --git a/src/gromacs/fileio/trxio.cpp b/src/gromacs/fileio/trxio.cpp index c13cd2fde5..b4ce57ed8a 100644 --- a/src/gromacs/fileio/trxio.cpp +++ b/src/gromacs/fileio/trxio.cpp @@ -763,7 +763,7 @@ static gmx_bool pdb_next_x(t_trxstatus *status, FILE *fp, t_trxframe *fr) fr->step = 0; step = std::strstr(title, " step= "); - fr->bStep = (step && sscanf(step+7, "%" GMX_SCNd64, &fr->step) == 1); + fr->bStep = (step && sscanf(step+7, "%" SCNd64, &fr->step) == 1); dbl = 0.0; time = std::strstr(title, " t= "); diff --git a/src/gromacs/fileio/xdrd.cpp b/src/gromacs/fileio/xdrd.cpp index efcee69d10..cceda7c302 100644 --- a/src/gromacs/fileio/xdrd.cpp +++ b/src/gromacs/fileio/xdrd.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2018, 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. @@ -92,15 +92,15 @@ int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision) #endif } -int xdr_int64(XDR *xdrs, gmx_int64_t *i) +int xdr_int64(XDR *xdrs, int64_t *i) { /* This routine stores values compatible with xdr_int64_t */ - int imaj, imin; - int ret; + int imaj, imin; + int ret; - static const gmx_int64_t two_p32_m1 = 0xFFFFFFFF; - gmx_int64_t imaj64, imin64; + static const int64_t two_p32_m1 = 0xFFFFFFFF; + int64_t imaj64, imin64; imaj64 = ((*i)>>32) & two_p32_m1; imin64 = (*i) & two_p32_m1; @@ -109,7 +109,7 @@ int xdr_int64(XDR *xdrs, gmx_int64_t *i) ret = xdr_int(xdrs, &imaj); ret |= xdr_int(xdrs, &imin); - *i = ((static_cast(imaj) << 32) | (static_cast(imin) & two_p32_m1)); + *i = ((static_cast(imaj) << 32) | (static_cast(imin) & two_p32_m1)); return ret; } diff --git a/src/gromacs/fileio/xdrf.h b/src/gromacs/fileio/xdrf.h index 72a67afb66..8a92e3c95d 100644 --- a/src/gromacs/fileio/xdrf.h +++ b/src/gromacs/fileio/xdrf.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2018, 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. @@ -71,8 +71,8 @@ int xdr_real(XDR *xdrs, real *r); int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision); -int xdr_int64(XDR *xdrs, gmx_int64_t *i); -/* Read or write a gmx_int64_t value. +int xdr_int64(XDR *xdrs, int64_t *i); +/* Read or write a int64_t value. * When warn!=NULL a warning will be written to stderr * when a value does not fit, * the first line is: diff --git a/src/gromacs/fileio/xtcio.cpp b/src/gromacs/fileio/xtcio.cpp index f37fd5b03f..86bd6027b7 100644 --- a/src/gromacs/fileio/xtcio.cpp +++ b/src/gromacs/fileio/xtcio.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2018, 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. @@ -109,7 +109,7 @@ static int xtc_check(const char *str, gmx_bool bResult, const char *file, int li #define XTC_CHECK(s, b) xtc_check(s, b, __FILE__, __LINE__) -static int xtc_header(XDR *xd, int *magic, int *natoms, gmx_int64_t *step, real *time, +static int xtc_header(XDR *xd, int *magic, int *natoms, int64_t *step, real *time, gmx_bool bRead, gmx_bool *bOK) { int result; @@ -199,7 +199,7 @@ static int xtc_coord(XDR *xd, int *natoms, rvec *box, rvec *x, real *prec, gmx_b int write_xtc(t_fileio *fio, - int natoms, gmx_int64_t step, real time, + int natoms, int64_t step, real time, const rvec *box, const rvec *x, real prec) { int magic_number = XTC_MAGIC; @@ -235,7 +235,7 @@ int write_xtc(t_fileio *fio, return bOK; /* 0 if bad, 1 if writing went well */ } -int read_first_xtc(t_fileio *fio, int *natoms, gmx_int64_t *step, real *time, +int read_first_xtc(t_fileio *fio, int *natoms, int64_t *step, real *time, matrix box, rvec **x, real *prec, gmx_bool *bOK) { int magic; @@ -261,7 +261,7 @@ int read_first_xtc(t_fileio *fio, int *natoms, gmx_int64_t *step, real *time, } int read_next_xtc(t_fileio* fio, - int natoms, gmx_int64_t *step, real *time, + int natoms, int64_t *step, real *time, matrix box, rvec *x, real *prec, gmx_bool *bOK) { int magic; diff --git a/src/gromacs/fileio/xtcio.h b/src/gromacs/fileio/xtcio.h index 71f88a9901..20684d17bb 100644 --- a/src/gromacs/fileio/xtcio.h +++ b/src/gromacs/fileio/xtcio.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2018, 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. @@ -66,17 +66,17 @@ void close_xtc(struct t_fileio *fio); /* Close the file for xdr I/O */ int read_first_xtc(struct t_fileio *fio, - int *natoms, gmx_int64_t *step, real *time, + int *natoms, int64_t *step, real *time, matrix box, rvec **x, real *prec, gmx_bool *bOK); /* Open xtc file, read xtc file first time, allocate memory for x */ int read_next_xtc(struct t_fileio *fio, - int natoms, gmx_int64_t *step, real *time, + int natoms, int64_t *step, real *time, matrix box, rvec *x, real *prec, gmx_bool *bOK); /* Read subsequent frames */ int write_xtc(struct t_fileio *fio, - int natoms, gmx_int64_t step, real time, + int natoms, int64_t step, real time, const rvec *box, const rvec *x, real prec); /* Write a frame to xtc file */ diff --git a/src/gromacs/gmxana/gmx_analyze.cpp b/src/gromacs/gmxana/gmx_analyze.cpp index d2ff834b15..3e52009cc6 100644 --- a/src/gromacs/gmxana/gmx_analyze.cpp +++ b/src/gromacs/gmxana/gmx_analyze.cpp @@ -244,7 +244,7 @@ static void histogram(const char *distfile, real binwidth, int n, int nset, real int i, s; double minval, maxval; int nbin; - gmx_int64_t *histo; + int64_t *histo; minval = val[0][0]; maxval = val[0][0]; diff --git a/src/gromacs/gmxana/gmx_bar.cpp b/src/gromacs/gmxana/gmx_bar.cpp index 29d7bd1a7c..dec2c4bf98 100644 --- a/src/gromacs/gmxana/gmx_bar.cpp +++ b/src/gromacs/gmxana/gmx_bar.cpp @@ -107,12 +107,12 @@ typedef struct hist_t unsigned int *bin[2]; /* the (forward + reverse) histogram values */ double dx[2]; /* the histogram spacing. The reverse dx is the negative of the forward dx.*/ - gmx_int64_t x0[2]; /* the (forward + reverse) histogram start - point(s) as int */ + int64_t x0[2]; /* the (forward + reverse) histogram start + point(s) as int */ int nbin[2]; /* the (forward+reverse) number of bins */ - gmx_int64_t sum; /* the total number of counts. Must be - the same for forward + reverse. */ + int64_t sum; /* the total number of counts. Must be + the same for forward + reverse. */ int nhist; /* number of hist datas (forward or reverse) */ double start_time, delta_time; /* start time, end time of histogram */ @@ -141,7 +141,7 @@ typedef struct samples_t size_t ndu_alloc, nt_alloc; /* pre-allocated sizes */ hist_t *hist_alloc; /* allocated hist */ - gmx_int64_t ntot; /* total number of samples */ + int64_t ntot; /* total number of samples */ const char *filename; /* the file name this sample comes from */ } samples_t; @@ -171,8 +171,8 @@ typedef struct sample_coll_t sample_range_t *r; /* the sample ranges */ int nsamples_alloc; /* number of allocated samples */ - gmx_int64_t ntot; /* total number of samples in the ranges of - this collection */ + int64_t ntot; /* total number of samples in the ranges of + this collection */ struct sample_coll_t *next, *prev; /* next and previous in the list */ } sample_coll_t; @@ -1405,9 +1405,9 @@ static gmx_bool sample_coll_create_subsample(sample_coll_t *sc, { int j; - gmx_int64_t ntot_start; - gmx_int64_t ntot_end; - gmx_int64_t ntot_so_far; + int64_t ntot_start; + int64_t ntot_end; + int64_t ntot_so_far; *sc = *sc_orig; /* just copy all fields */ @@ -1424,13 +1424,13 @@ static gmx_bool sample_coll_create_subsample(sample_coll_t *sc, /* now fix start and end fields */ /* the casts avoid possible overflows */ - ntot_start = static_cast(sc_orig->ntot*static_cast(i)/static_cast(ni)); - ntot_end = static_cast(sc_orig->ntot*static_cast(i+1)/static_cast(ni)); + ntot_start = static_cast(sc_orig->ntot*static_cast(i)/static_cast(ni)); + ntot_end = static_cast(sc_orig->ntot*static_cast(i+1)/static_cast(ni)); ntot_so_far = 0; for (j = 0; j < sc->nsamples; j++) { - gmx_int64_t ntot_add; - gmx_int64_t new_start, new_end; + int64_t ntot_add; + int64_t new_start, new_end; if (sc->r[j].use) { @@ -3108,7 +3108,7 @@ static samples_t *read_edr_hist_block(int *nsamples, t_enxblock *blk, for (i = 0; i < nhist; i++) { - gmx_int64_t sum = 0; + int64_t sum = 0; for (j = 0; j < s->hist->nbin[i]; j++) { diff --git a/src/gromacs/gmxana/gmx_cluster.cpp b/src/gromacs/gmxana/gmx_cluster.cpp index 7fcb729048..f95a299f9d 100644 --- a/src/gromacs/gmxana/gmx_cluster.cpp +++ b/src/gromacs/gmxana/gmx_cluster.cpp @@ -1386,7 +1386,7 @@ int gmx_cluster(int argc, char *argv[]) FILE *fp, *log; int nf = 0, i, i1, i2, j; - gmx_int64_t nrms = 0; + int64_t nrms = 0; matrix box; rvec *xtps, *usextps, *x1, **xx = nullptr; @@ -1721,7 +1721,7 @@ int gmx_cluster(int argc, char *argv[]) else /* !bReadMat */ { rms = init_mat(nf, method == m_diagonalize); - nrms = (static_cast(nf)*static_cast(nf-1))/2; + nrms = (static_cast(nf)*static_cast(nf-1))/2; if (!bRMSdist) { fprintf(stderr, "Computing %dx%d RMS deviation matrix\n", nf, nf); @@ -1743,7 +1743,7 @@ int gmx_cluster(int argc, char *argv[]) set_mat_entry(rms, i1, i2, rmsd); } nrms -= nf-i1-1; - fprintf(stderr, "\r# RMSD calculations left: " "%" GMX_PRId64 " ", nrms); + fprintf(stderr, "\r# RMSD calculations left: " "%" PRId64 " ", nrms); fflush(stderr); } sfree(x1); @@ -1769,7 +1769,7 @@ int gmx_cluster(int argc, char *argv[]) set_mat_entry(rms, i1, i2, rms_dist(isize, d1, d2)); } nrms -= nf-i1-1; - fprintf(stderr, "\r# RMSD calculations left: " "%" GMX_PRId64 " ", nrms); + fprintf(stderr, "\r# RMSD calculations left: " "%" PRId64 " ", nrms); fflush(stderr); } /* Clean up work arrays */ diff --git a/src/gromacs/gmxana/gmx_covar.cpp b/src/gromacs/gmxana/gmx_covar.cpp index 3bdb367078..e0420438a2 100644 --- a/src/gromacs/gmxana/gmx_covar.cpp +++ b/src/gromacs/gmxana/gmx_covar.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -122,7 +122,7 @@ int gmx_covar(int argc, char *argv[]) real xj, *w_rls = nullptr; real min, max, *axis; int natoms, nat, nframes0, nframes, nlevels; - gmx_int64_t ndim, i, j, k, l; + int64_t ndim, i, j, k, l; int WriteXref; const char *fitfile, *trxfile, *ndxfile; const char *eigvalfile, *eigvecfile, *averfile, *logfile; @@ -254,7 +254,7 @@ int gmx_covar(int argc, char *argv[]) snew(x, natoms); snew(xav, natoms); ndim = natoms*DIM; - if (std::sqrt(static_cast(GMX_INT64_MAX)) < static_cast(ndim)) + if (std::sqrt(static_cast(INT64_MAX)) < static_cast(ndim)) { gmx_fatal(FARGS, "Number of degrees of freedoms to large for matrix.\n"); } diff --git a/src/gromacs/gmxana/gmx_eneconv.cpp b/src/gromacs/gmxana/gmx_eneconv.cpp index c1427498e5..5e146d9321 100644 --- a/src/gromacs/gmxana/gmx_eneconv.cpp +++ b/src/gromacs/gmxana/gmx_eneconv.cpp @@ -339,13 +339,13 @@ static void edit_files(gmx::ArrayRef files, real *readtime, static void update_ee_sum(int nre, - gmx_int64_t *ee_sum_step, - gmx_int64_t *ee_sum_nsteps, - gmx_int64_t *ee_sum_nsum, + int64_t *ee_sum_step, + int64_t *ee_sum_nsteps, + int64_t *ee_sum_nsum, t_energy *ee_sum, t_enxframe *fr, int out_step) { - gmx_int64_t nsteps, nsum, fr_nsum; + int64_t nsteps, nsum, fr_nsum; int i; nsteps = *ee_sum_nsteps; @@ -449,9 +449,9 @@ int gmx_eneconv(int argc, char *argv[]) gmx_enxnm_t *enm = NULL; #endif t_enxframe *fr, *fro; - gmx_int64_t ee_sum_step = 0, ee_sum_nsteps, ee_sum_nsum; + int64_t ee_sum_step = 0, ee_sum_nsteps, ee_sum_nsum; t_energy *ee_sum; - gmx_int64_t lastfilestep, laststep, startstep_file = 0; + int64_t lastfilestep, laststep, startstep_file = 0; int noutfr; int nre, nremax, this_nre, i, kkk, nset, *set = nullptr; double last_t; @@ -652,8 +652,8 @@ int gmx_eneconv(int argc, char *argv[]) } else { - fro->nsum = gmx_int64_to_int(ee_sum_nsum, - "energy average summation"); + fro->nsum = int64_to_int(ee_sum_nsum, + "energy average summation"); /* Copy the energy sums */ for (i = 0; i < nre; i++) { diff --git a/src/gromacs/gmxana/gmx_energy.cpp b/src/gromacs/gmxana/gmx_energy.cpp index ec8d33d62f..ecbfcb78bd 100644 --- a/src/gromacs/gmxana/gmx_energy.cpp +++ b/src/gromacs/gmxana/gmx_energy.cpp @@ -89,8 +89,8 @@ typedef struct { } enerdat_t; typedef struct { - gmx_int64_t nsteps; - gmx_int64_t npoints; + int64_t nsteps; + int64_t npoints; int nframes; int *step; int *steps; @@ -373,7 +373,7 @@ static void einstein_visco(const char *fn, const char *fni, int nsets, } typedef struct { - gmx_int64_t np; + int64_t np; double sum; double sav; double sav2; @@ -382,8 +382,8 @@ typedef struct { typedef struct { int b; ee_sum_t sum; - gmx_int64_t nst; - gmx_int64_t nst_min; + int64_t nst; + int64_t nst_min; } ener_ee_t; static void clear_ee_sum(ee_sum_t *ees) @@ -437,7 +437,7 @@ static void calc_averages(int nset, enerdata_t *edat, int nbmin, int nbmax) { int nb, i, f, nee; double sum, sum2, sump, see2; - gmx_int64_t np, p, bound_nb; + int64_t np, p, bound_nb; enerdat_t *ed; exactsum_t *es; gmx_bool bAllZero; @@ -865,8 +865,8 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn, const char *eviscofn, const char *eviscoifn, gmx_bool bFee, gmx_bool bSum, gmx_bool bFluct, gmx_bool bVisco, const char *visfn, int nmol, - gmx_int64_t start_step, double start_t, - gmx_int64_t step, double t, + int64_t start_step, double start_t, + int64_t step, double t, real reftemp, enerdata_t *edat, int nset, const int set[], const gmx_bool *bIsEner, @@ -882,7 +882,7 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn, real integral, intBulk, Temp = 0, Pres = 0; real pr_aver, pr_stddev, pr_errest; double beta = 0, expE, expEtot, *fee = nullptr; - gmx_int64_t nsteps; + int64_t nsteps; int nexact, nnotexact; int i, j, nout; char buf[256], eebuf[100]; @@ -1442,7 +1442,7 @@ static void do_dhdl(t_enxframe *fr, const t_inputrec *ir, FILE **fp_dhdl, /* write the data */ if (nblock_hist > 0) { - gmx_int64_t sum = 0; + int64_t sum = 0; /* histograms */ for (i = 0; i < fr->nblock; i++) { @@ -1450,7 +1450,7 @@ static void do_dhdl(t_enxframe *fr, const t_inputrec *ir, FILE **fp_dhdl, if (blk->id == enxDHHIST) { double foreign_lambda, dx; - gmx_int64_t x0; + int64_t x0; int nhist, derivative; /* check the block types etc. */ @@ -1705,7 +1705,7 @@ int gmx_energy(int argc, char *argv[]) int cur = 0; #define NEXT (1-cur) int nre, nfr; - gmx_int64_t start_step; + int64_t start_step; real start_t; gmx_bool bDHDL; gmx_bool bFoundStart, bCont, bVisco; diff --git a/src/gromacs/gmxana/gmx_genion.cpp b/src/gromacs/gmxana/gmx_genion.cpp index 176090e4a8..871d020255 100644 --- a/src/gromacs/gmxana/gmx_genion.cpp +++ b/src/gromacs/gmxana/gmx_genion.cpp @@ -71,7 +71,7 @@ static void insert_ion(int nsa, const int *nwater, int i, ei, nw; real rmin2; rvec dx; - gmx_int64_t maxrand; + int64_t maxrand; gmx::UniformIntDistribution dist(0, *nwater-1); nw = *nwater; diff --git a/src/gromacs/gmxana/gmx_pme_error.cpp b/src/gromacs/gmxana/gmx_pme_error.cpp index 91c66cab9b..5cbe4cde17 100644 --- a/src/gromacs/gmxana/gmx_pme_error.cpp +++ b/src/gromacs/gmxana/gmx_pme_error.cpp @@ -81,7 +81,7 @@ enum { typedef struct { - gmx_int64_t orig_sim_steps; /* Number of steps to be done in the real simulation */ + int64_t orig_sim_steps; /* Number of steps to be done in the real simulation */ int n_entries; /* Number of entries in arrays */ real volume; /* The volume of the box */ matrix recipbox; /* The reciprocal box */ diff --git a/src/gromacs/gmxana/gmx_sham.cpp b/src/gromacs/gmxana/gmx_sham.cpp index 46793e0901..c250a41dee 100644 --- a/src/gromacs/gmxana/gmx_sham.cpp +++ b/src/gromacs/gmxana/gmx_sham.cpp @@ -69,9 +69,9 @@ static int index3(const int *ibox, int x, int y, int z) return (ibox[2]*(ibox[1]*x+y)+z); } -static gmx_int64_t indexn(int ndim, const int *ibox, const int *nxyz) +static int64_t indexn(int ndim, const int *ibox, const int *nxyz) { - gmx_int64_t d, dd; + int64_t d, dd; int k, kk; /* Compute index in 1-D array */ @@ -204,7 +204,7 @@ static void normalize_p_e(int len, double *P, const int *nbin, real *E, real pmi } typedef struct { - gmx_int64_t index; + int64_t index; real ener; } t_minimum; @@ -231,7 +231,7 @@ static inline void print_minimum(FILE *fp, int num, const t_minimum *min) { fprintf(fp, - "Minimum %d at index " "%" GMX_PRId64 " energy %10.3f\n", + "Minimum %d at index " "%" PRId64 " energy %10.3f\n", num, min->index, min->ener); } @@ -967,7 +967,7 @@ int gmx_sham(int argc, char *argv[]) real *rmin, *rmax; const char *fn_ge, *fn_ene; gmx_output_env_t *oenv; - gmx_int64_t num_grid_points; + int64_t num_grid_points; t_filenm fnm[] = { { efXVG, "-f", "graph", ffREAD }, @@ -1068,7 +1068,7 @@ int gmx_sham(int argc, char *argv[]) num_grid_points = ibox[0]; for (i = 1; i < nset; i++) { - gmx_int64_t result; + int64_t result; if (!check_int_multiply_for_overflow(num_grid_points, ibox[i], &result)) { gmx_fatal(FARGS, @@ -1076,7 +1076,7 @@ int gmx_sham(int argc, char *argv[]) } num_grid_points = result; } - /* The number of grid points fits in a gmx_int64_t. */ + /* The number of grid points fits in a int64_t. */ do_sham(opt2fn("-dist", NFILE, fnm), opt2fn("-bin", NFILE, fnm), opt2fn("-lp", NFILE, fnm), diff --git a/src/gromacs/gmxana/gmx_trjconv.cpp b/src/gromacs/gmxana/gmx_trjconv.cpp index 572ceb2198..43deb7c96e 100644 --- a/src/gromacs/gmxana/gmx_trjconv.cpp +++ b/src/gromacs/gmxana/gmx_trjconv.cpp @@ -1850,7 +1850,7 @@ int gmx_trjconv(int argc, char *argv[]) } if (frout.bStep) { - sprintf(stepstr, " step= %" GMX_PRId64, frout.step); + sprintf(stepstr, " step= %" PRId64, frout.step); } else { diff --git a/src/gromacs/gmxana/gmx_tune_pme.cpp b/src/gromacs/gmxana/gmx_tune_pme.cpp index 921345bd8a..ac3a4a42ce 100644 --- a/src/gromacs/gmxana/gmx_tune_pme.cpp +++ b/src/gromacs/gmxana/gmx_tune_pme.cpp @@ -113,8 +113,8 @@ typedef struct typedef struct { int nr_inputfiles; /* The number of tpr and mdp input files */ - gmx_int64_t orig_sim_steps; /* Number of steps to be done in the real simulation */ - gmx_int64_t orig_init_step; /* Init step for the real simulation */ + int64_t orig_sim_steps; /* Number of steps to be done in the real simulation */ + int64_t orig_init_step; /* Init step for the real simulation */ real *rcoulomb; /* The coulomb radii [0...nr_inputfiles] */ real *rvdw; /* The vdW radii */ real *rlist; /* Neighbourlist cutoff radius */ @@ -184,7 +184,7 @@ enum { }; static int parse_logfile(const char *logfile, const char *errfile, - t_perf *perfdata, int test_nr, int presteps, gmx_int64_t cpt_steps, + t_perf *perfdata, int test_nr, int presteps, int64_t cpt_steps, int nnodes) { FILE *fp; @@ -198,7 +198,7 @@ static int parse_logfile(const char *logfile, const char *errfile, float dum1, dum2, dum3, dum4; int ndum; int npme; - gmx_int64_t resetsteps = -1; + int64_t resetsteps = -1; gmx_bool bFoundResetStr = FALSE; gmx_bool bResetChecked = FALSE; @@ -238,7 +238,7 @@ static int parse_logfile(const char *logfile, const char *errfile, { if (std::strstr(line, matchstrcr) != nullptr) { - sprintf(dumstring, "step %s", "%" GMX_SCNd64); + sprintf(dumstring, "step %s", "%" SCNd64); sscanf(line, dumstring, &resetsteps); bFoundResetStr = TRUE; if (resetsteps == presteps+cpt_steps) @@ -247,8 +247,8 @@ static int parse_logfile(const char *logfile, const char *errfile, } else { - sprintf(dumstring, "%" GMX_PRId64, resetsteps); - sprintf(dumstring2, "%" GMX_PRId64, presteps+cpt_steps); + sprintf(dumstring, "%" PRId64, resetsteps); + sprintf(dumstring2, "%" PRId64, presteps+cpt_steps); fprintf(stderr, "WARNING: Time step counters were reset at step %s,\n" " though they were supposed to be reset at step %s!\n", dumstring, dumstring2); @@ -817,8 +817,8 @@ static void launch_simulation( static void modify_PMEsettings( - gmx_int64_t simsteps, /* Set this value as number of time steps */ - gmx_int64_t init_step, /* Set this value as init_step */ + int64_t simsteps, /* Set this value as number of time steps */ + int64_t init_step, /* Set this value as init_step */ const char *fn_best_tpr, /* tpr file with the best performance */ const char *fn_sim_tpr) /* name of tpr file to be launched */ { @@ -835,7 +835,7 @@ static void modify_PMEsettings( ir->init_step = init_step; /* Write the tpr file which will be launched */ - sprintf(buf, "Writing optimized simulation file %s with nsteps=%s.\n", fn_sim_tpr, "%" GMX_PRId64); + sprintf(buf, "Writing optimized simulation file %s with nsteps=%s.\n", fn_sim_tpr, "%" PRId64); fprintf(stdout, buf, ir->nsteps); fflush(stdout); write_tpx_state(fn_sim_tpr, ir, &state, &mtop); @@ -854,8 +854,8 @@ static gmx_bool can_scale_rvdw(int vdwtype) static void make_benchmark_tprs( const char *fn_sim_tpr, /* READ : User-provided tpr file */ char *fn_bench_tprs[], /* WRITE: Names of benchmark tpr files */ - gmx_int64_t benchsteps, /* Number of time steps for benchmark runs */ - gmx_int64_t statesteps, /* Step counter in checkpoint file */ + int64_t benchsteps, /* Number of time steps for benchmark runs */ + int64_t statesteps, /* Step counter in checkpoint file */ real rmin, /* Minimal Coulomb radius */ real rmax, /* Maximal Coulomb radius */ real bScaleRvdw, /* Scale rvdw along with rcoulomb */ @@ -877,11 +877,11 @@ static void make_benchmark_tprs( sprintf(buf, "Making benchmark tpr file%s with %s time step%s", - *ntprs > 1 ? "s" : "", "%" GMX_PRId64, benchsteps > 1 ? "s" : ""); + *ntprs > 1 ? "s" : "", "%" PRId64, benchsteps > 1 ? "s" : ""); fprintf(stdout, buf, benchsteps); if (statesteps > 0) { - sprintf(buf, " (adding %s steps from checkpoint file)", "%" GMX_PRId64); + sprintf(buf, " (adding %s steps from checkpoint file)", "%" PRId64); fprintf(stdout, buf, statesteps); benchsteps += statesteps; } @@ -1079,7 +1079,7 @@ static void make_benchmark_tprs( sprintf(buf, "_bench%.2d.tpr", j); std::strcat(fn_bench_tprs[j], buf); fprintf(stdout, "Writing benchmark tpr %s with nsteps=", fn_bench_tprs[j]); - fprintf(stdout, "%" GMX_PRId64, ir->nsteps); + fprintf(stdout, "%" PRId64, ir->nsteps); if (j > 0) { fprintf(stdout, ", scaling factor %f\n", fac); @@ -1392,7 +1392,7 @@ static void do_the_tests( const t_filenm *fnm, /* List of filenames from command line */ int nfile, /* Number of files specified on the cmdl. */ int presteps, /* DLB equilibration steps, is checked */ - gmx_int64_t cpt_steps, /* Time step counter in the checkpoint */ + int64_t cpt_steps, /* Time step counter in the checkpoint */ gmx_bool bCheck, /* Check whether benchmark mdrun works */ const char *eligible_gpu_ids) /* GPU IDs for * constructing mdrun command lines */ @@ -1617,7 +1617,7 @@ static void check_input( real maxPMEfraction, real minPMEfraction, int npme_fixed, - gmx_int64_t bench_nsteps, + int64_t bench_nsteps, const t_filenm *fnm, int nfile, int sim_part, @@ -1761,7 +1761,7 @@ static void check_input( if (bench_nsteps > 10000 || bench_nsteps < 100) { fprintf(stderr, "WARNING: steps="); - fprintf(stderr, "%" GMX_PRId64, bench_nsteps); + fprintf(stderr, "%" PRId64, bench_nsteps); fprintf(stderr, ". Are you sure you want to perform so %s steps for each benchmark?\n", (bench_nsteps < 100) ? "few" : "many"); } @@ -2133,9 +2133,9 @@ int gmx_tune_pme(int argc, char *argv[]) real rmin = 0.0, rmax = 0.0; /* min and max value for rcoulomb if scaling is requested */ real rcoulomb = -1.0; /* Coulomb radius as set in .tpr file */ gmx_bool bScaleRvdw = TRUE; - gmx_int64_t bench_nsteps = BENCHSTEPS; - gmx_int64_t new_sim_nsteps = -1; /* -1 indicates: not set by the user */ - gmx_int64_t cpt_steps = 0; /* Step counter in .cpt input file */ + int64_t bench_nsteps = BENCHSTEPS; + int64_t new_sim_nsteps = -1; /* -1 indicates: not set by the user */ + int64_t cpt_steps = 0; /* Step counter in .cpt input file */ int presteps = 1500; /* Do a full cycle reset after presteps steps */ gmx_bool bOverwrite = FALSE, bKeepTPR; gmx_bool bLaunch = FALSE; @@ -2471,13 +2471,13 @@ int gmx_tune_pme(int argc, char *argv[]) fprintf(fp, "The mdrun command is : %s\n", cmd_mdrun); fprintf(fp, "mdrun args benchmarks : %s\n", cmd_args_bench); fprintf(fp, "Benchmark steps : "); - fprintf(fp, "%" GMX_PRId64, bench_nsteps); + fprintf(fp, "%" PRId64, bench_nsteps); fprintf(fp, "\n"); fprintf(fp, "dlb equilibration steps : %d\n", presteps); if (sim_part > 1) { fprintf(fp, "Checkpoint time step : "); - fprintf(fp, "%" GMX_PRId64, cpt_steps); + fprintf(fp, "%" PRId64, cpt_steps); fprintf(fp, "\n"); } fprintf(fp, "mdrun args at launchtime: %s\n", cmd_args_launch); @@ -2486,10 +2486,10 @@ int gmx_tune_pme(int argc, char *argv[]) { bOverwrite = TRUE; fprintf(stderr, "Note: Simulation input file %s will have ", opt2fn("-so", NFILE, fnm)); - fprintf(stderr, "%" GMX_PRId64, new_sim_nsteps+cpt_steps); + fprintf(stderr, "%" PRId64, new_sim_nsteps+cpt_steps); fprintf(stderr, " steps.\n"); fprintf(fp, "Simulation steps : "); - fprintf(fp, "%" GMX_PRId64, new_sim_nsteps); + fprintf(fp, "%" PRId64, new_sim_nsteps); fprintf(fp, "\n"); } if (repeats > 1) diff --git a/src/gromacs/gmxana/gmx_wham.cpp b/src/gromacs/gmxana/gmx_wham.cpp index aad37939c6..6ca704eb3a 100644 --- a/src/gromacs/gmxana/gmx_wham.cpp +++ b/src/gromacs/gmxana/gmx_wham.cpp @@ -659,7 +659,7 @@ static void read_pdo_data(FILE * file, t_UmbrellaHeader * header, sscanf(ptr, fmtlf, &time); /* printf("Time %f\n",time); */ /* Round time to fs */ - time = 1.0/1000*( static_cast (time*1000+0.5) ); + time = 1.0/1000*( static_cast (time*1000+0.5) ); /* get time step of pdo file */ if (count == 0) @@ -2372,7 +2372,7 @@ static void read_pull_xf(const char *fn, t_UmbrellaHeader * header, for (i = 0; i < nt; i++) { /* Do you want that time frame? */ - t = 1.0/1000*( static_cast ((y[0][i]*1000) + 0.5)); /* round time to fs */ + t = 1.0/1000*( static_cast ((y[0][i]*1000) + 0.5)); /* round time to fs */ /* get time step of pdo file and get dstep from opt->dt */ if (i == 0) diff --git a/src/gromacs/gmxana/nsfactor.cpp b/src/gromacs/gmxana/nsfactor.cpp index 647d5deb0a..92e216526e 100644 --- a/src/gromacs/gmxana/nsfactor.cpp +++ b/src/gromacs/gmxana/nsfactor.cpp @@ -211,7 +211,7 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram ( int nthreads; gmx::DefaultRandomEngine *trng = nullptr; #endif - gmx_int64_t mc = 0, mc_max; + int64_t mc = 0, mc_max; gmx::DefaultRandomEngine rng(seed); /* allocate memory for pr */ @@ -237,11 +237,11 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram ( /* Special case for setting automaticaly number of mc iterations to 1% of total number of direct iterations */ if (mcover == -1) { - mc_max = static_cast(std::floor(0.5*0.01*isize*(isize-1))); + mc_max = static_cast(std::floor(0.5*0.01*isize*(isize-1))); } else { - mc_max = static_cast(std::floor(0.5*mcover*isize*(isize-1))); + mc_max = static_cast(std::floor(0.5*mcover*isize*(isize-1))); } #if GMX_OPENMP nthreads = gmx_omp_get_max_threads(); diff --git a/src/gromacs/gmxlib/network.cpp b/src/gromacs/gmxlib/network.cpp index 58aecdcfc0..c35e91ff99 100644 --- a/src/gromacs/gmxlib/network.cpp +++ b/src/gromacs/gmxlib/network.cpp @@ -458,7 +458,7 @@ void gmx_sumi(int gmx_unused nr, int gmx_unused r[], const t_commrec gmx_unused #endif } -void gmx_sumli(int gmx_unused nr, gmx_int64_t gmx_unused r[], const t_commrec gmx_unused *cr) +void gmx_sumli(int gmx_unused nr, int64_t gmx_unused r[], const t_commrec gmx_unused *cr) { #if !GMX_MPI gmx_call("gmx_sumli"); @@ -612,7 +612,7 @@ void gmx_sumi_sim(int gmx_unused nr, int gmx_unused r[], const gmx_multisim_t gm #endif } -void gmx_sumli_sim(int gmx_unused nr, gmx_int64_t gmx_unused r[], const gmx_multisim_t gmx_unused *ms) +void gmx_sumli_sim(int gmx_unused nr, int64_t gmx_unused r[], const gmx_multisim_t gmx_unused *ms) { #if !GMX_MPI gmx_call("gmx_sumli_sim"); diff --git a/src/gromacs/gmxlib/network.h b/src/gromacs/gmxlib/network.h index c668c37d17..96eca851e1 100644 --- a/src/gromacs/gmxlib/network.h +++ b/src/gromacs/gmxlib/network.h @@ -82,7 +82,7 @@ void gmx_bcast_sim(int nbytes, void *b, const struct t_commrec *cr); void gmx_sumi(int nr, int r[], const struct t_commrec *cr); /* Calculate the global sum of an array of ints */ -void gmx_sumli(int nr, gmx_int64_t r[], const struct t_commrec *cr); +void gmx_sumli(int nr, int64_t r[], const struct t_commrec *cr); /* Calculate the global sum of an array of large ints */ void gmx_sumf(int nr, float r[], const struct t_commrec *cr); @@ -94,7 +94,7 @@ void gmx_sumd(int nr, double r[], const struct t_commrec *cr); void gmx_sumi_sim(int nr, int r[], const struct gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of ints */ -void gmx_sumli_sim(int nr, gmx_int64_t r[], const struct gmx_multisim_t *ms); +void gmx_sumli_sim(int nr, int64_t r[], const struct gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of large ints */ void gmx_sumf_sim(int nr, float r[], const struct gmx_multisim_t *ms); diff --git a/src/gromacs/gmxlib/nrnb.cpp b/src/gromacs/gmxlib/nrnb.cpp index a9bd5e861d..55d0695aee 100644 --- a/src/gromacs/gmxlib/nrnb.cpp +++ b/src/gromacs/gmxlib/nrnb.cpp @@ -434,7 +434,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop) } void print_perf(FILE *out, double time_per_thread, double time_per_node, - gmx_int64_t nsteps, double delta_t, + int64_t nsteps, double delta_t, double nbfs, double mflop) { double wallclocktime; diff --git a/src/gromacs/gmxlib/nrnb.h b/src/gromacs/gmxlib/nrnb.h index 53ee66765d..124ee5f733 100644 --- a/src/gromacs/gmxlib/nrnb.h +++ b/src/gromacs/gmxlib/nrnb.h @@ -153,7 +153,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop); */ void print_perf(FILE *out, double nodetime, double realtime, - gmx_int64_t nsteps, double delta_t, + int64_t nsteps, double delta_t, double nbfs, double mflop); /* Prints the performance, nbfs and mflop come from print_flop */ diff --git a/src/gromacs/gmxpreprocess/grompp.cpp b/src/gromacs/gmxpreprocess/grompp.cpp index d2ae7729d6..31ab064463 100644 --- a/src/gromacs/gmxpreprocess/grompp.cpp +++ b/src/gromacs/gmxpreprocess/grompp.cpp @@ -1772,7 +1772,7 @@ int gmx_grompp(int argc, char *argv[]) if (ir->ld_seed == -1) { ir->ld_seed = static_cast(gmx::makeRandomSeed()); - fprintf(stderr, "Setting the LD random seed to %" GMX_PRId64 "\n", ir->ld_seed); + fprintf(stderr, "Setting the LD random seed to %" PRId64 "\n", ir->ld_seed); } if (ir->expandedvals->lmc_seed == -1) diff --git a/src/gromacs/hardware/printhardware.cpp b/src/gromacs/hardware/printhardware.cpp index 6c660063a5..9748c8e4a0 100644 --- a/src/gromacs/hardware/printhardware.cpp +++ b/src/gromacs/hardware/printhardware.cpp @@ -302,7 +302,7 @@ static std::string detected_hardware_string(const gmx_hw_info_t *hwinfo, s += gmx::formatString(" Numa nodes:\n"); for (auto &n : hwTop.machine().numa.nodes) { - s += gmx::formatString(" Node %2d (%" GMX_PRIu64 " bytes mem):", n.id, n.memory); + s += gmx::formatString(" Node %2d (%" PRIu64 " bytes mem):", n.id, n.memory); for (auto &l : n.logicalProcessorId) { s += gmx::formatString(" %3d", l); @@ -329,7 +329,7 @@ static std::string detected_hardware_string(const gmx_hw_info_t *hwinfo, s += gmx::formatString(" Caches:\n"); for (auto &c : hwTop.machine().caches) { - s += gmx::formatString(" L%d: %" GMX_PRIu64 " bytes, linesize %d bytes, assoc. %d, shared %d ways\n", + s += gmx::formatString(" L%d: %" PRIu64 " bytes, linesize %d bytes, assoc. %d, shared %d ways\n", c.level, c.size, c.linesize, c.associativity, c.shared); } } diff --git a/src/gromacs/imd/imd.cpp b/src/gromacs/imd/imd.cpp index 2493859bce..764fe57a96 100644 --- a/src/gromacs/imd/imd.cpp +++ b/src/gromacs/imd/imd.cpp @@ -108,16 +108,16 @@ */ typedef struct { - gmx_int32_t tstep; /**< time step */ - float T_abs; /**< absolute temperature */ - float E_tot; /**< total energy */ - float E_pot; /**< potential energy */ - float E_vdw; /**< van der Waals energy */ - float E_coul; /**< Coulomb interaction energy */ - float E_bond; /**< bonds energy */ - float E_angle; /**< angles energy */ - float E_dihe; /**< dihedrals energy */ - float E_impr; /**< improper dihedrals energy */ + int32_t tstep; /**< time step */ + float T_abs; /**< absolute temperature */ + float E_tot; /**< total energy */ + float E_pot; /**< potential energy */ + float E_vdw; /**< van der Waals energy */ + float E_coul; /**< Coulomb interaction energy */ + float E_bond; /**< bonds energy */ + float E_angle; /**< angles energy */ + float E_dihe; /**< dihedrals energy */ + float E_impr; /**< improper dihedrals energy */ } IMDEnergyBlock; @@ -128,8 +128,8 @@ typedef struct */ typedef struct { - gmx_int32_t type; /**< Type of IMD message, see IMDType_t above */ - gmx_int32_t length; /**< Length */ + int32_t type; /**< Type of IMD message, see IMDType_t above */ + int32_t length; /**< Length */ } IMDHeader; @@ -174,8 +174,8 @@ typedef struct t_gmx_IMD IMDEnergyBlock *energies; /**< Pointer to energies we send back. */ - gmx_int32_t vmd_nforces; /**< Number of VMD forces. */ - gmx_int32_t *vmd_f_ind; /**< VMD forces indices. */ + int32_t vmd_nforces; /**< Number of VMD forces. */ + int32_t *vmd_f_ind; /**< VMD forces indices. */ float *vmd_forces; /**< The VMD forces flat in memory. */ int nforces; /**< Number of actual MD forces; this gets communicated to the clients. */ @@ -243,10 +243,10 @@ static const char *eIMDType_names[IMD_NR + 1] = { /*! \brief Fills the header with message and the length argument. */ -static void fill_header(IMDHeader *header, IMDMessageType type, gmx_int32_t length) +static void fill_header(IMDHeader *header, IMDMessageType type, int32_t length) { /* We (ab-)use htonl network function for the correct endianness */ - header->type = htonl((gmx_int32_t) type); + header->type = htonl((int32_t) type); header->length = htonl(length); } @@ -261,9 +261,9 @@ static void swap_header(IMDHeader *header) /*! \brief Reads multiple bytes from socket. */ -static gmx_int32_t imd_read_multiple(IMDSocket *socket, char *datptr, gmx_int32_t toread) +static int32_t imd_read_multiple(IMDSocket *socket, char *datptr, int32_t toread) { - gmx_int32_t leftcount, countread; + int32_t leftcount, countread; leftcount = toread; @@ -299,9 +299,9 @@ static gmx_int32_t imd_read_multiple(IMDSocket *socket, char *datptr, gmx_int32_ /*! \brief Writes multiple bytes to socket in analogy to imd_read_multiple. */ -static gmx_int32_t imd_write_multiple(IMDSocket *socket, const char *datptr, gmx_int32_t towrite) +static int32_t imd_write_multiple(IMDSocket *socket, const char *datptr, int32_t towrite) { - gmx_int32_t leftcount, countwritten; + int32_t leftcount, countwritten; leftcount = towrite; @@ -342,7 +342,7 @@ static int imd_handshake(IMDSocket *socket) /*! \brief Send energies using the energy block and the send buffer. */ static int imd_send_energies(IMDSocket *socket, const IMDEnergyBlock *energies, char *buffer) { - gmx_int32_t recsize; + int32_t recsize; recsize = HEADERSIZE + sizeof(IMDEnergyBlock); @@ -354,7 +354,7 @@ static int imd_send_energies(IMDSocket *socket, const IMDEnergyBlock *energies, /*! \brief Receive IMD header from socket, sets the length and returns the IMD message. */ -static IMDMessageType imd_recv_header(IMDSocket *socket, gmx_int32_t *length) +static IMDMessageType imd_recv_header(IMDSocket *socket, int32_t *length) { IMDHeader header; @@ -374,13 +374,13 @@ static IMDMessageType imd_recv_header(IMDSocket *socket, gmx_int32_t *length) * * The number of forces was previously communicated via the header. */ -static int imd_recv_mdcomm(IMDSocket *socket, gmx_int32_t nforces, gmx_int32_t *forcendx, float *forces) +static int imd_recv_mdcomm(IMDSocket *socket, int32_t nforces, int32_t *forcendx, float *forces) { int retsize, retbytes; /* reading indices */ - retsize = sizeof(gmx_int32_t) * nforces; + retsize = sizeof(int32_t) * nforces; retbytes = imd_read_multiple(socket, (char *) forcendx, retsize); if (retbytes != retsize) { @@ -440,7 +440,7 @@ void dd_make_local_IMD_atoms(gmx_bool bIMD, gmx_domdec_t *dd, t_IMD *imd) */ static int imd_send_rvecs(IMDSocket *socket, int nat, rvec *x, char *buffer) { - gmx_int32_t size; + int32_t size; int i; float sendx[3]; int tuplesize = 3 * sizeof(float); @@ -450,7 +450,7 @@ static int imd_send_rvecs(IMDSocket *socket, int nat, rvec *x, char *buffer) size = HEADERSIZE + 3 * sizeof(float) * nat; /* Prepare header */ - fill_header((IMDHeader *) buffer, IMD_FCOORDS, (gmx_int32_t) nat); + fill_header((IMDHeader *) buffer, IMD_FCOORDS, (int32_t) nat); for (i = 0; i < nat; i++) { sendx[0] = (float) x[i][0] * NM2A; @@ -1297,7 +1297,7 @@ void init_IMD(t_inputrec *ir, int i; int nat_total; t_gmx_IMD_setup *IMDsetup; - gmx_int32_t bufxsize; + int32_t bufxsize; gmx_bool bIMD = FALSE; @@ -1404,7 +1404,7 @@ void init_IMD(t_inputrec *ir, if (MASTER(cr)) { /* we allocate memory for our IMD energy structure */ - gmx_int32_t recsize = HEADERSIZE + sizeof(IMDEnergyBlock); + int32_t recsize = HEADERSIZE + sizeof(IMDEnergyBlock); snew(IMDsetup->energysendbuf, recsize); /* Shall we wait for a connection? */ @@ -1475,7 +1475,7 @@ void init_IMD(t_inputrec *ir, gmx_bool do_IMD(gmx_bool bIMD, - gmx_int64_t step, + int64_t step, const t_commrec *cr, gmx_bool bNS, matrix box, @@ -1560,7 +1560,7 @@ gmx_bool do_IMD(gmx_bool bIMD, void IMD_fill_energy_record(gmx_bool bIMD, t_IMD *imd, gmx_enerdata_t *enerd, - gmx_int64_t step, gmx_bool bHaveNewEnergies) + int64_t step, gmx_bool bHaveNewEnergies) { IMDEnergyBlock *ene; t_gmx_IMD *IMDsetup; @@ -1629,7 +1629,7 @@ void IMD_send_positions(t_IMD *imd) void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep, t_IMD *imd, gmx_enerdata_t *enerd, - gmx_int64_t step, gmx_bool bHaveNewEnergies, + int64_t step, gmx_bool bHaveNewEnergies, gmx_wallcycle *wcycle) { if (bIMD) diff --git a/src/gromacs/imd/imd.h b/src/gromacs/imd/imd.h index 6bcf956916..0ac8e1325b 100644 --- a/src/gromacs/imd/imd.h +++ b/src/gromacs/imd/imd.h @@ -163,7 +163,7 @@ void init_IMD(t_inputrec *ir, const t_commrec *cr, * * \returns Whether or not we have to do IMD communication at this step. */ -gmx_bool do_IMD(gmx_bool bIMD, gmx_int64_t step, const t_commrec *cr, +gmx_bool do_IMD(gmx_bool bIMD, int64_t step, const t_commrec *cr, gmx_bool bNS, matrix box, rvec x[], t_inputrec *ir, double t, gmx_wallcycle *wcycle); @@ -203,7 +203,7 @@ void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd, * */ void IMD_fill_energy_record(gmx_bool bIMD, t_IMD *imd, gmx_enerdata_t *enerd, - gmx_int64_t step, gmx_bool bHaveNewEnergies); + int64_t step, gmx_bool bHaveNewEnergies); /*! \brief Send positions and energies to the client. @@ -226,7 +226,7 @@ void IMD_send_positions(t_IMD *imd); */ void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep, t_IMD *imd, gmx_enerdata_t *enerd, - gmx_int64_t step, gmx_bool bHaveNewEnergies, + int64_t step, gmx_bool bHaveNewEnergies, gmx_wallcycle *wcycle); /*! \brief Finalize IMD and do some cleaning up. diff --git a/src/gromacs/math/utilities.cpp b/src/gromacs/math/utilities.cpp index a55eb0d2fc..0c4fedbae3 100644 --- a/src/gromacs/math/utilities.cpp +++ b/src/gromacs/math/utilities.cpp @@ -69,11 +69,11 @@ gmx_numzero(double a) gmx_bool -check_int_multiply_for_overflow(gmx_int64_t a, - gmx_int64_t b, - gmx_int64_t *result) +check_int_multiply_for_overflow(int64_t a, + int64_t b, + int64_t *result) { - gmx_int64_t sign = 1; + int64_t sign = 1; if ((0 == a) || (0 == b)) { *result = 0; @@ -89,9 +89,9 @@ check_int_multiply_for_overflow(gmx_int64_t a, b = -b; sign = -sign; } - if (GMX_INT64_MAX / b < a) + if (INT64_MAX / b < a) { - *result = (sign > 0) ? GMX_INT64_MAX : GMX_INT64_MIN; + *result = (sign > 0) ? INT64_MAX : INT64_MIN; return FALSE; } *result = sign * a * b; diff --git a/src/gromacs/math/utilities.h b/src/gromacs/math/utilities.h index 9913d6f5a6..ef1de46d6a 100644 --- a/src/gromacs/math/utilities.h +++ b/src/gromacs/math/utilities.h @@ -147,9 +147,9 @@ gmx_numzero(double a); * \return False iff overflow occurred */ gmx_bool -check_int_multiply_for_overflow(gmx_int64_t a, - gmx_int64_t b, - gmx_int64_t *result); +check_int_multiply_for_overflow(int64_t a, + int64_t b, + int64_t *result); /*! \brief Find greatest common divisor of two numbers * diff --git a/src/gromacs/mdlib/boxdeformation.cpp b/src/gromacs/mdlib/boxdeformation.cpp index 737a978da9..e55ca702fb 100644 --- a/src/gromacs/mdlib/boxdeformation.cpp +++ b/src/gromacs/mdlib/boxdeformation.cpp @@ -95,7 +95,7 @@ prepareBoxDeformation(const matrix &initialBox, } BoxDeformation::BoxDeformation(double timeStep, - gmx_int64_t initialStep, + int64_t initialStep, const tensor &deformationTensor, const matrix &referenceBox) : timeStep_(timeStep), @@ -108,7 +108,7 @@ BoxDeformation::BoxDeformation(double timeStep, void BoxDeformation::apply(ArrayRef x, matrix box, - gmx_int64_t step) + int64_t step) { matrix updatedBox, invbox, mu; diff --git a/src/gromacs/mdlib/boxdeformation.h b/src/gromacs/mdlib/boxdeformation.h index 6f7d3afd80..ba5bcbe19a 100644 --- a/src/gromacs/mdlib/boxdeformation.h +++ b/src/gromacs/mdlib/boxdeformation.h @@ -61,20 +61,20 @@ class BoxDeformation public: //! Trivial constructor. BoxDeformation(double timeStep, - gmx_int64_t initialStep, + int64_t initialStep, const tensor &deformationTensor, const matrix &referenceBox); //! Deform \c x and \c box at this \c step; void apply(ArrayRef x, matrix box, - gmx_int64_t step); + int64_t step); private: //! The integrator time step. double timeStep_; //! The initial step number (from the .tpr, which permits checkpointing to work correctly). - gmx_int64_t initialStep_; + int64_t initialStep_; //! Non-zero elements provide a scaling factor for deformation in that box dimension. tensor deformationTensor_; //! The initial box, ie from the .tpr file. diff --git a/src/gromacs/mdlib/constr.cpp b/src/gromacs/mdlib/constr.cpp index 71bb29eb5e..e6372aea54 100644 --- a/src/gromacs/mdlib/constr.cpp +++ b/src/gromacs/mdlib/constr.cpp @@ -116,7 +116,7 @@ class Constraints::Impl const t_mdatoms &md); bool apply(bool bLog, bool bEner, - gmx_int64_t step, + int64_t step, int delta_step, real step_scaling, rvec *x, @@ -276,7 +276,7 @@ static void write_constr_pdb(const char *fn, const char *title, } //! Writes out domain contents to help diagnose crashes. -static void dump_confs(FILE *log, gmx_int64_t step, const gmx_mtop_t &mtop, +static void dump_confs(FILE *log, int64_t step, const gmx_mtop_t &mtop, int start, int homenr, const t_commrec *cr, const rvec x[], rvec xprime[], matrix box) { @@ -304,7 +304,7 @@ static void dump_confs(FILE *log, gmx_int64_t step, const gmx_mtop_t &mtop, bool Constraints::apply(bool bLog, bool bEner, - gmx_int64_t step, + int64_t step, int delta_step, real step_scaling, rvec *x, @@ -336,7 +336,7 @@ Constraints::apply(bool bLog, bool Constraints::Impl::apply(bool bLog, bool bEner, - gmx_int64_t step, + int64_t step, int delta_step, real step_scaling, rvec *x, @@ -595,7 +595,7 @@ Constraints::Impl::apply(bool bLog, { char buf[STRLEN]; sprintf(buf, - "\nstep " "%" GMX_PRId64 ": One or more water molecules can not be settled.\n" + "\nstep " "%" PRId64 ": One or more water molecules can not be settled.\n" "Check for bad contacts and/or reduce the timestep if appropriate.\n", step); if (log) diff --git a/src/gromacs/mdlib/constr.h b/src/gromacs/mdlib/constr.h index 389be723b4..524bb28b7b 100644 --- a/src/gromacs/mdlib/constr.h +++ b/src/gromacs/mdlib/constr.h @@ -161,7 +161,7 @@ class Constraints */ bool apply(bool bLog, bool bEner, - gmx_int64_t step, + int64_t step, int delta_step, real step_scaling, rvec *x, diff --git a/src/gromacs/mdlib/coupling.cpp b/src/gromacs/mdlib/coupling.cpp index cbd5163943..3d2590d47e 100644 --- a/src/gromacs/mdlib/coupling.cpp +++ b/src/gromacs/mdlib/coupling.cpp @@ -363,7 +363,7 @@ static void calcParrinelloRahmanInvMass(const t_inputrec *ir, const matrix box, } } -void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step, +void parrinellorahman_pcoupl(FILE *fplog, int64_t step, const t_inputrec *ir, real dt, const tensor pres, tensor box, tensor box_rel, tensor boxv, tensor M, matrix mu, gmx_bool bFirstStep) @@ -548,7 +548,7 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step, mmul_ur0(invbox, t1, mu); } -void berendsen_pcoupl(FILE *fplog, gmx_int64_t step, +void berendsen_pcoupl(FILE *fplog, int64_t step, const t_inputrec *ir, real dt, const tensor pres, const matrix box, const matrix force_vir, const matrix constraint_vir, @@ -780,7 +780,7 @@ void berendsen_tcoupl(const t_inputrec *ir, const gmx_ekindata_t *ekind, real dt } } -void andersen_tcoupl(t_inputrec *ir, gmx_int64_t step, +void andersen_tcoupl(t_inputrec *ir, int64_t step, const t_commrec *cr, const t_mdatoms *md, t_state *state, real rate, const gmx_bool *randomize, const real *boltzfac) { const int *gatindex = (DOMAINDECOMP(cr) ? cr->dd->globalAtomIndices.data() : nullptr); @@ -852,7 +852,7 @@ void nosehoover_tcoupl(t_grpopts *opts, gmx_ekindata_t *ekind, real dt, } } -void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind, +void trotter_update(t_inputrec *ir, int64_t step, gmx_ekindata_t *ekind, gmx_enerdata_t *enerd, t_state *state, tensor vir, t_mdatoms *md, t_extmass *MassQ, int **trotter_seqlist, int trotter_seqno) @@ -861,7 +861,7 @@ void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind, int n, i, d, ngtc, gc = 0, t; t_grp_tcstat *tcstat; t_grpopts *opts; - gmx_int64_t step_eff; + int64_t step_eff; real dt; double *scalefac, dtc; int *trotter_seq; @@ -1474,7 +1474,7 @@ static real vrescale_sumnoises(real nn, } static real vrescale_resamplekin(real kk, real sigma, real ndeg, real taut, - gmx_int64_t step, gmx_int64_t seed) + int64_t step, int64_t seed) { /* * Generates a new value for the kinetic energy, @@ -1509,7 +1509,7 @@ static real vrescale_resamplekin(real kk, real sigma, real ndeg, real taut, return ekin_new; } -void vrescale_tcoupl(t_inputrec *ir, gmx_int64_t step, +void vrescale_tcoupl(t_inputrec *ir, int64_t step, gmx_ekindata_t *ekind, real dt, double therm_integral[]) { diff --git a/src/gromacs/mdlib/ebin.h b/src/gromacs/mdlib/ebin.h index d1f29fc41c..ca76232058 100644 --- a/src/gromacs/mdlib/ebin.h +++ b/src/gromacs/mdlib/ebin.h @@ -47,11 +47,11 @@ typedef struct { int nener; gmx_enxnm_t *enm; - gmx_int64_t nsteps; - gmx_int64_t nsum; + int64_t nsteps; + int64_t nsum; t_energy *e; - gmx_int64_t nsteps_sim; - gmx_int64_t nsum_sim; + int64_t nsteps_sim; + int64_t nsum_sim; t_energy *e_sim; } t_ebin; diff --git a/src/gromacs/mdlib/expanded.cpp b/src/gromacs/mdlib/expanded.cpp index 2a1d3a50dc..fe54c240d0 100644 --- a/src/gromacs/mdlib/expanded.cpp +++ b/src/gromacs/mdlib/expanded.cpp @@ -227,7 +227,7 @@ static gmx_bool CheckHistogramRatios(int nhisto, const real *histo, real ratio) return bIfFlat; } -static gmx_bool CheckIfDoneEquilibrating(int nlim, t_expanded *expand, df_history_t *dfhist, gmx_int64_t step) +static gmx_bool CheckIfDoneEquilibrating(int nlim, t_expanded *expand, df_history_t *dfhist, int64_t step) { int i, totalsamples; @@ -336,7 +336,7 @@ static gmx_bool CheckIfDoneEquilibrating(int nlim, t_expanded *expand, df_histor } static gmx_bool UpdateWeights(int nlim, t_expanded *expand, df_history_t *dfhist, - int fep_state, real *scaled_lamee, real *weighted_lamee, gmx_int64_t step) + int fep_state, real *scaled_lamee, real *weighted_lamee, int64_t step) { gmx_bool bSufficientSamples; int i; @@ -702,7 +702,7 @@ static gmx_bool UpdateWeights(int nlim, t_expanded *expand, df_history_t *dfhist } static int ChooseNewLambda(int nlim, t_expanded *expand, df_history_t *dfhist, int fep_state, real *weighted_lamee, double *p_k, - gmx_int64_t seed, gmx_int64_t step) + int64_t seed, int64_t step) { /* Choose new lambda value, and update transition matrix */ @@ -992,7 +992,7 @@ static int ChooseNewLambda(int nlim, t_expanded *expand, df_history_t *dfhist, i /* print out the weights to the log, along with current state */ void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist, - int fep_state, int frequency, gmx_int64_t step) + int fep_state, int frequency, int64_t step) { int nlim, i, ifep, jfep; real dw, dg, dv, Tprint; @@ -1160,7 +1160,7 @@ void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd, t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist, - gmx_int64_t step, + int64_t step, rvec *v, t_mdatoms *mdatoms) /* Note that the state variable is only needed for simulated tempering, not Hamiltonian expanded ensemble. May be able to remove it after integrator refactoring. */ diff --git a/src/gromacs/mdlib/expanded.h b/src/gromacs/mdlib/expanded.h index 335c91c981..80abb31344 100644 --- a/src/gromacs/mdlib/expanded.h +++ b/src/gromacs/mdlib/expanded.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017, by the GROMACS development team, led by + * Copyright (c) 2017,2018, 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. @@ -56,10 +56,10 @@ void init_expanded_ensemble(gmx_bool bStateFromCP, t_inputrec *ir, df_history_t int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd, t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist, - gmx_int64_t step, + int64_t step, rvec *v, t_mdatoms *mdatoms); void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist, - int fep_state, int frequency, gmx_int64_t step); + int fep_state, int frequency, int64_t step); #endif diff --git a/src/gromacs/mdlib/force.h b/src/gromacs/mdlib/force.h index 943d070d91..cc49dd4cd6 100644 --- a/src/gromacs/mdlib/force.h +++ b/src/gromacs/mdlib/force.h @@ -94,7 +94,7 @@ void do_force(FILE *log, const t_inputrec *inputrec, gmx::Awh *awh, gmx_enfrot *enforcedRotation, - gmx_int64_t step, + int64_t step, t_nrnb *nrnb, gmx_wallcycle *wcycle, // TODO top can be const when the group scheme no longer diff --git a/src/gromacs/mdlib/forcerec.cpp b/src/gromacs/mdlib/forcerec.cpp index 329a73feb4..6d2981d5e3 100644 --- a/src/gromacs/mdlib/forcerec.cpp +++ b/src/gromacs/mdlib/forcerec.cpp @@ -998,7 +998,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, const gmx_mtop_t *mtop) const t_atoms *atoms, *atoms_tpi; const t_blocka *excl; int nmolc, i, j, tpi, tpj, j1, j2, k, nexcl, q; - gmx_int64_t npair, npair_ij, tmpi, tmpj; + int64_t npair, npair_ij, tmpi, tmpj; double csix, ctwelve; int ntp, *typecount; gmx_bool bBHAM; diff --git a/src/gromacs/mdlib/lincs.cpp b/src/gromacs/mdlib/lincs.cpp index 83981ce01b..557b3b9725 100644 --- a/src/gromacs/mdlib/lincs.cpp +++ b/src/gromacs/mdlib/lincs.cpp @@ -2397,7 +2397,7 @@ static void cconerr(const Lincs *lincsd, bool constrain_lincs(bool computeRmsd, const t_inputrec &ir, - gmx_int64_t step, + int64_t step, Lincs *lincsd, const t_mdatoms &md, const t_commrec *cr, const gmx_multisim_t &ms, diff --git a/src/gromacs/mdlib/lincs.h b/src/gromacs/mdlib/lincs.h index e37ef58ea5..096b8e24c9 100644 --- a/src/gromacs/mdlib/lincs.h +++ b/src/gromacs/mdlib/lincs.h @@ -94,7 +94,7 @@ void set_lincs(const t_idef &idef, const t_mdatoms &md, bool constrain_lincs(bool computeRmsd, const t_inputrec &ir, - gmx_int64_t step, + int64_t step, Lincs *lincsd, const t_mdatoms &md, const t_commrec *cr, const gmx_multisim_t &ms, diff --git a/src/gromacs/mdlib/main.cpp b/src/gromacs/mdlib/main.cpp index e50c27efd9..92f24fc71c 100644 --- a/src/gromacs/mdlib/main.cpp +++ b/src/gromacs/mdlib/main.cpp @@ -121,10 +121,10 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val, // TODO move this to multi-sim module void check_multi_int64(FILE *log, const gmx_multisim_t *ms, - gmx_int64_t val, const char *name, + int64_t val, const char *name, gmx_bool bQuiet) { - gmx_int64_t *ibuf; + int64_t *ibuf; int p; gmx_bool bCompatible; @@ -168,7 +168,7 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms, char strbuf[255]; /* first make the format string */ snprintf(strbuf, 255, " subsystem %%d: %s\n", - "%" GMX_PRId64); + "%" PRId64); fprintf(log, strbuf, p, ibuf[p]); } } diff --git a/src/gromacs/mdlib/main.h b/src/gromacs/mdlib/main.h index 8dd8bdb555..0122f0a749 100644 --- a/src/gromacs/mdlib/main.h +++ b/src/gromacs/mdlib/main.h @@ -63,7 +63,7 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val, const char *name, gmx_bool bQuiet); void check_multi_int64(FILE *log, const gmx_multisim_t *ms, - gmx_int64_t val, const char *name, + int64_t val, const char *name, gmx_bool bQuiet); /* Check if val is the same on all processors for a mdrun -multidir run * The string name is used to print to the log file and in a fatal error diff --git a/src/gromacs/mdlib/md_support.cpp b/src/gromacs/mdlib/md_support.cpp index d3decdb04b..3386196034 100644 --- a/src/gromacs/mdlib/md_support.cpp +++ b/src/gromacs/mdlib/md_support.cpp @@ -76,10 +76,10 @@ // TODO move this to multi-sim module bool multisim_int_all_are_equal(const gmx_multisim_t *ms, - gmx_int64_t value) + int64_t value) { bool allValuesAreEqual = true; - gmx_int64_t *buf; + int64_t *buf; GMX_RELEASE_ASSERT(ms, "Invalid use of multi-simulation pointer"); @@ -330,7 +330,7 @@ static void check_nst_param(const gmx::MDLogger &mdlog, } } -void setCurrentLambdasRerun(gmx_int64_t step, const t_lambda *fepvals, +void setCurrentLambdasRerun(int64_t step, const t_lambda *fepvals, const t_trxframe *rerun_fr, const double *lam0, t_state *globalState) { @@ -367,7 +367,7 @@ void setCurrentLambdasRerun(gmx_int64_t step, const t_lambda *fepvals, } } -void setCurrentLambdasLocal(gmx_int64_t step, const t_lambda *fepvals, +void setCurrentLambdasLocal(int64_t step, const t_lambda *fepvals, const double *lam0, t_state *state) /* find the current lambdas. If rerunning, we either read in a state, or a lambda value, requiring different logic. */ diff --git a/src/gromacs/mdlib/md_support.h b/src/gromacs/mdlib/md_support.h index 828933e0d2..5e57ce7c19 100644 --- a/src/gromacs/mdlib/md_support.h +++ b/src/gromacs/mdlib/md_support.h @@ -101,18 +101,18 @@ int check_nstglobalcomm(const gmx::MDLogger &mdlog, * * \todo This duplicates some of check_multi_int. Consolidate. */ bool multisim_int_all_are_equal(const gmx_multisim_t *ms, - gmx_int64_t value); + int64_t value); void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr, gmx_bool *bLastStep); /* Set the lambda values in the global state from a frame read with rerun */ -void setCurrentLambdasRerun(gmx_int64_t step, const t_lambda *fepvals, +void setCurrentLambdasRerun(int64_t step, const t_lambda *fepvals, const t_trxframe *rerun_fr, const double *lam0, t_state *globalState); /* Set the lambda values at each step of mdrun when they change */ -void setCurrentLambdasLocal(gmx_int64_t step, const t_lambda *fepvals, +void setCurrentLambdasLocal(int64_t step, const t_lambda *fepvals, const double *lam0, t_state *state); int multisim_min(const gmx_multisim_t *ms, int nmin, int n); diff --git a/src/gromacs/mdlib/mdebin.cpp b/src/gromacs/mdlib/mdebin.cpp index 642a961688..4b7e98650e 100644 --- a/src/gromacs/mdlib/mdebin.cpp +++ b/src/gromacs/mdlib/mdebin.cpp @@ -1240,7 +1240,7 @@ static void pprint(FILE *log, const char *s, t_mdebin *md) fprintf(log, "\n"); } -void print_ebin_header(FILE *log, gmx_int64_t steps, double time) +void print_ebin_header(FILE *log, int64_t steps, double time) { char buf[22]; @@ -1253,7 +1253,7 @@ void print_ebin_header(FILE *log, gmx_int64_t steps, double time) // both .edr and .log output for both per-time and time-average data. void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR, FILE *log, - gmx_int64_t step, double time, + int64_t step, double time, int mode, t_mdebin *md, t_fcdata *fcd, gmx_groups_t *groups, t_grpopts *opts, diff --git a/src/gromacs/mdlib/mdebin.h b/src/gromacs/mdlib/mdebin.h index 151a59b35c..a8ac876089 100644 --- a/src/gromacs/mdlib/mdebin.h +++ b/src/gromacs/mdlib/mdebin.h @@ -157,11 +157,11 @@ void upd_mdebin(t_mdebin *md, void upd_mdebin_step(t_mdebin *md); /* Updates only the step count in md */ -void print_ebin_header(FILE *log, gmx_int64_t steps, double time); +void print_ebin_header(FILE *log, int64_t steps, double time); void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR, FILE *log, - gmx_int64_t step, double time, + int64_t step, double time, int mode, t_mdebin *md, t_fcdata *fcd, gmx_groups_t *groups, t_grpopts *opts, diff --git a/src/gromacs/mdlib/mdebin_bar.cpp b/src/gromacs/mdlib/mdebin_bar.cpp index 58d77cbc52..3f578a1dc1 100644 --- a/src/gromacs/mdlib/mdebin_bar.cpp +++ b/src/gromacs/mdlib/mdebin_bar.cpp @@ -176,7 +176,7 @@ static void mde_delta_h_make_hist(t_mde_delta_h *dh, int hi, gmx_bool invert) Get this start value in number of histogram dxs from zero, as an integer.*/ - dh->x0[hi] = (gmx_int64_t)floor(min_dh/dx); + dh->x0[hi] = (int64_t)floor(min_dh/dx); min_dh_hist = (dh->x0[hi])*dx; max_dh_hist = (dh->x0[hi] + dh->nbins + 1)*dx; diff --git a/src/gromacs/mdlib/mdebin_bar.h b/src/gromacs/mdlib/mdebin_bar.h index 4294479746..919ccd86b8 100644 --- a/src/gromacs/mdlib/mdebin_bar.h +++ b/src/gromacs/mdlib/mdebin_bar.h @@ -64,8 +64,8 @@ typedef struct double dx; /* the histogram spacing in kJ/mol. This is the same for the two histograms? */ unsigned int nbins; /* the number of bins in the histograms*/ - gmx_int64_t x0[2]; /* the starting point in units of spacing - of the histogram */ + int64_t x0[2]; /* the starting point in units of spacing + of the histogram */ unsigned int maxbin[2]; /* highest bin number with data */ int type; /* the block type according to dhbtDH, etc. */ @@ -75,8 +75,8 @@ typedef struct int nlambda; /* length of the lambda vector */ gmx_bool written; /* whether this data has already been written out */ - gmx_int64_t subblock_meta_l[5]; /* metadata for an mdebin subblock for - I/O: for histogram counts, etc.*/ + int64_t subblock_meta_l[5]; /* metadata for an mdebin subblock for + I/O: for histogram counts, etc.*/ double *subblock_meta_d; /* metadata subblock for I/O, used for communicating doubles (i.e. the lambda vector) */ diff --git a/src/gromacs/mdlib/mdoutf.cpp b/src/gromacs/mdlib/mdoutf.cpp index d309052901..4f485e6f42 100644 --- a/src/gromacs/mdlib/mdoutf.cpp +++ b/src/gromacs/mdlib/mdoutf.cpp @@ -249,7 +249,7 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, const t_commrec *cr, gmx_mdoutf_t of, int mdof_flags, gmx_mtop_t *top_global, - gmx_int64_t step, double t, + int64_t step, double t, t_state *state_local, t_state *state_global, ObservablesHistory *observablesHistory, gmx::ArrayRef f_local) diff --git a/src/gromacs/mdlib/mdoutf.h b/src/gromacs/mdlib/mdoutf.h index d7666978f7..35c2e4f34c 100644 --- a/src/gromacs/mdlib/mdoutf.h +++ b/src/gromacs/mdlib/mdoutf.h @@ -106,7 +106,7 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, const t_commrec *cr, gmx_mdoutf_t of, int mdof_flags, gmx_mtop_t *top_global, - gmx_int64_t step, double t, + int64_t step, double t, t_state *state_local, t_state *state_global, ObservablesHistory *observablesHistory, gmx::ArrayRef f_local); diff --git a/src/gromacs/mdlib/mdrun.h b/src/gromacs/mdlib/mdrun.h index 9fdc957328..3eef882681 100644 --- a/src/gromacs/mdlib/mdrun.h +++ b/src/gromacs/mdlib/mdrun.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,2018, 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. @@ -167,7 +167,7 @@ struct MdrunOptions //! Options for checkpointing th simulation CheckpointOptions checkpointOptions; //! Number of steps to run, -2 is use inputrec, -1 is infinite - gmx_int64_t numStepsCommandline; + int64_t numStepsCommandline; //! Maximum duration of this simulation in wall-clock hours, -1 is no limit real maximumHoursToRun; //! Options for timing the run diff --git a/src/gromacs/mdlib/nbnxn_pairlist.h b/src/gromacs/mdlib/nbnxn_pairlist.h index e9d4764228..57422c192d 100644 --- a/src/gromacs/mdlib/nbnxn_pairlist.h +++ b/src/gromacs/mdlib/nbnxn_pairlist.h @@ -231,7 +231,7 @@ typedef struct { int natpair_lj; /* Total number of atom pairs for LJ kernel */ int natpair_q; /* Total number of atom pairs for Q kernel */ t_nblist **nbl_fep; /* List of free-energy atom pair interactions */ - gmx_int64_t outerListCreationStep; /* Step at which the outer list was created */ + int64_t outerListCreationStep; /* Step at which the outer list was created */ } nbnxn_pairlist_set_t; enum { @@ -311,8 +311,8 @@ typedef struct nbnxn_atomdata_t { real *simd_4xn_diagonal_j_minus_i; real *simd_2xnn_diagonal_j_minus_i; /* Filters for topology exclusion masks for the SIMD kernels. */ - gmx_uint32_t *simd_exclusion_filter; - gmx_uint64_t *simd_exclusion_filter64; //!< Used for double w/o SIMD int32 logical support + uint32_t *simd_exclusion_filter; + uint64_t *simd_exclusion_filter64; //!< Used for double w/o SIMD int32 logical support real *simd_interaction_array; /* Array of masks needed for exclusions */ int nout; /* The number of force arrays */ nbnxn_atomdata_output_t *out; /* Output data structures */ diff --git a/src/gromacs/mdlib/repl_ex.cpp b/src/gromacs/mdlib/repl_ex.cpp index 5d6be26738..53f8e09ec0 100644 --- a/src/gromacs/mdlib/repl_ex.cpp +++ b/src/gromacs/mdlib/repl_ex.cpp @@ -805,7 +805,7 @@ test_for_replica_exchange(FILE *fplog, struct gmx_repl_ex *re, const gmx_enerdata_t *enerd, real vol, - gmx_int64_t step, + int64_t step, real time) { int m, i, j, a, b, ap, bp, i0, i1, tmp; @@ -822,7 +822,7 @@ test_for_replica_exchange(FILE *fplog, gmx::UniformIntDistribution uniformNreplDist(0, re->nrepl-1); bMultiEx = (re->nex > 1); /* multiple exchanges at each state */ - fprintf(fplog, "Replica exchange at step %" GMX_PRId64 " time %.5f\n", step, time); + fprintf(fplog, "Replica exchange at step %" PRId64 " time %.5f\n", step, time); if (re->bNPT) { @@ -1211,7 +1211,7 @@ prepare_to_do_exchange(struct gmx_repl_ex *re, gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, const gmx_multisim_t *ms, struct gmx_repl_ex *re, t_state *state, const gmx_enerdata_t *enerd, - t_state *state_local, gmx_int64_t step, real time) + t_state *state_local, int64_t step, real time) { int j; int replica_id = 0; diff --git a/src/gromacs/mdlib/repl_ex.h b/src/gromacs/mdlib/repl_ex.h index 468eb7dee1..0f3b020239 100644 --- a/src/gromacs/mdlib/repl_ex.h +++ b/src/gromacs/mdlib/repl_ex.h @@ -81,7 +81,7 @@ gmx_bool replica_exchange(FILE *fplog, gmx_repl_ex_t re, t_state *state, const gmx_enerdata_t *enerd, t_state *state_local, - gmx_int64_t step, real time); + int64_t step, real time); /* Attempts replica exchange, should be called on all ranks. * Returns TRUE if this state has been exchanged. * When running each replica in parallel, diff --git a/src/gromacs/mdlib/shellfc.cpp b/src/gromacs/mdlib/shellfc.cpp index 5f0ade761c..ba88a2118b 100644 --- a/src/gromacs/mdlib/shellfc.cpp +++ b/src/gromacs/mdlib/shellfc.cpp @@ -811,7 +811,7 @@ static void decrease_step_size(int nshell, t_shell s[]) } } -static void print_epot(FILE *fp, gmx_int64_t mdstep, int count, real epot, real df, +static void print_epot(FILE *fp, int64_t mdstep, int count, real epot, real df, int ndir, real sf_dir) { char buf[22]; @@ -898,7 +898,7 @@ static void init_adir(gmx_shellfc_t *shfc, const t_inputrec *ir, const t_commrec *cr, int dd_ac1, - gmx_int64_t step, + int64_t step, const t_mdatoms *md, int end, rvec *x_old, @@ -987,7 +987,7 @@ void relax_shell_flexcon(FILE *fplog, const gmx_multisim_t *ms, gmx_bool bVerbose, gmx_enfrot *enforcedRotation, - gmx_int64_t mdstep, + int64_t mdstep, const t_inputrec *inputrec, gmx_bool bDoNS, int force_flags, @@ -1345,7 +1345,7 @@ void relax_shell_flexcon(FILE *fplog, std::copy(force[Min].begin(), force[Min].end(), f.begin()); } -void done_shellfc(FILE *fplog, gmx_shellfc_t *shfc, gmx_int64_t numSteps) +void done_shellfc(FILE *fplog, gmx_shellfc_t *shfc, int64_t numSteps) { if (shfc && fplog && numSteps > 0) { diff --git a/src/gromacs/mdlib/shellfc.h b/src/gromacs/mdlib/shellfc.h index ba679cb6c5..4cf49cbf88 100644 --- a/src/gromacs/mdlib/shellfc.h +++ b/src/gromacs/mdlib/shellfc.h @@ -79,7 +79,7 @@ void relax_shell_flexcon(FILE *log, const gmx_multisim_t *ms, gmx_bool bVerbose, gmx_enfrot *enforcedRotation, - gmx_int64_t mdstep, + int64_t mdstep, const t_inputrec *inputrec, gmx_bool bDoNS, int force_flags, @@ -104,6 +104,6 @@ void relax_shell_flexcon(FILE *log, DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion); /* Print some final output */ -void done_shellfc(FILE *fplog, gmx_shellfc_t *shellfc, gmx_int64_t numSteps); +void done_shellfc(FILE *fplog, gmx_shellfc_t *shellfc, int64_t numSteps); #endif diff --git a/src/gromacs/mdlib/sim_util.cpp b/src/gromacs/mdlib/sim_util.cpp index ce16deb279..9cfc324715 100644 --- a/src/gromacs/mdlib/sim_util.cpp +++ b/src/gromacs/mdlib/sim_util.cpp @@ -126,7 +126,7 @@ static const bool c_disableAlternatingWait = (getenv("GMX_DISABLE_ALTERNATING_GP void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting, - gmx_int64_t step, + int64_t step, t_inputrec *ir, const t_commrec *cr) { @@ -337,7 +337,7 @@ static void pme_receive_force_ener(const t_commrec *cr, static void print_large_forces(FILE *fp, const t_mdatoms *md, const t_commrec *cr, - gmx_int64_t step, + int64_t step, real forceTolerance, const rvec *x, const rvec *f) @@ -350,7 +350,7 @@ static void print_large_forces(FILE *fp, bool nonFinite = !std::isfinite(force2); if (force2 >= force2Tolerance || nonFinite) { - fprintf(fp, "step %" GMX_PRId64 " atom %6d x %8.3f %8.3f %8.3f force %12.5e\n", + fprintf(fp, "step %" PRId64 " atom %6d x %8.3f %8.3f %8.3f force %12.5e\n", step, ddglatnr(cr->dd, i), x[i][XX], x[i][YY], x[i][ZZ], std::sqrt(force2)); } @@ -365,12 +365,12 @@ static void print_large_forces(FILE *fp, * the printing on other ranks. But we can only avoid that with * an expensive MPI barrier that we would need at each step. */ - gmx_fatal(FARGS, "At step %" GMX_PRId64 " detected non-finite forces on %ju atoms", step, numNonFinite); + gmx_fatal(FARGS, "At step %" PRId64 " detected non-finite forces on %ju atoms", step, numNonFinite); } } static void post_process_forces(const t_commrec *cr, - gmx_int64_t step, + int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, const gmx_localtop_t *top, @@ -430,7 +430,7 @@ static void do_nb_verlet(t_forcerec *fr, gmx_enerdata_t *enerd, int flags, int ilocality, int clearF, - gmx_int64_t step, + int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle) { @@ -754,7 +754,7 @@ static real averageKineticEnergyEstimate(const t_grpopts &groupOptions) * \param[in] enerd The energy data; the non-bonded group energies need to be added to enerd.term[F_EPOT] before calling this routine * \param[in] inputrec The input record */ -static void checkPotentialEnergyValidity(gmx_int64_t step, +static void checkPotentialEnergyValidity(int64_t step, const gmx_enerdata_t &enerd, const t_inputrec &inputrec) { @@ -781,7 +781,7 @@ static void checkPotentialEnergyValidity(gmx_int64_t step, if (energyIsNotFinite || (averageKineticEnergy > 0 && enerd.term[F_EPOT] > c_thresholdFactor*averageKineticEnergy)) { - gmx_fatal(FARGS, "Step %" GMX_PRId64 ": The total potential energy is %g, which is %s. The LJ and electrostatic contributions to the energy are %g and %g, respectively. A %s potential energy can be caused by overlapping interactions in bonded interactions or very large%s coordinate values. Usually this is caused by a badly- or non-equilibrated initial configuration, incorrect interactions or parameters in the topology.", + gmx_fatal(FARGS, "Step %" PRId64 ": The total potential energy is %g, which is %s. The LJ and electrostatic contributions to the energy are %g and %g, respectively. A %s potential energy can be caused by overlapping interactions in bonded interactions or very large%s coordinate values. Usually this is caused by a badly- or non-equilibrated initial configuration, incorrect interactions or parameters in the topology.", step, enerd.term[F_EPOT], energyIsNotFinite ? "not finite" : "extremely high", @@ -830,7 +830,7 @@ computeSpecialForces(FILE *fplog, const t_inputrec *inputrec, gmx::Awh *awh, gmx_enfrot *enforcedRotation, - gmx_int64_t step, + int64_t step, double t, gmx_wallcycle_t wcycle, ForceProviders *forceProviders, @@ -1027,7 +1027,7 @@ static void alternatePmeNbGpuWaitReduce(nonbonded_verlet_t *nbv static inline void launchGpuRollingPruning(const t_commrec *cr, const nonbonded_verlet_t *nbv, const t_inputrec *inputrec, - const gmx_int64_t step) + const int64_t step) { /* We should not launch the rolling pruning kernel at a search * step or just before search steps, since that's useless. @@ -1055,7 +1055,7 @@ static void do_force_cutsVERLET(FILE *fplog, const t_inputrec *inputrec, gmx::Awh *awh, gmx_enfrot *enforcedRotation, - gmx_int64_t step, + int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, const gmx_localtop_t *top, @@ -1754,7 +1754,7 @@ static void do_force_cutsGROUP(FILE *fplog, const t_inputrec *inputrec, gmx::Awh *awh, gmx_enfrot *enforcedRotation, - gmx_int64_t step, + int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, gmx_localtop_t *top, @@ -2089,7 +2089,7 @@ void do_force(FILE *fplog, const t_inputrec *inputrec, gmx::Awh *awh, gmx_enfrot *enforcedRotation, - gmx_int64_t step, + int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, gmx_localtop_t *top, @@ -2179,7 +2179,7 @@ void do_constrain_first(FILE *fplog, gmx::Constraints *constr, t_state *state) { int i, m, start, end; - gmx_int64_t step; + int64_t step; real dt = ir->delta_t; real dvdl_dum; rvec *savex; diff --git a/src/gromacs/mdlib/sim_util.h b/src/gromacs/mdlib/sim_util.h index 60825471c8..d3db440379 100644 --- a/src/gromacs/mdlib/sim_util.h +++ b/src/gromacs/mdlib/sim_util.h @@ -99,13 +99,13 @@ void global_stat(gmx_global_stat_t gs, gmx_bool bSumEkinhOld, int flags); /* All-reduce energy-like quantities over cr->mpi_comm_mysim */ -int do_per_step(gmx_int64_t step, gmx_int64_t nstep); +int do_per_step(int64_t step, int64_t nstep); /* Return TRUE if io should be done */ /* ROUTINES from sim_util.c */ void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting, - gmx_int64_t step, t_inputrec *ir, const t_commrec *cr); + int64_t step, t_inputrec *ir, const t_commrec *cr); /*! \brief Print date, time, MPI rank and a description of this point * in time. diff --git a/src/gromacs/mdlib/stat.cpp b/src/gromacs/mdlib/stat.cpp index 32fed5d8f1..5c5ce34765 100644 --- a/src/gromacs/mdlib/stat.cpp +++ b/src/gromacs/mdlib/stat.cpp @@ -380,7 +380,7 @@ void global_stat(gmx_global_stat_t gs, } } -int do_per_step(gmx_int64_t step, gmx_int64_t nstep) +int do_per_step(int64_t step, int64_t nstep) { if (nstep != 0) { diff --git a/src/gromacs/mdlib/trajectory_writing.cpp b/src/gromacs/mdlib/trajectory_writing.cpp index 61bf1b96e5..3172c03b1b 100644 --- a/src/gromacs/mdlib/trajectory_writing.cpp +++ b/src/gromacs/mdlib/trajectory_writing.cpp @@ -58,8 +58,8 @@ do_md_trajectory_writing(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], - gmx_int64_t step, - gmx_int64_t step_rel, + int64_t step, + int64_t step_rel, double t, t_inputrec *ir, t_state *state, diff --git a/src/gromacs/mdlib/trajectory_writing.h b/src/gromacs/mdlib/trajectory_writing.h index 9bf1fcfec5..ea000f8d6b 100644 --- a/src/gromacs/mdlib/trajectory_writing.h +++ b/src/gromacs/mdlib/trajectory_writing.h @@ -63,8 +63,8 @@ do_md_trajectory_writing(FILE *fplog, struct t_commrec *cr, int nfile, const t_filenm fnm[], - gmx_int64_t step, - gmx_int64_t step_rel, + int64_t step, + int64_t step_rel, double t, t_inputrec *ir, t_state *state, diff --git a/src/gromacs/mdlib/update.cpp b/src/gromacs/mdlib/update.cpp index 0a0caf8612..b418cd9ecc 100644 --- a/src/gromacs/mdlib/update.cpp +++ b/src/gromacs/mdlib/update.cpp @@ -111,14 +111,14 @@ struct gmx_update_t PaddedRVecVector xp; /* Variables for the deform algorithm */ - gmx_int64_t deformref_step; + int64_t deformref_step; matrix deformref_box; //! Box deformation handler (or nullptr if inactive). gmx::BoxDeformation *deform; }; -static bool isTemperatureCouplingStep(gmx_int64_t step, const t_inputrec *ir) +static bool isTemperatureCouplingStep(int64_t step, const t_inputrec *ir) { /* We should only couple after a step where energies were determined (for leapfrog versions) or the step energies are determined, for velocity verlet versions */ @@ -136,7 +136,7 @@ static bool isTemperatureCouplingStep(gmx_int64_t step, const t_inputrec *ir) do_per_step(step + ir->nsttcouple - offset, ir->nsttcouple)); } -static bool isPressureCouplingStep(gmx_int64_t step, const t_inputrec *ir) +static bool isPressureCouplingStep(int64_t step, const t_inputrec *ir) { GMX_ASSERT(ir->epc != epcMTTK, "MTTK pressure coupling is not handled here"); @@ -522,7 +522,7 @@ updateMDLeapfrogGeneral(int start, /*! \brief Handles the Leap-frog MD x and v integration */ static void do_update_md(int start, int nrend, - gmx_int64_t step, + int64_t step, real dt, const t_inputrec * ir, const t_mdatoms * md, @@ -907,7 +907,7 @@ doSDUpdateGeneral(gmx_stochd_t *sd, const unsigned short cFREEZE[], const unsigned short cACC[], const unsigned short cTC[], const rvec x[], rvec xprime[], rvec v[], const rvec f[], - gmx_int64_t step, int seed, const int *gatindex) + int64_t step, int seed, const int *gatindex) { if (updateType != SDUpdate::FrictionAndNoiseOnly) { @@ -992,7 +992,7 @@ static void do_update_bd(int start, int nrend, real dt, const unsigned short cFREEZE[], const unsigned short cTC[], const rvec x[], rvec xprime[], rvec v[], const rvec f[], real friction_coefficient, - const real *rf, gmx_int64_t step, int seed, + const real *rf, int64_t step, int seed, const int* gatindex) { /* note -- these appear to be full step velocities . . . */ @@ -1338,7 +1338,7 @@ void restore_ekinstate_from_state(const t_commrec *cr, } } -void update_tcouple(gmx_int64_t step, +void update_tcouple(int64_t step, t_inputrec *inputrec, t_state *state, gmx_ekindata_t *ekind, @@ -1418,7 +1418,7 @@ static void getThreadAtomRange(int numThreads, int threadIndex, int numAtoms, } void update_pcouple_before_coordinates(FILE *fplog, - gmx_int64_t step, + int64_t step, const t_inputrec *inputrec, t_state *state, matrix parrinellorahmanMu, @@ -1439,7 +1439,7 @@ void update_pcouple_before_coordinates(FILE *fplog, } } -void constrain_velocities(gmx_int64_t step, +void constrain_velocities(int64_t step, real *dvdlambda, /* the contribution to be added to the bonded interactions */ t_state *state, tensor vir_part, @@ -1485,7 +1485,7 @@ void constrain_velocities(gmx_int64_t step, } } -void constrain_coordinates(gmx_int64_t step, +void constrain_coordinates(int64_t step, real *dvdlambda, /* the contribution to be added to the bonded interactions */ t_state *state, tensor vir_part, @@ -1527,7 +1527,7 @@ void constrain_coordinates(gmx_int64_t step, } void -update_sd_second_half(gmx_int64_t step, +update_sd_second_half(int64_t step, real *dvdlambda, /* the contribution to be added to the bonded interactions */ const t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, @@ -1688,7 +1688,7 @@ void finish_update(const t_inputrec *inputrec, /* input record and } void update_pcouple_after_coordinates(FILE *fplog, - gmx_int64_t step, + int64_t step, const t_inputrec *inputrec, const t_mdatoms *md, const matrix pressure, @@ -1785,7 +1785,7 @@ void update_pcouple_after_coordinates(FILE *fplog, } } -void update_coords(gmx_int64_t step, +void update_coords(int64_t step, t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, t_state *state, @@ -1931,7 +1931,7 @@ void update_coords(gmx_int64_t step, } -extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, const t_commrec *cr, +extern gmx_bool update_randomize_velocities(t_inputrec *ir, int64_t step, const t_commrec *cr, t_mdatoms *md, t_state *state, gmx_update_t *upd, gmx::Constraints *constr) { diff --git a/src/gromacs/mdlib/update.h b/src/gromacs/mdlib/update.h index 34eb435639..d5d41b062d 100644 --- a/src/gromacs/mdlib/update.h +++ b/src/gromacs/mdlib/update.h @@ -83,9 +83,9 @@ void update_realloc(gmx_update_t *upd, int natoms); * as a reference state for simulations with box deformation. */ void set_deform_reference_box(gmx_update_t *upd, - gmx_int64_t step, matrix box); + int64_t step, matrix box); -void update_tcouple(gmx_int64_t step, +void update_tcouple(int64_t step, t_inputrec *inputrec, t_state *state, gmx_ekindata_t *ekind, @@ -95,7 +95,7 @@ void update_tcouple(gmx_int64_t step, /* Update Parrinello-Rahman, to be called before the coordinate update */ void update_pcouple_before_coordinates(FILE *fplog, - gmx_int64_t step, + int64_t step, const t_inputrec *inputrec, t_state *state, matrix parrinellorahmanMu, @@ -108,7 +108,7 @@ void update_pcouple_before_coordinates(FILE *fplog, * When the deform option is used, scales coordinates and box here. */ void update_pcouple_after_coordinates(FILE *fplog, - gmx_int64_t step, + int64_t step, const t_inputrec *inputrec, const t_mdatoms *md, const matrix pressure, @@ -119,7 +119,7 @@ void update_pcouple_after_coordinates(FILE *fplog, t_nrnb *nrnb, gmx_update_t *upd); -void update_coords(gmx_int64_t step, +void update_coords(int64_t step, t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, t_state *state, @@ -134,9 +134,9 @@ void update_coords(gmx_int64_t step, /* Return TRUE if OK, FALSE in case of Shake Error */ -extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, const t_commrec *cr, t_mdatoms *md, t_state *state, gmx_update_t *upd, gmx::Constraints *constr); +extern gmx_bool update_randomize_velocities(t_inputrec *ir, int64_t step, const t_commrec *cr, t_mdatoms *md, t_state *state, gmx_update_t *upd, gmx::Constraints *constr); -void constrain_velocities(gmx_int64_t step, +void constrain_velocities(int64_t step, real *dvdlambda, /* the contribution to be added to the bonded interactions */ t_state *state, tensor vir_part, @@ -146,7 +146,7 @@ void constrain_velocities(gmx_int64_t step, bool do_log, bool do_ene); -void constrain_coordinates(gmx_int64_t step, +void constrain_coordinates(int64_t step, real *dvdlambda, /* the contribution to be added to the bonded interactions */ t_state *state, tensor vir_part, @@ -157,7 +157,7 @@ void constrain_coordinates(gmx_int64_t step, bool do_log, bool do_ene); -void update_sd_second_half(gmx_int64_t step, +void update_sd_second_half(int64_t step, real *dvdlambda, /* the contribution to be added to the bonded interactions */ const t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, @@ -215,13 +215,13 @@ restore_ekinstate_from_state(const t_commrec *cr, void berendsen_tcoupl(const t_inputrec *ir, const gmx_ekindata_t *ekind, real dt, std::vector &therm_integral); -void andersen_tcoupl(t_inputrec *ir, gmx_int64_t step, +void andersen_tcoupl(t_inputrec *ir, int64_t step, const t_commrec *cr, const t_mdatoms *md, t_state *state, real rate, const gmx_bool *randomize, const real *boltzfac); void nosehoover_tcoupl(t_grpopts *opts, gmx_ekindata_t *ekind, real dt, double xi[], double vxi[], t_extmass *MassQ); -void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind, +void trotter_update(t_inputrec *ir, int64_t step, gmx_ekindata_t *ekind, gmx_enerdata_t *enerd, t_state *state, tensor vir, t_mdatoms *md, t_extmass *MassQ, int **trotter_seqlist, int trotter_seqno); @@ -233,7 +233,7 @@ real NPT_energy(const t_inputrec *ir, const t_state *state, const t_extmass *Mas void NBaroT_trotter(t_grpopts *opts, real dt, double xi[], double vxi[], real *veta, t_extmass *MassQ); -void vrescale_tcoupl(t_inputrec *ir, gmx_int64_t step, +void vrescale_tcoupl(t_inputrec *ir, int64_t step, gmx_ekindata_t *ekind, real dt, double therm_integral[]); /* Compute temperature scaling. For V-rescale it is done in update. */ @@ -254,13 +254,13 @@ real calc_pres(int ePBC, int nwall, matrix box, tensor ekin, tensor vir, * The unit of pressure is bar. */ -void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step, +void parrinellorahman_pcoupl(FILE *fplog, int64_t step, const t_inputrec *ir, real dt, const tensor pres, tensor box, tensor box_rel, tensor boxv, tensor M, matrix mu, gmx_bool bFirstStep); -void berendsen_pcoupl(FILE *fplog, gmx_int64_t step, +void berendsen_pcoupl(FILE *fplog, int64_t step, const t_inputrec *ir, real dt, const tensor pres, const matrix box, const matrix force_vir, const matrix constraint_vir, diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index 620161dcfe..a96a616a79 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -142,8 +142,8 @@ using gmx::SimulationSignaller; //! Resets all the counters. static void reset_all_counters(FILE *fplog, const gmx::MDLogger &mdlog, t_commrec *cr, - gmx_int64_t step, - gmx_int64_t *step_rel, t_inputrec *ir, + int64_t step, + int64_t *step_rel, t_inputrec *ir, gmx_wallcycle_t wcycle, t_nrnb *nrnb, gmx_walltime_accounting_t walltime_accounting, struct nonbonded_verlet_t *nbv, @@ -268,7 +268,7 @@ void gmx::Integrator::do_md() // will go away eventually. t_inputrec *ir = inputrec; gmx_mdoutf *outf = nullptr; - gmx_int64_t step, step_rel; + int64_t step, step_rel; double elapsed_time; double t, t0, lam0[efptNR]; gmx_bool bGStatEveryStep, bGStat, bCalcVir, bCalcEnerStep, bCalcEner; @@ -1850,7 +1850,7 @@ void gmx::Integrator::do_md() * until after load balancing completes, * e.g. https://gerrit.gromacs.org/#/c/4964/2 */ gmx_fatal(FARGS, "PME tuning was still active when attempting to " - "reset mdrun counters at step %" GMX_PRId64 ". Try " + "reset mdrun counters at step %" PRId64 ". Try " "resetting counters later in the run, e.g. with gmx " "mdrun -resetstep.", step); } diff --git a/src/gromacs/mdrun/minimize.cpp b/src/gromacs/mdrun/minimize.cpp index 6de6a97336..6ce3ec0e34 100644 --- a/src/gromacs/mdrun/minimize.cpp +++ b/src/gromacs/mdrun/minimize.cpp @@ -205,7 +205,7 @@ static void warn_step(FILE *fp, //! Print message about convergence of the EM static void print_converged(FILE *fp, const char *alg, real ftol, - gmx_int64_t count, gmx_bool bDone, gmx_int64_t nsteps, + int64_t count, gmx_bool bDone, int64_t nsteps, const em_state_t *ems, double sqrtNumAtoms) { char buf[STEPSTRSIZE]; @@ -526,7 +526,7 @@ static void write_em_traj(FILE *fplog, const t_commrec *cr, gmx_mdoutf_t outf, gmx_bool bX, gmx_bool bF, const char *confout, gmx_mtop_t *top_global, - t_inputrec *ir, gmx_int64_t step, + t_inputrec *ir, int64_t step, em_state_t *state, t_state *state_global, ObservablesHistory *observablesHistory) @@ -585,7 +585,7 @@ static bool do_em_step(const t_commrec *cr, em_state_t *ems1, real a, const PaddedRVecVector *force, em_state_t *ems2, gmx::Constraints *constr, - gmx_int64_t count) + int64_t count) { t_state *s1, *s2; @@ -773,7 +773,7 @@ class EnergyEvaluator */ void run(em_state_t *ems, rvec mu_tot, tensor vir, tensor pres, - gmx_int64_t count, gmx_bool bFirst); + int64_t count, gmx_bool bFirst); //! Handles logging. FILE *fplog; //! Handles communication. @@ -811,7 +811,7 @@ class EnergyEvaluator void EnergyEvaluator::run(em_state_t *ems, rvec mu_tot, tensor vir, tensor pres, - gmx_int64_t count, gmx_bool bFirst) + int64_t count, gmx_bool bFirst) { real t; gmx_bool bNS; @@ -2776,7 +2776,7 @@ Integrator::do_nm() size_t atom = atom_index[aid]; for (size_t d = 0; d < DIM; d++) { - gmx_int64_t step = 0; + int64_t step = 0; int force_flags = GMX_FORCE_STATECHANGED | GMX_FORCE_ALLFORCES; double t = 0; diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index d1b7e42bb3..2af4727008 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -274,7 +274,7 @@ static void prepare_verlet_scheme(FILE *fplog, * with value passed on the command line (if any) */ static void override_nsteps_cmdline(const gmx::MDLogger &mdlog, - gmx_int64_t nsteps_cmdline, + int64_t nsteps_cmdline, t_inputrec *ir) { assert(ir); @@ -391,7 +391,7 @@ int Mdrunner::mdrunner() gmx_wallcycle_t wcycle; gmx_walltime_accounting_t walltime_accounting = nullptr; int rc; - gmx_int64_t reset_counters; + int64_t reset_counters; int nthreads_pme = 1; gmx_membed_t * membed = nullptr; gmx_hw_info_t *hwinfo = nullptr; diff --git a/src/gromacs/mdrun/tpi.cpp b/src/gromacs/mdrun/tpi.cpp index 012e3a7eca..15eec2be09 100644 --- a/src/gromacs/mdrun/tpi.cpp +++ b/src/gromacs/mdrun/tpi.cpp @@ -145,9 +145,9 @@ Integrator::do_tpi() rvec *x_mol; rvec mu_tot, x_init, dx, x_tp; int nnodes, frame; - gmx_int64_t frame_step_prev, frame_step; - gmx_int64_t nsteps, stepblocksize = 0, step; - gmx_int64_t seed; + int64_t frame_step_prev, frame_step; + int64_t nsteps, stepblocksize = 0, step; + int64_t seed; int i; FILE *fp_tpi = nullptr; char *ptr, *dump_pdb, **leg, str[STRLEN], str2[STRLEN]; diff --git a/src/gromacs/mdtypes/awh-history.h b/src/gromacs/mdtypes/awh-history.h index 1198e13581..b554830e2a 100644 --- a/src/gromacs/mdtypes/awh-history.h +++ b/src/gromacs/mdtypes/awh-history.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018, 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. @@ -60,17 +60,17 @@ namespace gmx //! Grid point state history data. struct AwhPointStateHistory { - double bias; /**< Current biasing function estimate */ - double free_energy; /**< Current estimate of the convolved free energy/PMF. */ - double target; /**< Current target distribution, normalized to 1 */ - double weightsum_iteration; /**< Accumulated weight this iteration (1 replica) */ - double weightsum_covering; /**< Accumulated weights for covering checks */ - double weightsum_tot; /**< Accumulated weights, never reset */ - double weightsum_ref; /**< The reference weight histogram determining the f updates */ - gmx_int64_t last_update_index; /**< The last update that was performed at this point. */ - double log_pmfsum; /**< Logarithm of the PMF histogram (for 1 replica) */ - double visits_iteration; /**< Visits to this bin this iteration (1 replica) */ - double visits_tot; /**< Accumulated visits to this bin */ + double bias; /**< Current biasing function estimate */ + double free_energy; /**< Current estimate of the convolved free energy/PMF. */ + double target; /**< Current target distribution, normalized to 1 */ + double weightsum_iteration; /**< Accumulated weight this iteration (1 replica) */ + double weightsum_covering; /**< Accumulated weights for covering checks */ + double weightsum_tot; /**< Accumulated weights, never reset */ + double weightsum_ref; /**< The reference weight histogram determining the f updates */ + int64_t last_update_index; /**< The last update that was performed at this point. */ + double log_pmfsum; /**< Logarithm of the PMF histogram (for 1 replica) */ + double visits_iteration; /**< Visits to this bin this iteration (1 replica) */ + double visits_tot; /**< Accumulated visits to this bin */ }; //! The global AWH bias history state, contains most data of the corresponding struct in awh.h. @@ -84,7 +84,7 @@ struct AwhBiasStateHistory double histSize; /**< Size of reference weight histogram. */ double logScaledSampleWeight; /**< The log of the current sample weight, scaled because of the histogram rescaling. */ double maxLogScaledSampleWeight; /**< Maximum sample weight obtained for previous (smaller) histogram sizes. */ - gmx_int64_t numUpdates; /**< The number of updates. */ + int64_t numUpdates; /**< The number of updates. */ /*! \brief Constructor. */ AwhBiasStateHistory() : umbrellaGridpoint(0), diff --git a/src/gromacs/mdtypes/awh-params.h b/src/gromacs/mdtypes/awh-params.h index 77f23bbc95..6eef443fda 100644 --- a/src/gromacs/mdtypes/awh-params.h +++ b/src/gromacs/mdtypes/awh-params.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -130,7 +130,7 @@ struct AwhParams // TODO: Turn awhBiasParams into a std::vector when moved into AWH module int numBias; /**< The number of AWH biases.*/ AwhBiasParams *awhBiasParams; /**< AWH bias parameters.*/ - gmx_int64_t seed; /**< Random seed.*/ + int64_t seed; /**< Random seed.*/ int nstOut; /**< Output step interval.*/ int nstSampleCoord; /**< Number of samples per coordinate sample (also used for PMF) */ int numSamplesUpdateFreeEnergy; /**< Number of samples per free energy update. */ diff --git a/src/gromacs/mdtypes/commrec.h b/src/gromacs/mdtypes/commrec.h index 1003ca2dfd..768cc78237 100644 --- a/src/gromacs/mdtypes/commrec.h +++ b/src/gromacs/mdtypes/commrec.h @@ -53,7 +53,7 @@ typedef struct { int *ibuf; /* for ints */ int ibuf_alloc; - gmx_int64_t *libuf; + int64_t *libuf; int libuf_alloc; float *fbuf; /* for floats */ diff --git a/src/gromacs/mdtypes/energyhistory.h b/src/gromacs/mdtypes/energyhistory.h index 910ea36e8d..aca74582fe 100644 --- a/src/gromacs/mdtypes/energyhistory.h +++ b/src/gromacs/mdtypes/energyhistory.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2018, 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. @@ -83,12 +83,12 @@ class delta_h_history_t class energyhistory_t { public: - gmx_int64_t nsteps; //! The number of steps in the history - gmx_int64_t nsum; //! Nr. of steps in the ener_ave and ener_sum + int64_t nsteps; //! The number of steps in the history + int64_t nsum; //! Nr. of steps in the ener_ave and ener_sum std::vector ener_ave; //! Energy terms difference^2 sum to get fluctuations std::vector ener_sum; //! Energy terms sum - gmx_int64_t nsteps_sim; //! The number of steps in ener_sum_sim - gmx_int64_t nsum_sim; //! The number of frames in ener_sum_sim + int64_t nsteps_sim; //! The number of steps in ener_sum_sim + int64_t nsum_sim; //! The number of frames in ener_sum_sim std::vector ener_sum_sim; //! Energy term history sum of the whole sim //! History for energy difference for foreign lambdas (useful for BAR) diff --git a/src/gromacs/mdtypes/inputrec.h b/src/gromacs/mdtypes/inputrec.h index 1362a6220e..7fb5da5914 100644 --- a/src/gromacs/mdtypes/inputrec.h +++ b/src/gromacs/mdtypes/inputrec.h @@ -340,11 +340,11 @@ struct t_inputrec //! Integration method int eI; //! Number of steps to be taken - gmx_int64_t nsteps; + int64_t nsteps; //! Used in checkpointing to separate chunks int simulation_part; //! Start at a stepcount >0 (used w. convert-tpr) - gmx_int64_t init_step; + int64_t init_step; //! Frequency of energy calc. and T/P coupl. upd. int nstcalcenergy; //! Group or verlet cutoffs @@ -518,7 +518,7 @@ struct t_inputrec //! Friction coefficient for BD (amu/ps) real bd_fric; //! Random seed for SD and BD - gmx_int64_t ld_seed; + int64_t ld_seed; //! The number of walls int nwall; //! The type of walls diff --git a/src/gromacs/options/basicoptions.cpp b/src/gromacs/options/basicoptions.cpp index 98b4f7ac8e..6d92b1fef6 100644 --- a/src/gromacs/options/basicoptions.cpp +++ b/src/gromacs/options/basicoptions.cpp @@ -222,14 +222,14 @@ IntegerOption::createStorage(const OptionManagerContainer & /*managers*/) const * Int64OptionStorage */ -std::string Int64OptionStorage::formatSingleValue(const gmx_int64_t &value) const +std::string Int64OptionStorage::formatSingleValue(const int64_t &value) const { return toString(value); } void Int64OptionStorage::initConverter(ConverterType *converter) { - converter->addConverter(&fromStdString); + converter->addConverter(&fromStdString); } /******************************************************************** diff --git a/src/gromacs/options/basicoptions.h b/src/gromacs/options/basicoptions.h index 9b96025ad3..89a10d9d64 100644 --- a/src/gromacs/options/basicoptions.h +++ b/src/gromacs/options/basicoptions.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, 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. @@ -163,7 +163,7 @@ class IntegerOption : public OptionTemplate * * \inpublicapi */ -class Int64Option : public OptionTemplate +class Int64Option : public OptionTemplate { public: //! OptionInfo subclass corresponding to this option type. diff --git a/src/gromacs/options/basicoptionstorage.h b/src/gromacs/options/basicoptionstorage.h index f3e4be1fac..4b41bc8e4c 100644 --- a/src/gromacs/options/basicoptionstorage.h +++ b/src/gromacs/options/basicoptionstorage.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, 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. @@ -112,7 +112,7 @@ class IntegerOptionStorage : public OptionStorageTemplateSimple /*! \internal \brief * Converts, validates, and stores integer values. */ -class Int64OptionStorage : public OptionStorageTemplateSimple +class Int64OptionStorage : public OptionStorageTemplateSimple { public: //! \copydoc BooleanOptionStorage::BooleanOptionStorage() @@ -123,7 +123,7 @@ class Int64OptionStorage : public OptionStorageTemplateSimple virtual OptionInfo &optionInfo() { return info_; } virtual std::string typeString() const { return "int"; } - virtual std::string formatSingleValue(const gmx_int64_t &value) const; + virtual std::string formatSingleValue(const int64_t &value) const; private: virtual void initConverter(ConverterType *converter); diff --git a/src/gromacs/pulling/pull.cpp b/src/gromacs/pulling/pull.cpp index 8e75ad2d1c..9ab7626302 100644 --- a/src/gromacs/pulling/pull.cpp +++ b/src/gromacs/pulling/pull.cpp @@ -277,7 +277,7 @@ static void pull_print_f(FILE *out, const pull_t *pull, double t) fprintf(out, "\n"); } -void pull_print_output(struct pull_t *pull, gmx_int64_t step, double time) +void pull_print_output(struct pull_t *pull, int64_t step, double time) { GMX_ASSERT(pull->numExternalPotentialsStillToBeAppliedThisStep == 0, "pull_print_output called before all external pull potentials have been applied"); @@ -1875,7 +1875,7 @@ void dd_make_local_pull_groups(const t_commrec *cr, struct pull_t *pull) * if they needed to participate up to 20 decompositions ago. * This avoids frequent rebuilds due to atoms jumping back and forth. */ - const gmx_int64_t history_count = 20; + const int64_t history_count = 20; gmx_bool bWillParticipate; int count[2]; diff --git a/src/gromacs/pulling/pull.h b/src/gromacs/pulling/pull.h index b7274afa3f..2e73cc93d0 100644 --- a/src/gromacs/pulling/pull.h +++ b/src/gromacs/pulling/pull.h @@ -266,7 +266,7 @@ void finish_pull(struct pull_t *pull); * \param step Time step number. * \param time Time. */ -void pull_print_output(struct pull_t *pull, gmx_int64_t step, double time); +void pull_print_output(struct pull_t *pull, int64_t step, double time); /*! \brief Calculates centers of mass all pull groups. diff --git a/src/gromacs/pulling/pull_internal.h b/src/gromacs/pulling/pull_internal.h index 08d4d2e000..b3bbac1449 100644 --- a/src/gromacs/pulling/pull_internal.h +++ b/src/gromacs/pulling/pull_internal.h @@ -187,8 +187,8 @@ typedef struct { int nparticipate; /* The number of ranks participating */ bool isMasterRank; /* Tells whether our rank is the master rank and thus should add the pull virial */ - gmx_int64_t setup_count; /* The number of decomposition calls */ - gmx_int64_t must_count; /* The last count our rank needed to be part */ + int64_t setup_count; /* The number of decomposition calls */ + int64_t must_count; /* The last count our rank needed to be part */ rvec *rbuf; /* COM calculation buffer */ dvec *dbuf; /* COM calculation buffer */ diff --git a/src/gromacs/pulling/pull_rotation.cpp b/src/gromacs/pulling/pull_rotation.cpp index 5a88067829..1febabd34b 100644 --- a/src/gromacs/pulling/pull_rotation.cpp +++ b/src/gromacs/pulling/pull_rotation.cpp @@ -424,20 +424,20 @@ static real get_fitangle(const gmx_enfrotgrp *erg) /* Reduce potential angle fit data for this group at this time step? */ -static inline gmx_bool bPotAngle(const gmx_enfrot *er, const t_rotgrp *rotg, gmx_int64_t step) +static inline gmx_bool bPotAngle(const gmx_enfrot *er, const t_rotgrp *rotg, int64_t step) { return ( (erotgFitPOT == rotg->eFittype) && (do_per_step(step, er->nstsout) || do_per_step(step, er->nstrout)) ); } /* Reduce slab torqe data for this group at this time step? */ -static inline gmx_bool bSlabTau(const gmx_enfrot *er, const t_rotgrp *rotg, gmx_int64_t step) +static inline gmx_bool bSlabTau(const gmx_enfrot *er, const t_rotgrp *rotg, int64_t step) { return ( (ISFLEX(rotg)) && do_per_step(step, er->nstsout) ); } /* Output rotation energy, torques, etc. for each rotation group */ static void reduce_output(const t_commrec *cr, - gmx_enfrot *er, real t, gmx_int64_t step) + gmx_enfrot *er, real t, int64_t step) { int i, islab, nslabs = 0; int count; /* MPI element counter */ @@ -590,7 +590,7 @@ static void reduce_output(const t_commrec *cr, /* Add the forces from enforced rotation potential to the local forces. * Should be called after the SR forces have been evaluated */ real add_rot_forces(gmx_enfrot *er, - rvec f[], const t_commrec *cr, gmx_int64_t step, real t) + rvec f[], const t_commrec *cr, int64_t step, real t) { real Vrot = 0.0; /* If more than one rotation group is present, Vrot assembles the local parts from all groups */ @@ -3808,7 +3808,7 @@ void do_rotation(const t_commrec *cr, matrix box, rvec x[], real t, - gmx_int64_t step, + int64_t step, gmx_bool bNS) { gmx_bool outstep_slab, outstep_rot; diff --git a/src/gromacs/pulling/pull_rotation.h b/src/gromacs/pulling/pull_rotation.h index c78aba1748..8fd933ec89 100644 --- a/src/gromacs/pulling/pull_rotation.h +++ b/src/gromacs/pulling/pull_rotation.h @@ -145,7 +145,7 @@ void do_rotation(const t_commrec *cr, matrix box, rvec x[], real t, - gmx_int64_t step, + int64_t step, gmx_bool bNS); @@ -167,7 +167,7 @@ void do_rotation(const t_commrec *cr, * \returns The potential energy of the rotation potentials. */ real add_rot_forces(gmx_enfrot *er, - rvec f[], const t_commrec *cr, gmx_int64_t step, real t); + rvec f[], const t_commrec *cr, int64_t step, real t); #endif diff --git a/src/gromacs/random/seed.cpp b/src/gromacs/random/seed.cpp index 8609324ec8..2b5c855cc8 100644 --- a/src/gromacs/random/seed.cpp +++ b/src/gromacs/random/seed.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2018, 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,19 +42,19 @@ namespace gmx { -gmx_uint64_t +uint64_t makeRandomSeed() { std::random_device rd; - gmx_uint64_t result; + uint64_t result; std::size_t deviceBits = std::numeric_limits::digits; - std::size_t resultBits = std::numeric_limits::digits; + std::size_t resultBits = std::numeric_limits::digits; - result = static_cast(rd()); + result = static_cast(rd()); for (std::size_t bits = deviceBits; bits < resultBits; bits += deviceBits) { - result = (result << deviceBits) | static_cast(rd()); + result = (result << deviceBits) | static_cast(rd()); } return result; diff --git a/src/gromacs/random/seed.h b/src/gromacs/random/seed.h index d6a7e27237..75facdf5dc 100644 --- a/src/gromacs/random/seed.h +++ b/src/gromacs/random/seed.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018, 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. @@ -62,7 +62,7 @@ namespace gmx * * \return 64-bit unsigned integer with random bits. */ -gmx_uint64_t +uint64_t makeRandomSeed(); /*! \brief Random device diff --git a/src/gromacs/random/tabulatednormaldistribution.h b/src/gromacs/random/tabulatednormaldistribution.h index 52f064ff5a..1ed166d761 100644 --- a/src/gromacs/random/tabulatednormaldistribution.h +++ b/src/gromacs/random/tabulatednormaldistribution.h @@ -325,7 +325,7 @@ class TabulatedNormalDistribution // also avoids drawing multiple 32-bit random numbers // even if we just call this routine for a single // result. - savedRandomBits_ = static_cast(g()); + savedRandomBits_ = static_cast(g()); savedRandomBitsLeft_ = std::numeric_limits::digits; } result_type value = c_table_[savedRandomBits_ & ( (1ULL << tableBits) - 1 ) ]; @@ -362,7 +362,7 @@ class TabulatedNormalDistribution /*! \brief Array with tabluated values of normal distribution */ static const std::array c_table_; /*! \brief Saved output from random engine, shifted tableBits right each time */ - gmx_uint64_t savedRandomBits_; + uint64_t savedRandomBits_; /*! \brief Number of valid bits remaining i savedRandomBits_ */ unsigned int savedRandomBitsLeft_; diff --git a/src/gromacs/random/tests/seed.cpp b/src/gromacs/random/tests/seed.cpp index 3189728e76..ac2cb0697c 100644 --- a/src/gromacs/random/tests/seed.cpp +++ b/src/gromacs/random/tests/seed.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2018, 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. @@ -60,8 +60,8 @@ TEST(SeedTest, makeRandomSeed) // if you execute the unit tests once per second you might have to run them // an extra time rougly once per 300 billion years - apologies in advance! - gmx_uint64_t i0 = makeRandomSeed(); - gmx_uint64_t i1 = makeRandomSeed(); + uint64_t i0 = makeRandomSeed(); + uint64_t i1 = makeRandomSeed(); EXPECT_NE(i0, i1); } diff --git a/src/gromacs/random/tests/threefry.cpp b/src/gromacs/random/tests/threefry.cpp index 2984a5cc64..0930892b39 100644 --- a/src/gromacs/random/tests/threefry.cpp +++ b/src/gromacs/random/tests/threefry.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2018, 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. @@ -55,7 +55,7 @@ namespace gmx namespace { -class ThreeFry2x64Test : public ::testing::TestWithParam > +class ThreeFry2x64Test : public ::testing::TestWithParam > { }; @@ -63,8 +63,8 @@ TEST_P(ThreeFry2x64Test, Default) { gmx::test::TestReferenceData data; gmx::test::TestReferenceChecker checker(data.rootChecker()); - const std::vector input = GetParam(); - std::vector result; + const std::vector input = GetParam(); + std::vector result; gmx::ThreeFry2x64<0> rng(input[2], input[3]); rng.restart(input[0], input[1]); @@ -79,8 +79,8 @@ TEST_P(ThreeFry2x64Test, Fast) { gmx::test::TestReferenceData data; gmx::test::TestReferenceChecker checker(data.rootChecker()); - const std::vector input = GetParam(); - std::vector result; + const std::vector input = GetParam(); + std::vector result; gmx::ThreeFry2x64Fast<0> rng(input[2], input[3]); rng.restart(input[0], input[1]); @@ -95,8 +95,8 @@ TEST_P(ThreeFry2x64Test, Using40Rounds) { gmx::test::TestReferenceData data; gmx::test::TestReferenceChecker checker(data.rootChecker()); - const std::vector input = GetParam(); - std::vector result; + const std::vector input = GetParam(); + std::vector result; gmx::ThreeFry2x64General<40, 0> rng(input[2], input[3]); rng.restart(input[0], input[1]); @@ -114,9 +114,9 @@ TEST_P(ThreeFry2x64Test, Using40Rounds) * The 2x64 flavors of ThreeFry64 will use the first four values, while * the 4x64 version uses all eight. */ -const std::vector bitsZero {{ - 0, 0, 0, 0 - }}; +const std::vector bitsZero {{ + 0, 0, 0, 0 + }}; /*! \brief Constant array of integers with all bits set to one. @@ -125,10 +125,10 @@ const std::vector bitsZero {{ * The 2x64 flavors of ThreeFry64 will use the first four values, while * the 4x64 version uses all eight. */ -const std::vector bitsOne {{ - 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, - 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL - }}; +const std::vector bitsOne {{ + 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, + 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL + }}; /*! \brief Constant array of integers with bitpattern from Pi. * @@ -136,10 +136,10 @@ const std::vector bitsOne {{ * The 2x64 flavors of ThreeFry64 will use the first four values, while * the 4x64 version uses all eight. */ -const std::vector bitsPi {{ - 0x243f6a8885a308d3ULL, 0x13198a2e03707344ULL, - 0xa4093822299f31d0ULL, 0x082efa98ec4e6c89ULL - }}; +const std::vector bitsPi {{ + 0x243f6a8885a308d3ULL, 0x13198a2e03707344ULL, + 0xa4093822299f31d0ULL, 0x082efa98ec4e6c89ULL + }}; // Test the known ansers for the ThreeFry random function when the argument // is (1) all zero, (2) all ones, (3) the bits of pi, for a bunch of different flavors of ThreeFry. @@ -172,7 +172,7 @@ TEST_F(ThreeFry2x64Test, InternalCounterSequence) // 66 bits of internal counter means the first four increments (giving 2*4=8 results) // correspond to incrementing word 0, and then we should carry over to word 1. gmx::ThreeFry2x64<66> rngA(123456, gmx::RandomDomain::Other); - std::vector result; + std::vector result; for (int i = 0; i < 16; i++) { diff --git a/src/gromacs/random/threefry.h b/src/gromacs/random/threefry.h index c290f4641a..9dd2a2c4ac 100644 --- a/src/gromacs/random/threefry.h +++ b/src/gromacs/random/threefry.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018, 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. @@ -338,7 +338,7 @@ class ThreeFry2x64General // result_type must be lower case to be compatible with C++11 standard library /*! \brief Integer type for output. */ - typedef gmx_uint64_t result_type; + typedef uint64_t result_type; /*! \brief Use array for counter & key states so it is allocated on the stack */ typedef std::array counter_type; @@ -457,7 +457,7 @@ class ThreeFry2x64General * \throws InternalError if the high bits needed to encode the number of counter * bits are nonzero. */ - ThreeFry2x64General(gmx_uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) + ThreeFry2x64General(uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) { seed(key0, domain); } @@ -475,7 +475,7 @@ class ThreeFry2x64General * \throws InternalError if the high bits needed to encode the number of counter * bits are nonzero. To test arbitrary values, use 0 internal counter bits. */ - ThreeFry2x64General(gmx_uint64_t key0, gmx_uint64_t key1) + ThreeFry2x64General(uint64_t key0, uint64_t key1) { seed(key0, key1); } @@ -500,9 +500,9 @@ class ThreeFry2x64General * when using e.g. a random device, we just ignore them. */ void - seed(gmx_uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) + seed(uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) { - seed(key0, static_cast(domain)); + seed(key0, static_cast(domain)); } /*! \brief Seed random engine from 2x64-bit unsigned integers @@ -519,7 +519,7 @@ class ThreeFry2x64General * bits are nonzero. To test arbitrary values, use 0 internal counter bits. */ void - seed(gmx_uint64_t key0, gmx_uint64_t key1) + seed(uint64_t key0, uint64_t key1) { const unsigned int internalCounterBitsBits = (internalCounterBits > 0) ? ( StaticLog2::value + 1 ) : 0; @@ -548,7 +548,7 @@ class ThreeFry2x64General * reserved bits is to the last template parameter to the class. */ void - restart(gmx_uint64_t ctr0 = 0, gmx_uint64_t ctr1 = 0) + restart(uint64_t ctr0 = 0, uint64_t ctr1 = 0) { counter_ = {{ctr0, ctr1}}; @@ -592,7 +592,7 @@ class ThreeFry2x64General * \throws InternalError if the internal counter space is exhausted. */ void - discard(gmx_uint64_t n) + discard(uint64_t n) { index_ += n % c_resultsPerCounter_; n /= c_resultsPerCounter_; @@ -696,7 +696,7 @@ class ThreeFry2x64 : public ThreeFry2x64General<20, internalCounterBits> * \throws InternalError if the high bits needed to encode the number of counter * bits are nonzero. */ - ThreeFry2x64(gmx_uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) : ThreeFry2x64General<20, internalCounterBits>(key0, domain) {} + ThreeFry2x64(uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) : ThreeFry2x64General<20, internalCounterBits>(key0, domain) {} /*! \brief Construct random engine from 2x64-bit unsigned integers, 20 rounds * @@ -711,7 +711,7 @@ class ThreeFry2x64 : public ThreeFry2x64General<20, internalCounterBits> * \throws InternalError if the high bits needed to encode the number of counter * bits are nonzero. To test arbitrary values, use 0 internal counter bits. */ - ThreeFry2x64(gmx_uint64_t key0, gmx_uint64_t key1) : ThreeFry2x64General<20, internalCounterBits>(key0, key1) {} + ThreeFry2x64(uint64_t key0, uint64_t key1) : ThreeFry2x64General<20, internalCounterBits>(key0, key1) {} }; /*! \brief ThreeFry2x64 random engine with 13 iteractions. @@ -744,7 +744,7 @@ class ThreeFry2x64Fast : public ThreeFry2x64General<13, internalCounterBits> * \throws InternalError if the high bits needed to encode the number of counter * bits are nonzero. */ - ThreeFry2x64Fast(gmx_uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) : ThreeFry2x64General<13, internalCounterBits>(key0, domain) {} + ThreeFry2x64Fast(uint64_t key0 = 0, RandomDomain domain = RandomDomain::Other) : ThreeFry2x64General<13, internalCounterBits>(key0, domain) {} /*! \brief Construct ThreeFry random engine from 2x64-bit unsigned integers, 13 rounds. * @@ -759,7 +759,7 @@ class ThreeFry2x64Fast : public ThreeFry2x64General<13, internalCounterBits> * \throws InternalError if the high bits needed to encode the number of counter * bits are nonzero. To test arbitrary values, use 0 internal counter bits. */ - ThreeFry2x64Fast(gmx_uint64_t key0, gmx_uint64_t key1) : ThreeFry2x64General<13, internalCounterBits>(key0, key1) {} + ThreeFry2x64Fast(uint64_t key0, uint64_t key1) : ThreeFry2x64General<13, internalCounterBits>(key0, key1) {} }; diff --git a/src/gromacs/random/uniformintdistribution.h b/src/gromacs/random/uniformintdistribution.h index 75925e441c..ff96b3b24b 100644 --- a/src/gromacs/random/uniformintdistribution.h +++ b/src/gromacs/random/uniformintdistribution.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2018, 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. @@ -164,7 +164,7 @@ class UniformIntDistribution result_type operator()(Rng &g, const param_type ¶m) { - static_assert(sizeof(typename Rng::result_type) >= sizeof(gmx_uint32_t), + static_assert(sizeof(typename Rng::result_type) >= sizeof(uint32_t), "The random engine result_type should be 32 or 64 bits"); result_type range = param.b() - param.a(); @@ -181,9 +181,9 @@ class UniformIntDistribution } else { - if (sizeof(result_type) == sizeof(gmx_uint32_t)) + if (sizeof(result_type) == sizeof(uint32_t)) { - rangeBits = log2I(static_cast(range)); + rangeBits = log2I(static_cast(range)); } else { @@ -196,14 +196,14 @@ class UniformIntDistribution { if (savedRandomBitsLeft_ < rangeBits) { - savedRandomBits_ = static_cast(g()); + savedRandomBits_ = static_cast(g()); savedRandomBitsLeft_ = std::numeric_limits::digits; - if (sizeof(typename Rng::result_type) == sizeof(gmx_uint32_t)) + if (sizeof(typename Rng::result_type) == sizeof(uint32_t)) { - savedRandomBits_ <<= std::numeric_limits::digits; + savedRandomBits_ <<= std::numeric_limits::digits; savedRandomBits_ |= g(); - savedRandomBitsLeft_ += std::numeric_limits::digits; + savedRandomBitsLeft_ += std::numeric_limits::digits; } } result = savedRandomBits_; @@ -255,7 +255,7 @@ class UniformIntDistribution /*! \brief Internal value for parameters, can be overridden at generation time. */ param_type param_; /*! \brief Saved output from random engine, shifted tableBits right each time */ - gmx_uint64_t savedRandomBits_; + uint64_t savedRandomBits_; /*! \brief Number of valid bits remaining i savedRandomBits_ */ unsigned int savedRandomBitsLeft_; diff --git a/src/gromacs/random/uniformrealdistribution.h b/src/gromacs/random/uniformrealdistribution.h index 0243a48265..f4a740a10c 100644 --- a/src/gromacs/random/uniformrealdistribution.h +++ b/src/gromacs/random/uniformrealdistribution.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2018, 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. @@ -105,17 +105,17 @@ RealType generateCanonical(Rng &g) { // No point in using more bits than fit in RealType - const gmx_uint64_t digits = std::numeric_limits::digits; - const gmx_uint64_t realBits = std::min(digits, static_cast(Bits)); - const gmx_uint64_t range = Rng::max() - Rng::min() + gmx_uint64_t(1); - gmx_uint64_t log2R = (range == 0) ? std::numeric_limits::digits : log2I(range); - gmx_uint64_t k = realBits / log2R + (realBits % log2R != 0) + (realBits == 0); + const uint64_t digits = std::numeric_limits::digits; + const uint64_t realBits = std::min(digits, static_cast(Bits)); + const uint64_t range = Rng::max() - Rng::min() + uint64_t(1); + uint64_t log2R = (range == 0) ? std::numeric_limits::digits : log2I(range); + uint64_t k = realBits / log2R + (realBits % log2R != 0) + (realBits == 0); RealType r = Rng::max() - Rng::min() + RealType(1); RealType s = g() - Rng::min(); RealType base = r; RealType result; - for (gmx_uint64_t i = 1; i < k; ++i) + for (uint64_t i = 1; i < k; ++i) { s += RealType(g()-Rng::min()) * base; base *= r; diff --git a/src/gromacs/selection/tests/nbsearch.cpp b/src/gromacs/selection/tests/nbsearch.cpp index 105a3a5725..4e0c86802d 100644 --- a/src/gromacs/selection/tests/nbsearch.cpp +++ b/src/gromacs/selection/tests/nbsearch.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -120,7 +120,7 @@ class NeighborhoodSearchTestData typedef std::vector TestPositionList; - NeighborhoodSearchTestData(gmx_uint64_t seed, real cutoff); + NeighborhoodSearchTestData(uint64_t seed, real cutoff); gmx::AnalysisNeighborhoodPositions refPositions() const { @@ -150,7 +150,7 @@ class NeighborhoodSearchTestData testPositions_.emplace_back(x); } gmx::RVec generateRandomPosition(); - std::vector generateIndex(int count, gmx_uint64_t seed) const; + std::vector generateIndex(int count, uint64_t seed) const; void generateRandomRefPositions(int count); void generateRandomTestPositions(int count); void useRefPositionsAsTestPositions(); @@ -203,7 +203,7 @@ class NeighborhoodSearchTestData //! Shorthand for a collection of reference pairs. typedef std::vector RefPairList; -NeighborhoodSearchTestData::NeighborhoodSearchTestData(gmx_uint64_t seed, real cutoff) +NeighborhoodSearchTestData::NeighborhoodSearchTestData(uint64_t seed, real cutoff) : rng_(seed), cutoff_(cutoff), refPosCount_(0) { clear_mat(box_); @@ -225,7 +225,7 @@ gmx::RVec NeighborhoodSearchTestData::generateRandomPosition() return x; } -std::vector NeighborhoodSearchTestData::generateIndex(int count, gmx_uint64_t seed) const +std::vector NeighborhoodSearchTestData::generateIndex(int count, uint64_t seed) const { gmx::DefaultRandomEngine rngIndex(seed); gmx::UniformRealDistribution dist; @@ -427,7 +427,7 @@ class NeighborhoodSearchTest : public ::testing::Test const NeighborhoodSearchTestData &data); void testPairSearchIndexed(gmx::AnalysisNeighborhood *nb, const NeighborhoodSearchTestData &data, - gmx_uint64_t seed); + uint64_t seed); void testPairSearchFull(gmx::AnalysisNeighborhoodSearch *search, const NeighborhoodSearchTestData &data, const gmx::AnalysisNeighborhoodPositions &pos, @@ -534,7 +534,7 @@ void NeighborhoodSearchTest::testPairSearch( void NeighborhoodSearchTest::testPairSearchIndexed( gmx::AnalysisNeighborhood *nb, const NeighborhoodSearchTestData &data, - gmx_uint64_t seed) + uint64_t seed) { std::vector refIndices(data.generateIndex(data.refPos_.size(), seed++)); std::vector testIndices(data.generateIndex(data.testPositions_.size(), seed++)); diff --git a/src/gromacs/swap/swapcoords.cpp b/src/gromacs/swap/swapcoords.cpp index e761747b52..bb1d941749 100644 --- a/src/gromacs/swap/swapcoords.cpp +++ b/src/gromacs/swap/swapcoords.cpp @@ -553,7 +553,7 @@ static void detect_flux_per_channel( t_swapcoords *sc, real cyl0_r2, real cyl1_r2, - gmx_int64_t step, + int64_t step, gmx_bool bRerun, FILE *fpout) { @@ -680,7 +680,7 @@ static void sortMoleculesIntoCompartments( t_commrec *cr, t_swapcoords *sc, const matrix box, - gmx_int64_t step, + int64_t step, FILE *fpout, gmx_bool bRerun, gmx_bool bIsSolvent) @@ -744,7 +744,7 @@ static void sortMoleculesIntoCompartments( { fprintf(stderr, "\n" "%s Warning: %d atoms were detected as being in both channels! Probably your split\n" - "%s cylinder is way too large, or one compartment has collapsed (step %" GMX_PRId64 ")\n", + "%s cylinder is way too large, or one compartment has collapsed (step %" PRId64 ")\n", SwS, g->nCylBoth, SwS, step); fprintf(s->fpout, "Warning: %d atoms were assigned to both channels!\n", g->nCylBoth); @@ -1927,7 +1927,7 @@ static void apply_modified_positions( gmx_bool do_swapcoords( t_commrec *cr, - gmx_int64_t step, + int64_t step, double t, t_inputrec *ir, gmx_wallcycle *wcycle, @@ -2081,7 +2081,7 @@ gmx_bool do_swapcoords( if (nswaps && bVerbose) { - fprintf(stderr, "%s Performed %d swap%s in step %" GMX_PRId64 " for iontype %s.\n", + fprintf(stderr, "%s Performed %d swap%s in step %" PRId64 " for iontype %s.\n", SwS, nswaps, nswaps > 1 ? "s" : "", step, g->molname); } } diff --git a/src/gromacs/swap/swapcoords.h b/src/gromacs/swap/swapcoords.h index d6945fc20d..736b5f193f 100644 --- a/src/gromacs/swap/swapcoords.h +++ b/src/gromacs/swap/swapcoords.h @@ -128,7 +128,7 @@ void finish_swapcoords(t_swapcoords *sc); */ gmx_bool do_swapcoords( t_commrec *cr, - gmx_int64_t step, + int64_t step, double t, t_inputrec *ir, gmx_wallcycle *wcycle, diff --git a/src/gromacs/timing/wallcycle.cpp b/src/gromacs/timing/wallcycle.cpp index 60be3c87fb..765cfdda10 100644 --- a/src/gromacs/timing/wallcycle.cpp +++ b/src/gromacs/timing/wallcycle.cpp @@ -91,7 +91,7 @@ struct gmx_wallcycle #endif int ewc_prev; gmx_cycles_t cycle_prev; - gmx_int64_t reset_counters; + int64_t reset_counters; #if GMX_MPI MPI_Comm mpi_comm_mygroup; #endif @@ -1076,7 +1076,7 @@ void wallcycle_print(FILE *fplog, const gmx::MDLogger &mdlog, int nnodes, int np } } -extern gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc) +extern int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc) { if (wc == nullptr) { @@ -1086,7 +1086,7 @@ extern gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc) return wc->reset_counters; } -extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_counters) +extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, int64_t reset_counters) { if (wc == nullptr) { diff --git a/src/gromacs/timing/wallcycle.h b/src/gromacs/timing/wallcycle.h index 33291cdf4d..90b55fed2e 100644 --- a/src/gromacs/timing/wallcycle.h +++ b/src/gromacs/timing/wallcycle.h @@ -107,10 +107,10 @@ void wallcycle_reset_all(gmx_wallcycle_t wc); void wallcycle_scale_by_num_threads(gmx_wallcycle_t wc, bool isPmeRank, int nthreads_pp, int nthreads_pme); /* Scale the cycle counts to reflect how many threads run for that number of cycles */ -gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc); +int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc); /* Return reset_counters from wc struct */ -void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_counters); +void wcycle_set_reset_counters(gmx_wallcycle_t wc, int64_t reset_counters); /* Set reset_counters */ void wallcycle_sub_start(gmx_wallcycle_t wc, int ewcs); diff --git a/src/gromacs/timing/walltime_accounting.cpp b/src/gromacs/timing/walltime_accounting.cpp index 874f28ef6c..b3b071ba55 100644 --- a/src/gromacs/timing/walltime_accounting.cpp +++ b/src/gromacs/timing/walltime_accounting.cpp @@ -85,7 +85,7 @@ typedef struct gmx_walltime_accounting { * with respect to parallelism implementation. */ int numOpenMPThreads; //! Set by integrators to report the amount of work they did - gmx_int64_t nsteps_done; + int64_t nsteps_done; //! Whether the simulation has finished in a way valid for walltime reporting. bool isValidFinish; } t_gmx_walltime_accounting; @@ -182,7 +182,7 @@ walltime_accounting_get_start_time_stamp(gmx_walltime_accounting_t walltime_acco return walltime_accounting->start_time_stamp; } -gmx_int64_t +int64_t walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accounting) { return walltime_accounting->nsteps_done; @@ -190,7 +190,7 @@ walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accountin void walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t walltime_accounting, - gmx_int64_t nsteps_done) + int64_t nsteps_done) { walltime_accounting->nsteps_done = nsteps_done; } diff --git a/src/gromacs/timing/walltime_accounting.h b/src/gromacs/timing/walltime_accounting.h index 196ba3fd98..a7b72f86f1 100644 --- a/src/gromacs/timing/walltime_accounting.h +++ b/src/gromacs/timing/walltime_accounting.h @@ -92,7 +92,7 @@ double walltime_accounting_get_start_time_stamp(gmx_walltime_accounting_t walltime_accounting); //! Get the number of integration steps done -gmx_int64_t +int64_t walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accounting); /*! \brief Set the number of integration steps done @@ -100,7 +100,7 @@ walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accountin * 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); + int64_t nsteps_done); //! Record that the simulation finished in a way valid for reporting walltime. void diff --git a/src/gromacs/tools/convert_tpr.cpp b/src/gromacs/tools/convert_tpr.cpp index 4dd517ecd2..62c0bbaa7b 100644 --- a/src/gromacs/tools/convert_tpr.cpp +++ b/src/gromacs/tools/convert_tpr.cpp @@ -338,7 +338,7 @@ int gmx_convert_tpr(int argc, char *argv[]) const char *top_fn; int i; - gmx_int64_t nsteps_req, run_step; + int64_t nsteps_req, run_step; double run_t, state_t; gmx_bool bSel; gmx_bool bNsteps, bExtend, bUntil; @@ -379,7 +379,7 @@ int gmx_convert_tpr(int argc, char *argv[]) return 0; } - /* Convert int to gmx_int64_t */ + /* Convert int to int64_t */ nsteps_req = nsteps_req_int; bNsteps = opt2parg_bSet("-nsteps", asize(pa), pa); bExtend = opt2parg_bSet("-extend", asize(pa), pa); @@ -404,7 +404,7 @@ int gmx_convert_tpr(int argc, char *argv[]) /* Determine total number of steps remaining */ if (bExtend) { - ir->nsteps = ir->nsteps - (run_step - ir->init_step) + (gmx_int64_t)(extend_t/ir->delta_t + 0.5); + ir->nsteps = ir->nsteps - (run_step - ir->init_step) + (int64_t)(extend_t/ir->delta_t + 0.5); printf("Extending remaining runtime of by %g ps (now %s steps)\n", extend_t, gmx_step_str(ir->nsteps, buf)); } @@ -414,7 +414,7 @@ int gmx_convert_tpr(int argc, char *argv[]) gmx_step_str(ir->nsteps, buf), gmx_step_str(run_step, buf2), run_t, until_t); - ir->nsteps = (gmx_int64_t)((until_t - run_t)/ir->delta_t + 0.5); + ir->nsteps = (int64_t)((until_t - run_t)/ir->delta_t + 0.5); printf("Extending remaining runtime until %g ps (now %s steps)\n", until_t, gmx_step_str(ir->nsteps, buf)); } @@ -468,7 +468,7 @@ int gmx_convert_tpr(int argc, char *argv[]) } state_t = ir->init_t + ir->init_step*ir->delta_t; - sprintf(buf, "Writing statusfile with starting step %s%s and length %s%s steps...\n", "%10", GMX_PRId64, "%10", GMX_PRId64); + sprintf(buf, "Writing statusfile with starting step %s%s and length %s%s steps...\n", "%10", PRId64, "%10", PRId64); fprintf(stderr, buf, ir->init_step, ir->nsteps); fprintf(stderr, " time %10.3f and length %10.3f ps\n", state_t, ir->nsteps*ir->delta_t); diff --git a/src/gromacs/tools/dump.cpp b/src/gromacs/tools/dump.cpp index fcfc808365..546807b7c0 100644 --- a/src/gromacs/tools/dump.cpp +++ b/src/gromacs/tools/dump.cpp @@ -241,7 +241,7 @@ static void list_trr(const char *fn) indent = 0; indent = pr_title(stdout, indent, buf); pr_indent(stdout, indent); - fprintf(stdout, "natoms=%10d step=%10" GMX_PRId64 " time=%12.7e lambda=%10g\n", + fprintf(stdout, "natoms=%10d step=%10" PRId64 " time=%12.7e lambda=%10g\n", trrheader.natoms, trrheader.step, trrheader.t, trrheader.lambda); if (trrheader.box_size) { @@ -287,7 +287,7 @@ static void list_xtc(const char *fn) rvec *x; matrix box; int nframe, natoms; - gmx_int64_t step; + int64_t step; real prec, time; gmx_bool bOK; @@ -301,7 +301,7 @@ static void list_xtc(const char *fn) indent = 0; indent = pr_title(stdout, indent, buf); pr_indent(stdout, indent); - fprintf(stdout, "natoms=%10d step=%10" GMX_PRId64 " time=%12.7e prec=%10g\n", + fprintf(stdout, "natoms=%10d step=%10" PRId64 " time=%12.7e prec=%10g\n", natoms, step, time, prec); pr_rvecs(stdout, indent, "box", box, DIM); pr_rvecs(stdout, indent, "x", x, natoms); @@ -320,12 +320,12 @@ static void list_xtc(const char *fn) static void list_tng_inner(const char *fn, gmx_bool bFirstFrame, real *values, - gmx_int64_t step, + int64_t step, double frame_time, - gmx_int64_t n_values_per_frame, - gmx_int64_t n_atoms, + int64_t n_values_per_frame, + int64_t n_atoms, real prec, - gmx_int64_t nframe, + int64_t nframe, char *block_name) { char buf[256]; @@ -333,11 +333,11 @@ static void list_tng_inner(const char *fn, if (bFirstFrame) { - sprintf(buf, "%s frame %" GMX_PRId64, fn, nframe); + sprintf(buf, "%s frame %" PRId64, fn, nframe); indent = 0; indent = pr_title(stdout, indent, buf); pr_indent(stdout, indent); - fprintf(stdout, "natoms=%10" GMX_PRId64 " step=%10" GMX_PRId64 " time=%12.7e", + fprintf(stdout, "natoms=%10" PRId64 " step=%10" PRId64 " time=%12.7e", n_atoms, step, frame_time); if (prec > 0) { @@ -352,8 +352,8 @@ static void list_tng(const char gmx_unused *fn) { #ifdef GMX_USE_TNG gmx_tng_trajectory_t tng; - gmx_int64_t nframe = 0; - gmx_int64_t i, *block_ids = nullptr, step, ndatablocks; + int64_t nframe = 0; + int64_t i, *block_ids = nullptr, step, ndatablocks; gmx_bool bOK; real *values = nullptr; @@ -371,7 +371,7 @@ static void list_tng(const char gmx_unused *fn) { double frame_time; real prec; - gmx_int64_t n_values_per_frame, n_atoms; + int64_t n_values_per_frame, n_atoms; char block_name[STRLEN]; gmx_get_tng_data_next_frame_of_block_type(tng, block_ids[i], &values, diff --git a/src/gromacs/trajectory/energyframe.cpp b/src/gromacs/trajectory/energyframe.cpp index 39cab13583..ba76ee0a81 100644 --- a/src/gromacs/trajectory/energyframe.cpp +++ b/src/gromacs/trajectory/energyframe.cpp @@ -70,7 +70,7 @@ EnergyFrame::EnergyFrame(const t_enxframe &enxframe, std::string EnergyFrame::frameName() const { - return formatString("Time %f Step %" GMX_PRId64, time_, step_); + return formatString("Time %f Step %" PRId64, time_, step_); } const real &EnergyFrame::at(const std::string &name) const diff --git a/src/gromacs/trajectory/energyframe.h b/src/gromacs/trajectory/energyframe.h index 90d9eab538..bd23f0e90d 100644 --- a/src/gromacs/trajectory/energyframe.h +++ b/src/gromacs/trajectory/energyframe.h @@ -59,8 +59,8 @@ struct t_energy struct t_enxframe { double t; /* Timestamp of this frame */ - gmx_int64_t step; /* MD step */ - gmx_int64_t nsteps; /* The number of steps between frames */ + int64_t step; /* MD step */ + int64_t nsteps; /* The number of steps between frames */ double dt; /* The MD time step */ int nsum; /* The number of terms for the sums in ener */ int nre; /* Number of energies */ diff --git a/src/gromacs/trajectory/trajectoryframe.cpp b/src/gromacs/trajectory/trajectoryframe.cpp index 68500a628b..5c752d89d1 100644 --- a/src/gromacs/trajectory/trajectoryframe.cpp +++ b/src/gromacs/trajectory/trajectoryframe.cpp @@ -136,7 +136,7 @@ TrajectoryFrame::TrajectoryFrame(const t_trxframe &frame) std::string TrajectoryFrame::frameName() const { - return formatString("Time %f Step %" GMX_PRId64, frame_.time, frame_.step); + return formatString("Time %f Step %" PRId64, frame_.time, frame_.step); } std::int64_t TrajectoryFrame::step() const diff --git a/src/gromacs/trajectory/trajectoryframe.h b/src/gromacs/trajectory/trajectoryframe.h index 965785ade3..03fd6c8653 100644 --- a/src/gromacs/trajectory/trajectoryframe.h +++ b/src/gromacs/trajectory/trajectoryframe.h @@ -59,7 +59,7 @@ typedef struct t_trxframe gmx_bool bDouble; /* Double precision? */ int natoms; /* number of atoms (atoms, x, v, f, index) */ gmx_bool bStep; - gmx_int64_t step; /* MD step number */ + int64_t step; /* MD step number */ gmx_bool bTime; real time; /* time of the frame */ gmx_bool bLambda; diff --git a/src/gromacs/utility.h b/src/gromacs/utility.h index 7497206def..4651e0812b 100644 --- a/src/gromacs/utility.h +++ b/src/gromacs/utility.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, 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. @@ -106,10 +106,9 @@ *

Implementation helpers

* * The header basedefinitions.h contains common definitions and macros used - * throughout \Gromacs. It includes fixed-width integer types (`gmx_int64_t` - * and friends), `gmx_bool` for C code, some macros for compiler-specific - * attributes, and ::GMX_UNUSED_VALUE and ::GMX_IGNORE_RETURN_VALUE for - * handling warnings about unused values. + * throughout \Gromacs. It includes `gmx_bool` for C code, some macros for + * compiler-specific attributes, and ::GMX_UNUSED_VALUE and ::GMX_IGNORE_RETURN_VALUE + * for handling warnings about unused values. * * The header classhelpers.h implements a gmx::PrivateImplPointer template for easily * writing classes that use the private implementation idiom. This header also diff --git a/src/gromacs/utility/basedefinitions.h b/src/gromacs/utility/basedefinitions.h index e1e944084d..802b0e02b9 100644 --- a/src/gromacs/utility/basedefinitions.h +++ b/src/gromacs/utility/basedefinitions.h @@ -45,11 +45,9 @@ #define GMX_UTILITY_BASEDEFINITIONS_H #include -#ifndef _MSC_VER -#include -#endif #if defined __cplusplus +#include #include #else #include @@ -80,60 +78,6 @@ using index = std::ptrdiff_t; } #endif -/*! \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 2015 still doesn't support the format strings.) - */ -/*! \{ */ -typedef int32_t gmx_int32_t; -typedef int64_t gmx_int64_t; -typedef uint32_t gmx_uint32_t; -typedef uint64_t gmx_uint64_t; - -#ifdef _MSC_VER -#define GMX_PRId32 "I32d" -#define GMX_SCNd32 "I32d" - -#define GMX_PRId64 "I64d" -#define GMX_SCNd64 "I64d" - -#define GMX_PRIu32 "I32u" -#define GMX_SCNu32 "I32u" - -#define GMX_PRIu64 "I64u" -#define GMX_SCNu64 "I64u" -#else -#define GMX_PRId32 PRId32 -#define GMX_SCNd32 SCNd32 - -#define GMX_PRId64 PRId64 -#define GMX_SCNd64 SCNd64 - -#define GMX_PRIu32 PRIu32 -#define GMX_SCNu32 SCNu32 - -#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 -/*! \} */ - /* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict. * Any other compiler can be added here. */ /*! \brief diff --git a/src/gromacs/utility/bitmask.h b/src/gromacs/utility/bitmask.h index 8db76e5933..d5eb82894f 100644 --- a/src/gromacs/utility/bitmask.h +++ b/src/gromacs/utility/bitmask.h @@ -61,9 +61,9 @@ #if BITMASK_SIZE <= 64 || defined DOXYGEN #if BITMASK_SIZE == 32 -typedef gmx_uint32_t gmx_bitmask_t; +typedef uint32_t gmx_bitmask_t; #else -typedef gmx_uint64_t gmx_bitmask_t; /**< bitmask type */ +typedef uint64_t gmx_bitmask_t; /**< bitmask type */ #endif /*! \brief Initialize all bits to 0 */ @@ -121,7 +121,7 @@ inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b) } #else #define BITMASK_ALEN (BITMASK_SIZE/64) -typedef gmx_uint64_t gmx_bitmask_t[BITMASK_ALEN]; +typedef uint64_t gmx_bitmask_t[BITMASK_ALEN]; inline static void bitmask_clear(gmx_bitmask_t* m) { @@ -130,25 +130,25 @@ inline static void bitmask_clear(gmx_bitmask_t* m) inline static void bitmask_set_bit(gmx_bitmask_t* m, int b) { - (*m)[b/64] |= ((gmx_uint64_t)1 << (b%64)); + (*m)[b/64] |= ((uint64_t)1 << (b%64)); } inline static void bitmask_init_bit(gmx_bitmask_t* m, int b) { bitmask_clear(m); - (*m)[b/64] = ((gmx_uint64_t)1 << (b%64)); + (*m)[b/64] = ((uint64_t)1 << (b%64)); } inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b) { memset(*m, 255, b/64*8); - (*m)[b/64] = ((gmx_uint64_t)1 << (b%64)) - 1; + (*m)[b/64] = ((uint64_t)1 << (b%64)) - 1; memset(&(*m)[b/64+1], 0, (BITMASK_ALEN-b/64-1)*8); } inline static bool bitmask_is_set(gmx_bitmask_t m, int b) { - return (m[b/64] & ((gmx_uint64_t)1 << (b%64))) != 0; + return (m[b/64] & ((uint64_t)1 << (b%64))) != 0; } inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b) diff --git a/src/gromacs/utility/compare.cpp b/src/gromacs/utility/compare.cpp index d6f357d25e..94f86355a0 100644 --- a/src/gromacs/utility/compare.cpp +++ b/src/gromacs/utility/compare.cpp @@ -61,14 +61,14 @@ void cmp_int(FILE *fp, const char *s, int index, int i1, int i2) } } -void cmp_int64(FILE *fp, const char *s, gmx_int64_t i1, gmx_int64_t i2) +void cmp_int64(FILE *fp, const char *s, int64_t i1, int64_t i2) { if (i1 != i2) { fprintf(fp, "%s (", s); - fprintf(fp, "%" GMX_PRId64, i1); + fprintf(fp, "%" PRId64, i1); fprintf(fp, " - "); - fprintf(fp, "%" GMX_PRId64, i2); + fprintf(fp, "%" PRId64, i2); fprintf(fp, ")\n"); } } diff --git a/src/gromacs/utility/compare.h b/src/gromacs/utility/compare.h index e322d2042f..610cfc366c 100644 --- a/src/gromacs/utility/compare.h +++ b/src/gromacs/utility/compare.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -60,7 +60,7 @@ gmx_bool equal_double(double i1, double i2, real ftol, real abstol); void cmp_int(FILE *fp, const char *s, int index, int i1, int i2); //! Compares two 64-bit integers and prints differences. -void cmp_int64(FILE *fp, const char *s, gmx_int64_t i1, gmx_int64_t i2); +void cmp_int64(FILE *fp, const char *s, int64_t i1, int64_t i2); //! Compares two unsigned short values and prints differences. void cmp_us(FILE *fp, const char *s, int index, unsigned short i1, unsigned short i2); diff --git a/src/gromacs/utility/cstringutil.cpp b/src/gromacs/utility/cstringutil.cpp index 764a7711dd..c403994a3b 100644 --- a/src/gromacs/utility/cstringutil.cpp +++ b/src/gromacs/utility/cstringutil.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018, 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. @@ -504,7 +504,7 @@ char *wrap_lines(const char *buf, int line_width, int indent, gmx_bool bIndentFi return b2; } -gmx_int64_t +int64_t str_to_int64_t(const char *str, char **endptr) { #ifndef _MSC_VER @@ -514,8 +514,8 @@ str_to_int64_t(const char *str, char **endptr) #endif } -char *gmx_step_str(gmx_int64_t i, char *buf) +char *gmx_step_str(int64_t i, char *buf) { - sprintf(buf, "%" GMX_PRId64, i); + sprintf(buf, "%" PRId64, i); return buf; } diff --git a/src/gromacs/utility/cstringutil.h b/src/gromacs/utility/cstringutil.h index a27a0ba353..5bad461395 100644 --- a/src/gromacs/utility/cstringutil.h +++ b/src/gromacs/utility/cstringutil.h @@ -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,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2017,2018, 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. @@ -167,24 +167,24 @@ char *wrap_lines(const char *buf, int line_width, int indent, gmx_bool bIndentFirst); /*! \brief - * Convert a string to gmx_int64_t. + * Convert a string to int64_t. * * This method works as the standard library function strtol(), except that it * does not support different bases. */ -gmx_int64_t str_to_int64_t(const char *str, char **endptr); +int64_t str_to_int64_t(const char *str, char **endptr); /** Minimum size of buffer to pass to gmx_step_str(). */ #define STEPSTRSIZE 22 /*! \brief - * Prints a gmx_int64_t value in buf and returns the pointer to buf. + * Prints a int64_t value in buf and returns the pointer to buf. * * buf should be large enough to contain i: STEPSTRSIZE (22) chars. - * When multiple gmx_int64_t values are printed in the same printf call, + * When multiple int64_t values are printed in the same printf call, * be sure to call gmx_step_str with different buffers. */ -char *gmx_step_str(gmx_int64_t i, char *buf); +char *gmx_step_str(int64_t i, char *buf); #ifdef __cplusplus } diff --git a/src/gromacs/utility/futil.h b/src/gromacs/utility/futil.h index d854165433..d67be901ad 100644 --- a/src/gromacs/utility/futil.h +++ b/src/gromacs/utility/futil.h @@ -63,7 +63,7 @@ #endif /** \Gromacs definition to use instead of `off_t`. */ -typedef gmx_int64_t gmx_off_t; +typedef int64_t gmx_off_t; /*! \brief * Turn off buffering for output files (which is default) for debugging diff --git a/src/gromacs/utility/inmemoryserializer.cpp b/src/gromacs/utility/inmemoryserializer.cpp index 0c55e484d3..451a167ef8 100644 --- a/src/gromacs/utility/inmemoryserializer.cpp +++ b/src/gromacs/utility/inmemoryserializer.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018, 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. @@ -128,7 +128,7 @@ void InMemorySerializer::doInt(int *value) impl_->doValue(*value); } -void InMemorySerializer::doInt64(gmx_int64_t *value) +void InMemorySerializer::doInt64(int64_t *value) { impl_->doValue(*value); } @@ -202,7 +202,7 @@ void InMemoryDeserializer::doInt(int *value) impl_->doValue(value); } -void InMemoryDeserializer::doInt64(gmx_int64_t *value) +void InMemoryDeserializer::doInt64(int64_t *value) { impl_->doValue(value); } diff --git a/src/gromacs/utility/inmemoryserializer.h b/src/gromacs/utility/inmemoryserializer.h index 1b96f1f8e0..934c2f938a 100644 --- a/src/gromacs/utility/inmemoryserializer.h +++ b/src/gromacs/utility/inmemoryserializer.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018, 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. @@ -64,7 +64,7 @@ class InMemorySerializer : public ISerializer virtual void doBool(bool *value); virtual void doUChar(unsigned char *value); virtual void doInt(int *value); - virtual void doInt64(gmx_int64_t *value); + virtual void doInt64(int64_t *value); virtual void doFloat(float *value); virtual void doDouble(double *value); virtual void doString(std::string *value); @@ -86,7 +86,7 @@ class InMemoryDeserializer : public ISerializer virtual void doBool(bool *value); virtual void doUChar(unsigned char *value); virtual void doInt(int *value); - virtual void doInt64(gmx_int64_t *value); + virtual void doInt64(int64_t *value); virtual void doFloat(float *value); virtual void doDouble(double *value); virtual void doString(std::string *value); diff --git a/src/gromacs/utility/int64_to_int.cpp b/src/gromacs/utility/int64_to_int.cpp index 8f4c8c8ee3..c781b7a85c 100644 --- a/src/gromacs/utility/int64_to_int.cpp +++ b/src/gromacs/utility/int64_to_int.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2017, by the GROMACS development team, led by + * Copyright (c) 2015,2017,2018, 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,17 +40,17 @@ #include "gromacs/utility/basedefinitions.h" -int gmx_int64_to_int(gmx_int64_t step, const char *warn) +int int64_to_int(int64_t step, const char *warn) { int i; i = static_cast(step); - if (warn != nullptr && (static_cast(i) != step)) + if (warn != nullptr && (static_cast(i) != step)) { fprintf(stderr, "\nWARNING during %s:\n", warn); fprintf(stderr, "int64 value "); - fprintf(stderr, "%" GMX_PRId64, step); + fprintf(stderr, "%" PRId64, step); fprintf(stderr, " does not fit in int, converted to %d\n\n", i); } diff --git a/src/gromacs/utility/int64_to_int.h b/src/gromacs/utility/int64_to_int.h index facd6ad9b0..7c4c7d8e97 100644 --- a/src/gromacs/utility/int64_to_int.h +++ b/src/gromacs/utility/int64_to_int.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015, by the GROMACS development team, led by + * Copyright (c) 2015,2018, 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. @@ -46,7 +46,7 @@ #include "gromacs/utility/futil.h" -/*! \brief Convert a gmx_int64_t value to int. +/*! \brief Convert a int64_t value to int. * * \param[in] step The step number (or other int64) * \param[in] warn If warn!=NULL a warning message will be written @@ -55,6 +55,6 @@ * "WARNING during %s:", where warn is printed in %s. * \return the truncated step number. */ -int gmx_int64_to_int(gmx_int64_t step, const char *warn); +int int64_to_int(int64_t step, const char *warn); #endif diff --git a/src/gromacs/utility/iserializer.h b/src/gromacs/utility/iserializer.h index 70d7973511..7f1b9ef9fe 100644 --- a/src/gromacs/utility/iserializer.h +++ b/src/gromacs/utility/iserializer.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018, 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. @@ -70,7 +70,7 @@ class ISerializer virtual void doBool(bool *value) = 0; virtual void doUChar(unsigned char *value) = 0; virtual void doInt(int *value) = 0; - virtual void doInt64(gmx_int64_t *value) = 0; + virtual void doInt64(int64_t *value) = 0; virtual void doFloat(float *value) = 0; virtual void doDouble(double *value) = 0; virtual void doString(std::string *value) = 0; diff --git a/src/gromacs/utility/keyvaluetree.cpp b/src/gromacs/utility/keyvaluetree.cpp index 039e73dcb5..d0e3c6b7aa 100644 --- a/src/gromacs/utility/keyvaluetree.cpp +++ b/src/gromacs/utility/keyvaluetree.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018, 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. @@ -243,9 +243,9 @@ class CompareHelper { return value1.cast() == value2.cast(); } - else if (value1.isType()) + else if (value1.isType()) { - return value1.cast() == value2.cast(); + return value1.cast() == value2.cast(); } else if (value1.isType()) { diff --git a/src/gromacs/utility/keyvaluetreeserializer.cpp b/src/gromacs/utility/keyvaluetreeserializer.cpp index 958cfce52b..2462857a2c 100644 --- a/src/gromacs/utility/keyvaluetreeserializer.cpp +++ b/src/gromacs/utility/keyvaluetreeserializer.cpp @@ -183,17 +183,17 @@ struct SerializationTraits }; template <> -struct SerializationTraits +struct SerializationTraits { - static void serialize(gmx_int64_t value, ISerializer *serializer) + static void serialize(int64_t value, ISerializer *serializer) { serializer->doInt64(&value); } static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer) { - gmx_int64_t value; + int64_t value; serializer->doInt64(&value); - builder->setValue(value); + builder->setValue(value); } }; @@ -253,7 +253,7 @@ void ValueSerializer::initSerializers() SERIALIZER('s', std::string), SERIALIZER('b', bool), SERIALIZER('i', int), - SERIALIZER('l', gmx_int64_t), + SERIALIZER('l', int64_t), SERIALIZER('f', float), SERIALIZER('d', double), }; diff --git a/src/gromacs/utility/smalloc.cpp b/src/gromacs/utility/smalloc.cpp index ca77fdd992..97f3d0a6c1 100644 --- a/src/gromacs/utility/smalloc.cpp +++ b/src/gromacs/utility/smalloc.cpp @@ -77,9 +77,9 @@ void *save_malloc(const char *name, const char *file, int line, size_t size) if ((p = malloc(size)) == nullptr) { gmx_fatal(errno, __FILE__, __LINE__, - "Not enough memory. Failed to malloc %" GMX_PRId64 " bytes for %s\n" + "Not enough memory. Failed to malloc %" PRId64 " bytes for %s\n" "(called from file %s, line %d)", - (gmx_int64_t)size, name, file, line); + (int64_t)size, name, file, line); } (void) memset(p, 0, size); } @@ -112,10 +112,10 @@ void *save_calloc(const char *name, const char *file, int line, if ((p = malloc((size_t)nelem*(size_t)elsize)) == NULL) { gmx_fatal(errno, __FILE__, __LINE__, - "Not enough memory. Failed to calloc %" GMX_PRId64 - " elements of size %" GMX_PRId64 + "Not enough memory. Failed to calloc %" PRId64 + " elements of size %" PRId64 " for %s\n(called from file %s, line %d)", - (gmx_int64_t)nelem, (gmx_int64_t)elsize, + (int64_t)nelem, (int64_t)elsize, name, file, line); } memset(p, 0, (size_t) (nelem * elsize)); @@ -123,10 +123,10 @@ void *save_calloc(const char *name, const char *file, int line, if ((p = calloc((size_t)nelem, (size_t)elsize)) == nullptr) { gmx_fatal(errno, __FILE__, __LINE__, - "Not enough memory. Failed to calloc %" GMX_PRId64 - " elements of size %" GMX_PRId64 + "Not enough memory. Failed to calloc %" PRId64 + " elements of size %" PRId64 " for %s\n(called from file %s, line %d)", - (gmx_int64_t)nelem, (gmx_int64_t)elsize, name, file, line); + (int64_t)nelem, (int64_t)elsize, name, file, line); } #endif } @@ -165,9 +165,9 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr, if (p == nullptr) { gmx_fatal(errno, __FILE__, __LINE__, - "Not enough memory. Failed to realloc %" GMX_PRId64 " bytes for %s, %s=%x\n" + "Not enough memory. Failed to realloc %" PRId64 " bytes for %s, %s=%x\n" "(called from file %s, line %d)", - (gmx_int64_t)size, name, name, ptr, file, line); + (int64_t)size, name, name, ptr, file, line); } } return p; diff --git a/src/gromacs/utility/strconvert.cpp b/src/gromacs/utility/strconvert.cpp index f85fcd32b5..c59dd01100 100644 --- a/src/gromacs/utility/strconvert.cpp +++ b/src/gromacs/utility/strconvert.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016, by the GROMACS development team, led by + * Copyright (c) 2016,2018, 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. @@ -94,11 +94,11 @@ int intFromString(const char *str) return value; } -gmx_int64_t int64FromString(const char *str) +int64_t int64FromString(const char *str) { errno = 0; char *endptr; - const gmx_int64_t value = str_to_int64_t(str, &endptr); + const int64_t value = str_to_int64_t(str, &endptr); if (errno == ERANGE) { GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str) diff --git a/src/gromacs/utility/strconvert.h b/src/gromacs/utility/strconvert.h index 4b6f13c913..875830eb79 100644 --- a/src/gromacs/utility/strconvert.h +++ b/src/gromacs/utility/strconvert.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018, 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. @@ -77,7 +77,7 @@ int intFromString(const char *str); * * Also checks for overflow. */ -gmx_int64_t int64FromString(const char *str); +int64_t int64FromString(const char *str); /*! \brief * Parses a float value from a string. * @@ -128,7 +128,7 @@ template <> inline int fromString(const char *str) { return intFromString(str); } //! Implementation for 64-bit integer values. template <> inline -gmx_int64_t fromString(const char *str) { return int64FromString(str); } +int64_t fromString(const char *str) { return int64FromString(str); } //! Implementation for float values. template <> inline float fromString(const char *str) { return floatFromString(str); } @@ -155,9 +155,9 @@ static inline std::string intToString(int t) return formatString("%d", t); } //! \copydoc intToString(int) -static inline std::string int64ToString(gmx_int64_t t) +static inline std::string int64ToString(int64_t t) { - return formatString("%" GMX_PRId64, t); + return formatString("%" PRId64, t); } //! \copydoc intToString(int) static inline std::string doubleToString(double t) @@ -173,7 +173,7 @@ static inline std::string doubleToString(double t) */ static inline std::string toString(bool t) { return boolToString(t); } static inline std::string toString(int t) { return intToString(t); } -static inline std::string toString(gmx_int64_t t) { return int64ToString(t); } +static inline std::string toString(int64_t t) { return int64ToString(t); } static inline std::string toString(float t) { return doubleToString(t); } static inline std::string toString(double t) { return doubleToString(t); } static inline std::string toString(std::string t) { return t; } diff --git a/src/gromacs/utility/tests/arrayref.cpp b/src/gromacs/utility/tests/arrayref.cpp index 3b4c07d4cd..f6f98fcabc 100644 --- a/src/gromacs/utility/tests/arrayref.cpp +++ b/src/gromacs/utility/tests/arrayref.cpp @@ -83,8 +83,8 @@ typedef ::testing::Types< ArrayRef, ArrayRef, ArrayRef, - ArrayRef, - ArrayRef, + ArrayRef, + ArrayRef, ArrayRef, ArrayRef, ArrayRef, @@ -93,8 +93,8 @@ typedef ::testing::Types< ArrayRef, ArrayRef, ArrayRef, - ArrayRef, - ArrayRef, + ArrayRef, + ArrayRef, ArrayRef, ArrayRef > ArrayRefTypes; diff --git a/src/gromacs/utility/tests/keyvaluetreeserializer.cpp b/src/gromacs/utility/tests/keyvaluetreeserializer.cpp index ac893f71d3..bd35bb952d 100644 --- a/src/gromacs/utility/tests/keyvaluetreeserializer.cpp +++ b/src/gromacs/utility/tests/keyvaluetreeserializer.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018, 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. @@ -70,7 +70,7 @@ class RefDataSerializer : public gmx::ISerializer { checker_.checkInteger(*value, nullptr); } - virtual void doInt64(gmx_int64_t *value) + virtual void doInt64(int64_t *value) { checker_.checkInt64(*value, nullptr); } diff --git a/src/gromacs/utility/txtdump.cpp b/src/gromacs/utility/txtdump.cpp index f2aa96d535..ef1989752b 100644 --- a/src/gromacs/utility/txtdump.cpp +++ b/src/gromacs/utility/txtdump.cpp @@ -164,7 +164,7 @@ void pr_int(FILE *fp, int indent, const char *title, int i) fprintf(fp, "%-30s = %d\n", title, i); } -void pr_int64(FILE *fp, int indent, const char *title, gmx_int64_t i) +void pr_int64(FILE *fp, int indent, const char *title, int64_t i) { char buf[STEPSTRSIZE]; diff --git a/src/gromacs/utility/txtdump.h b/src/gromacs/utility/txtdump.h index b3eb61c955..f9975aa6c3 100644 --- a/src/gromacs/utility/txtdump.h +++ b/src/gromacs/utility/txtdump.h @@ -76,8 +76,8 @@ void pr_doubles(FILE *fp, int indent, const char *title, const double *vec, int void pr_reals_of_dim(FILE *fp, int indent, const char *title, const real *vec, int n, int dim); //! Prints an integer value. void pr_int(FILE *fp, int indent, const char *title, int i); -//! Prints a gmx_int64_t value. -void pr_int64(FILE *fp, int indent, const char *title, gmx_int64_t i); +//! Prints a int64_t value. +void pr_int64(FILE *fp, int indent, const char *title, int64_t i); //! Prints a floating-point value. void pr_real(FILE *fp, int indent, const char *title, real r); //! Prints a double-precision floating-point value. diff --git a/src/gromacs/utility/variant.cpp b/src/gromacs/utility/variant.cpp index b5601af207..05c3ff59d8 100644 --- a/src/gromacs/utility/variant.cpp +++ b/src/gromacs/utility/variant.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017, by the GROMACS development team, led by + * Copyright (c) 2017,2018, 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. @@ -72,9 +72,9 @@ std::string simpleValueToString(const Variant &value) { return toString(value.cast()); } - else if (value.isType()) + else if (value.isType()) { - return toString(value.cast()); + return toString(value.cast()); } else if (value.isType()) { diff --git a/src/testutils/refdata.cpp b/src/testutils/refdata.cpp index 2d80f779f7..8cdd31cb35 100644 --- a/src/testutils/refdata.cpp +++ b/src/testutils/refdata.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, 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. @@ -900,16 +900,16 @@ void TestReferenceChecker::checkInteger(int value, const char *id) ExactStringChecker(formatString("%d", value)))); } -void TestReferenceChecker::checkInt64(gmx_int64_t value, const char *id) +void TestReferenceChecker::checkInt64(int64_t value, const char *id) { EXPECT_PLAIN(impl_->processItem(Impl::cInt64NodeName, id, - ExactStringChecker(formatString("%" GMX_PRId64, value)))); + ExactStringChecker(formatString("%" PRId64, value)))); } -void TestReferenceChecker::checkUInt64(gmx_uint64_t value, const char *id) +void TestReferenceChecker::checkUInt64(uint64_t value, const char *id) { EXPECT_PLAIN(impl_->processItem(Impl::cUInt64NodeName, id, - ExactStringChecker(formatString("%" GMX_PRIu64, value)))); + ExactStringChecker(formatString("%" PRIu64, value)))); } void TestReferenceChecker::checkDouble(double value, const char *id) @@ -982,9 +982,9 @@ void TestReferenceChecker::checkVariant(const Variant &variant, const char *id) { checkInteger(variant.cast(), id); } - else if (variant.isType()) + else if (variant.isType()) { - checkInt64(variant.cast(), id); + checkInt64(variant.cast(), id); } else if (variant.isType()) { @@ -1069,15 +1069,15 @@ int TestReferenceChecker::readInteger(const char *id) } -gmx_int64_t TestReferenceChecker::readInt64(const char *id) +int64_t TestReferenceChecker::readInt64(const char *id) { if (impl_->shouldIgnore()) { GMX_THROW(TestException("Trying to read from non-existent reference data value")); } - gmx_int64_t value = 0; + int64_t value = 0; EXPECT_PLAIN(impl_->processItem(Impl::cInt64NodeName, id, - ValueExtractor(&value))); + ValueExtractor(&value))); return value; } diff --git a/src/testutils/refdata.h b/src/testutils/refdata.h index acf44b5ea5..fb4dd712a1 100644 --- a/src/testutils/refdata.h +++ b/src/testutils/refdata.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, 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. @@ -353,9 +353,9 @@ class TestReferenceChecker //! Check a single integer value. void checkInteger(int value, const char *id); //! Check a single int64 value. - void checkInt64(gmx_int64_t value, const char *id); + void checkInt64(int64_t value, const char *id); //! Check a single uint64 value. - void checkUInt64(gmx_uint64_t value, const char *id); + void checkUInt64(uint64_t value, const char *id); //! Check a single single-precision floating point value. void checkFloat(float value, const char *id); //! Check a single double-precision floating point value. @@ -395,7 +395,7 @@ class TestReferenceChecker //! Reads an integer value. int readInteger(const char *id); //! Reads a 64-bit integer value. - gmx_int64_t readInt64(const char *id); + int64_t readInt64(const char *id); //! Reads a float value. float readFloat(const char *id); //! Reads a double value. @@ -434,12 +434,12 @@ class TestReferenceChecker checkInteger(value, id); } //! Check a single integer value. - void checkValue(gmx_int64_t value, const char *id) + void checkValue(int64_t value, const char *id) { checkInt64(value, id); } //! Check a single integer value. - void checkValue(gmx_uint64_t value, const char *id) + void checkValue(uint64_t value, const char *id) { checkUInt64(value, id); } diff --git a/src/testutils/testasserts.cpp b/src/testutils/testasserts.cpp index fe77b048a6..1d8be9cd7d 100644 --- a/src/testutils/testasserts.cpp +++ b/src/testutils/testasserts.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2018, 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. @@ -141,8 +141,8 @@ floatingPointToBiasedInteger(const FloatingPoint &value) * treating also values of different sign. */ template -gmx_uint64_t calculateUlpDifference(const FloatingPoint &value1, - const FloatingPoint &value2) +uint64_t calculateUlpDifference(const FloatingPoint &value1, + const FloatingPoint &value2) { typename FloatingPoint::Bits biased1 = floatingPointToBiasedInteger(value1); @@ -156,7 +156,7 @@ gmx_uint64_t calculateUlpDifference(const FloatingPoint &value1, */ template void initDifference(FloatType raw1, FloatType raw2, double *absoluteDifference, - gmx_uint64_t *ulpDifference, bool *bSignDifference) + uint64_t *ulpDifference, bool *bSignDifference) { FloatingPoint value1(raw1); FloatingPoint value2(raw2); @@ -177,7 +177,7 @@ void initDifference(FloatType raw1, FloatType raw2, double *absoluteDifference, * Converts a relative tolerance into an ULP difference. */ template -gmx_uint64_t relativeToleranceToUlp(FloatType tolerance) +uint64_t relativeToleranceToUlp(FloatType tolerance) { FloatingPoint m(1.0); FloatingPoint t(1.0 + tolerance); @@ -235,7 +235,7 @@ std::string FloatingPointDifference::toString() const relDiffStr = formatString("Inf"); } - return formatString("%g (%" GMX_PRIu64 " %s-prec. ULPs, rel. %s)%s", + return formatString("%g (%" PRIu64 " %s-prec. ULPs, rel. %s)%s", absoluteDifference_, ulpDifference_, isDouble() ? "double" : "single", relDiffStr.c_str(), @@ -277,9 +277,9 @@ bool FloatingPointTolerance::isWithin( return true; } - const gmx_uint64_t ulpTolerance + const uint64_t ulpTolerance = difference.isDouble() ? doubleUlpTolerance_ : singleUlpTolerance_; - if (ulpTolerance < GMX_UINT64_MAX && difference.asUlps() <= ulpTolerance) + if (ulpTolerance < UINT64_MAX && difference.asUlps() <= ulpTolerance) { return true; } @@ -294,7 +294,7 @@ std::string FloatingPointTolerance::toString(const FloatingPointDifference &diff = difference.isDouble() ? doubleAbsoluteTolerance_ : singleAbsoluteTolerance_; const double relativeTolerance = difference.isDouble() ? doubleRelativeTolerance_ : singleRelativeTolerance_; - const gmx_uint64_t ulpTolerance + const uint64_t ulpTolerance = difference.isDouble() ? doubleUlpTolerance_ : singleUlpTolerance_; if (absoluteTolerance > 0.0) @@ -309,13 +309,13 @@ std::string FloatingPointTolerance::toString(const FloatingPointDifference &diff } result.append(formatString("rel. %.3g", relativeTolerance)); } - if (ulpTolerance < GMX_UINT64_MAX) + if (ulpTolerance < UINT64_MAX) { if (!result.empty()) { result.append(", "); } - result.append(formatString("%" GMX_PRIu64 " ULPs", ulpTolerance)); + result.append(formatString("%" PRIu64 " ULPs", ulpTolerance)); } if (bSignMustMatch_) { @@ -336,7 +336,7 @@ relativeToleranceAsFloatingPoint(double magnitude, double tolerance) const double absoluteTolerance = std::abs(magnitude) * tolerance; return FloatingPointTolerance(absoluteTolerance, absoluteTolerance, tolerance, tolerance, - GMX_UINT64_MAX, GMX_UINT64_MAX, + UINT64_MAX, UINT64_MAX, false); } //! \endcond diff --git a/src/testutils/testasserts.h b/src/testutils/testasserts.h index 93fc616d66..2add34ba13 100644 --- a/src/testutils/testasserts.h +++ b/src/testutils/testasserts.h @@ -249,7 +249,7 @@ class FloatingPointDifference * constructor used to initialize the difference. * The ULP difference between 0.0 and -0.0 is zero. */ - gmx_uint64_t asUlps() const { return ulpDifference_; } + uint64_t asUlps() const { return ulpDifference_; } /*! \brief * Whether the compared values were of different sign. * @@ -273,7 +273,7 @@ class FloatingPointDifference double termMagnitude_; //! Stores the absolute difference, or NaN if one or both values were NaN. double absoluteDifference_; - gmx_uint64_t ulpDifference_; + uint64_t ulpDifference_; bool bSignDifference_; /*! \brief * Whether the difference was computed for single or double precision. @@ -302,7 +302,7 @@ class FloatingPointDifference * - _ULP tolerance_: ULP (units of least precision) difference between the * values must be smaller than the given tolerance for the check to pass. * Setting the ULP tolerance to zero requires exact match. - * Setting the ULP tolerance to GMX_UINT64_MAX disables the ULP check. + * Setting the ULP tolerance to UINT64_MAX disables the ULP check. * `0.0` and `-0.0` are treated as equal for the ULP check. * - _sign check_: if set, any values that are of different signs fail the * check (note that this also applies to `0.0` and `-0.0`: a value with a @@ -356,8 +356,8 @@ class FloatingPointTolerance double doubleAbsoluteTolerance, float singleRelativeTolerance, double doubleRelativeTolerance, - gmx_uint64_t singleUlpTolerance, - gmx_uint64_t doubleUlpTolerance, + uint64_t singleUlpTolerance, + uint64_t doubleUlpTolerance, bool bSignMustMatch) : singleAbsoluteTolerance_(singleAbsoluteTolerance), doubleAbsoluteTolerance_(doubleAbsoluteTolerance), @@ -384,8 +384,8 @@ class FloatingPointTolerance double doubleAbsoluteTolerance_; float singleRelativeTolerance_; double doubleRelativeTolerance_; - gmx_uint64_t singleUlpTolerance_; - gmx_uint64_t doubleUlpTolerance_; + uint64_t singleUlpTolerance_; + uint64_t doubleUlpTolerance_; bool bSignMustMatch_; }; @@ -398,7 +398,7 @@ class FloatingPointTolerance * \related FloatingPointTolerance */ static inline FloatingPointTolerance -ulpTolerance(gmx_uint64_t ulpDiff) +ulpTolerance(uint64_t ulpDiff) { return FloatingPointTolerance(0.0, 0.0, 0.0, 0.0, ulpDiff, ulpDiff, false); } @@ -443,8 +443,8 @@ FloatingPointTolerance */ static inline FloatingPointTolerance relativeToleranceAsPrecisionDependentUlp(double magnitude, - gmx_uint64_t singleUlpDiff, - gmx_uint64_t doubleUlpDiff) + uint64_t singleUlpDiff, + uint64_t doubleUlpDiff) { return FloatingPointTolerance(magnitude*singleUlpDiff*GMX_FLOAT_EPS, magnitude*doubleUlpDiff*GMX_DOUBLE_EPS, @@ -461,7 +461,7 @@ static inline FloatingPointTolerance absoluteTolerance(double tolerance) { return FloatingPointTolerance(tolerance, tolerance, 0.0, 0.0, - GMX_UINT64_MAX, GMX_UINT64_MAX, false); + UINT64_MAX, UINT64_MAX, false); } /*! \brief @@ -481,7 +481,7 @@ absoluteTolerance(double tolerance) * \related FloatingPointTolerance */ static inline FloatingPointTolerance -relativeToleranceAsUlp(double magnitude, gmx_uint64_t ulpDiff) +relativeToleranceAsUlp(double magnitude, uint64_t ulpDiff) { return relativeToleranceAsPrecisionDependentUlp(magnitude, ulpDiff, ulpDiff); } @@ -489,7 +489,7 @@ relativeToleranceAsUlp(double magnitude, gmx_uint64_t ulpDiff) namespace { //! Default tolerance in ULPs for two floating-point values to compare equal. -static gmx_uint64_t g_defaultUlpTolerance = 4; +static uint64_t g_defaultUlpTolerance = 4; } /*! \brief