biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into pygromacs
[alexxy/gromacs.git]
/
src
/
gromacs
/
gmxlib
/
nrnb.cpp
diff --git
a/src/gromacs/gmxlib/nrnb.c
b/src/gromacs/gmxlib/nrnb.cpp
similarity index 96%
rename from
src/gromacs/gmxlib/nrnb.c
rename to
src/gromacs/gmxlib/nrnb.cpp
index 5007d2aab3e5e4e8976d69141233369977528591..33a877a347cefc67954adc7f19019b5bf36e3632 100644
(file)
--- a/
src/gromacs/gmxlib/nrnb.c
+++ b/
src/gromacs/gmxlib/nrnb.cpp
@@
-38,8
+38,10
@@
#include "gromacs/legacyheaders/nrnb.h"
#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"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/legacyheaders/names.h"
@@
-208,13
+210,13
@@
static void pr_difftime(FILE *out, double dt)
int ndays, nhours, nmins, nsecs;
gmx_bool bPrint, bPrinted;
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;
dt = dt-24*3600*ndays;
- nhours =
dt/3600
;
+ nhours =
static_cast<int>(dt/3600)
;
dt = dt-3600*nhours;
dt = dt-3600*nhours;
- nmins =
dt/60
;
+ nmins =
static_cast<int>(dt/60)
;
dt = dt-nmins*60;
dt = dt-nmins*60;
- nsecs =
dt
;
+ nsecs =
static_cast<int>(dt)
;
bPrint = (ndays > 0);
bPrinted = bPrint;
if (bPrint)
bPrint = (ndays > 0);
bPrinted = bPrint;
if (bPrint)
@@
-331,19
+333,19
@@
void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
*nbfs = 0.0;
for (i = 0; (i < eNR_NBKERNEL_ALLVSALLGB); i++)
{
*nbfs = 0.0;
for (i = 0; (i < eNR_NBKERNEL_ALLVSALLGB); i++)
{
- if (strstr(nbdata[i].name, "W3-W3") != NULL)
+ if (st
d::st
rstr(nbdata[i].name, "W3-W3") != NULL)
{
*nbfs += 9e-6*nrnb->n[i];
}
{
*nbfs += 9e-6*nrnb->n[i];
}
- else if (strstr(nbdata[i].name, "W3") != NULL)
+ else if (st
d::st
rstr(nbdata[i].name, "W3") != NULL)
{
*nbfs += 3e-6*nrnb->n[i];
}
{
*nbfs += 3e-6*nrnb->n[i];
}
- else if (strstr(nbdata[i].name, "W4-W4") != NULL)
+ else if (st
d::st
rstr(nbdata[i].name, "W4-W4") != NULL)
{
*nbfs += 10e-6*nrnb->n[i];
}
{
*nbfs += 10e-6*nrnb->n[i];
}
- else if (strstr(nbdata[i].name, "W4") != NULL)
+ else if (st
d::st
rstr(nbdata[i].name, "W4") != NULL)
{
*nbfs += 4e-6*nrnb->n[i];
}
{
*nbfs += 4e-6*nrnb->n[i];
}
@@
-536,13
+538,13
@@
static double pr_av(FILE *log, t_commrec *cr,
for (i = 0; (i < cr->nnodes); i++)
{
dperc = (100.0*ftot[i])/fav;
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)
{
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
fprintf(log, "%6d%%\n\n", perc);
}
else
@@
-585,7
+587,7
@@
void pr_load(FILE *log, t_commrec *cr, t_nrnb nrnb[])
}
for (j = 0; (j < eNRNB); j++)
{
}
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");
}
fprintf(log, "\nDetailed load balancing info in percentage of average\n");
@@
-612,13
+614,13
@@
void pr_load(FILE *log, t_commrec *cr, t_nrnb nrnb[])
for (i = 0; (i < cr->nnodes); i++)
{
dperc = (100.0*nrnb[i].n[j])/av->n[j];
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)
{
fprintf(log, "%3d ", perc);
}
if (unb > 0)
{
- perc =
10000.0/unb
;
+ perc =
static_cast<int>(10000.0/unb)
;
fprintf(log, "%6d%%\n", perc);
}
else
fprintf(log, "%6d%%\n", perc);
}
else