X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fgmxlib%2Fnrnb.cpp;fp=src%2Fgromacs%2Fgmxlib%2Fnrnb.c;h=33a877a347cefc67954adc7f19019b5bf36e3632;hb=87823c5ebe2ecab05a07cfdfd5165e53cb07c30d;hp=5007d2aab3e5e4e8976d69141233369977528591;hpb=4fb23a1438393a48312088b77f662c30ac7fbf68;p=alexxy%2Fgromacs.git 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 5007d2aab3..33a877a347 100644 --- a/src/gromacs/gmxlib/nrnb.c +++ b/src/gromacs/gmxlib/nrnb.cpp @@ -38,8 +38,10 @@ #include "gromacs/legacyheaders/nrnb.h" -#include -#include +#include +#include + +#include #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; - ndays = dt/(24*3600); + ndays = static_cast(dt/(24*3600)); dt = dt-24*3600*ndays; - nhours = dt/3600; + nhours = static_cast(dt/3600); dt = dt-3600*nhours; - nmins = dt/60; + nmins = static_cast(dt/60); dt = dt-nmins*60; - nsecs = dt; + nsecs = static_cast(dt); 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++) { - 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]; } @@ -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; - unb = max(unb, dperc); - perc = dperc; + unb = std::max(unb, dperc); + perc = static_cast(dperc); fprintf(log, "%3d ", perc); } if (unb > 0) { - perc = 10000.0/unb; + perc = static_cast(10000.0/unb); 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++) { - av->n[j] = av->n[j]/(double)(cr->nnodes - cr->npmenodes); + av->n[j] = av->n[j]/static_cast(cr->nnodes - cr->npmenodes); } 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]; - unb = max(unb, dperc); - perc = dperc; + unb = std::max(unb, dperc); + perc = static_cast(dperc); fprintf(log, "%3d ", perc); } if (unb > 0) { - perc = 10000.0/unb; + perc = static_cast(10000.0/unb); fprintf(log, "%6d%%\n", perc); } else