#include "gromacs/legacyheaders/nrnb.h"
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
+
+#include <algorithm>
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/legacyheaders/names.h"
int ndays, nhours, nmins, nsecs;
gmx_bool bPrint, bPrinted;
- ndays = dt/(24*3600);
+ ndays = static_cast<int>(dt/(24*3600));
dt = dt-24*3600*ndays;
- nhours = dt/3600;
+ nhours = static_cast<int>(dt/3600);
dt = dt-3600*nhours;
- nmins = dt/60;
+ nmins = static_cast<int>(dt/60);
dt = dt-nmins*60;
- nsecs = dt;
+ nsecs = static_cast<int>(dt);
bPrint = (ndays > 0);
bPrinted = bPrint;
if (bPrint)
*nbfs = 0.0;
for (i = 0; (i < eNR_NBKERNEL_ALLVSALLGB); i++)
{
- if (strstr(nbdata[i].name, "W3-W3") != NULL)
+ if (std::strstr(nbdata[i].name, "W3-W3") != NULL)
{
*nbfs += 9e-6*nrnb->n[i];
}
- else if (strstr(nbdata[i].name, "W3") != NULL)
+ else if (std::strstr(nbdata[i].name, "W3") != NULL)
{
*nbfs += 3e-6*nrnb->n[i];
}
- else if (strstr(nbdata[i].name, "W4-W4") != NULL)
+ else if (std::strstr(nbdata[i].name, "W4-W4") != NULL)
{
*nbfs += 10e-6*nrnb->n[i];
}
- else if (strstr(nbdata[i].name, "W4") != NULL)
+ else if (std::strstr(nbdata[i].name, "W4") != NULL)
{
*nbfs += 4e-6*nrnb->n[i];
}
for (i = 0; (i < cr->nnodes); i++)
{
dperc = (100.0*ftot[i])/fav;
- unb = max(unb, dperc);
- perc = dperc;
+ unb = std::max(unb, dperc);
+ perc = static_cast<int>(dperc);
fprintf(log, "%3d ", perc);
}
if (unb > 0)
{
- perc = 10000.0/unb;
+ perc = static_cast<int>(10000.0/unb);
fprintf(log, "%6d%%\n\n", perc);
}
else
}
for (j = 0; (j < eNRNB); j++)
{
- av->n[j] = av->n[j]/(double)(cr->nnodes - cr->npmenodes);
+ av->n[j] = av->n[j]/static_cast<double>(cr->nnodes - cr->npmenodes);
}
fprintf(log, "\nDetailed load balancing info in percentage of average\n");
for (i = 0; (i < cr->nnodes); i++)
{
dperc = (100.0*nrnb[i].n[j])/av->n[j];
- unb = max(unb, dperc);
- perc = dperc;
+ unb = std::max(unb, dperc);
+ perc = static_cast<int>(dperc);
fprintf(log, "%3d ", perc);
}
if (unb > 0)
{
- perc = 10000.0/unb;
+ perc = static_cast<int>(10000.0/unb);
fprintf(log, "%6d%%\n", perc);
}
else