Took out vcs_seconds routine. Now relying on clockWC.

This commit is contained in:
Harry Moffat 2008-01-20 23:19:33 +00:00
parent 5461f38c7f
commit d63ad80500
6 changed files with 21 additions and 81 deletions

View file

@ -68,7 +68,7 @@ VCSNONIDEAL_OBJ = vcs_solve_TP.o vcs_VolPhase.o vcs_solve.o vcs_prob.o \
vcs_elem_rearrange.o vcs_MultiPhaseEquil.o \
vcs_nasa_poly.o vcs_nondim.o vcs_Exception.o \
vcs_funcVtot.o vcs_inest.o vcs_rearrange.o \
vcs_root1d.o vcs_rxnadj.o vcs_timer_generic.o \
vcs_root1d.o vcs_rxnadj.o \
vcs_SpeciesProperties.o vcs_equilibrate.o \
vcs_prep.o vcs_species_thermo.o vcs_Gibbs.o \
$(DALT_OBJ)

View file

@ -23,6 +23,7 @@
#include "ct_defs.h"
#include "mix_defs.h"
#include "clockWC.h"
#include "speciesThermoTypes.h"
#ifdef WITH_IDEAL_SOLUTIONS
#include "IdealSolidSolnPhase.h"
@ -567,7 +568,7 @@ namespace VCSnonideal {
// Debugging level
int maxit = maxsteps;;
double ts = vcs_second();
clockWC tickTock;
int nsp = m_mix->nSpecies();
int nel = m_mix->nElements();
int nph = m_mix->nPhases();
@ -651,7 +652,7 @@ namespace VCSnonideal {
m_mix->setPhaseMoles(ip, phaseMole);
}
double te = vcs_second();
double te = tickTock.secondsWC();
if (printLvl > 0) {
plogf("\n Results from vcs:\n");
if (iSuccess != 0) {
@ -710,7 +711,7 @@ namespace VCSnonideal {
plogf("------------------------------------------"
"-------------------\n");
if (printLvl > 2) {
plogf("Total time = %12.6e seconds\n", te - ts);
plogf("Total time = %12.6e seconds\n", te);
}
}
return iSuccess;

View file

@ -21,6 +21,8 @@
#include "vcs_internal.h"
#include "vcs_VolPhase.h"
#include "clockWC.h"
namespace VCSnonideal {
static char pprefix[20] = " --- vcs_inest: ";
@ -396,7 +398,7 @@ namespace VCSnonideal {
{
int retn = 0;
double test;
double tsecond = vcs_second();
Cantera::clockWC tickTock;
test = -1.0E20;
/*
* Malloc temporary space for usage in this routine and in
@ -494,7 +496,7 @@ namespace VCSnonideal {
/*
* Free malloced memory
*/
tsecond = vcs_second() - tsecond;
double tsecond = tickTock.secondsWC();
m_VCount->T_Time_inest += tsecond;
(m_VCount->T_Calls_Inest)++;
return retn;

View file

@ -21,6 +21,8 @@
#include "vcs_SpeciesProperties.h"
#include "vcs_species_thermo.h"
#include "clockWC.h"
#include <string>
#include "math.h"
using namespace std;
@ -292,7 +294,7 @@ namespace VCSnonideal {
int iprintTime) {
int retn = 0;
int iconv = 0, nspecies0, nelements0, nphase0;
double te, ts = vcs_second();
Cantera::clockWC tickTock;
if (iprintTime == -1) {
iprintTime = MAX(ipr, ip1);
}
@ -409,8 +411,8 @@ namespace VCSnonideal {
/*
* Report on the time if requested to do so
*/
te = vcs_second();
m_VCount->T_Time_vcs += te - ts;
double te = tickTock.secondsWC();
m_VCount->T_Time_vcs += te;
if (iprintTime > 0) {
vcs_TCounters_report();
}

View file

@ -20,6 +20,8 @@
#include "vcs_VolPhase.h"
#include "vcs_species_thermo.h"
#include "clockWC.h"
#ifdef WIN32
#pragma warning(disable:4996)
#endif
@ -156,7 +158,7 @@ namespace VCSnonideal {
double test, RT;
int j, k, l, solveFail, l1, kspec, irxn, im, forced, iph;
// double *ss, *sm, *sa, *aw, *wx,
double dx, xx, par, tsecond;
double dx, xx, par;
int liqphase = FALSE, numSpecliquid = 0;
int dofast, soldel, ll, it1;
int lec, npb, iti, i, lnospec;
@ -186,7 +188,7 @@ namespace VCSnonideal {
* Initialize and set up all counters
*/
vcs_counters_init(0);
tsecond = vcs_second();
Cantera::clockWC ticktock;
/*
* Malloc temporary space for usage in this routine and in
@ -1894,7 +1896,7 @@ namespace VCSnonideal {
/*
* Calculate counters
*/
tsecond = vcs_second() - tsecond;
double tsecond = ticktock.secondsWC();
m_VCount->Time_vcs_TP = tsecond;
m_VCount->T_Time_vcs_TP += m_VCount->Time_vcs_TP;
(m_VCount->T_Calls_vcs_TP)++;
@ -3276,7 +3278,7 @@ namespace VCSnonideal {
int juse = -1;
int jlose = -1;
double *dptr, *scrxn_ptr;
double tsecond = vcs_second();
Cantera::clockWC tickTock;
#ifdef DEBUG_MODE
if (vcs_debug_print_lvl >= 2) {
plogf(" "); for(i=0; i<77; i++) plogf("-"); plogf("\n");
@ -3749,7 +3751,7 @@ namespace VCSnonideal {
}
L_CLEANUP: ;
tsecond = vcs_second() - tsecond;
double tsecond = tickTock.secondsWC();
m_VCount->Time_basopt += tsecond;
(m_VCount->Basis_Opts)++;
return VCS_SUCCESS;

View file

@ -1,67 +0,0 @@
/*====================================================================
* ------------------------
* | CVS File Information |
* ------------------------
* $RCSfile$
* $Author$
* $Date$
* $Revision$
* $Name$
*====================================================================*/
#include <time.h>
#include "vcs_internal.h"
#ifdef COUGAR
#define HAVE_MD_TIMER
#endif
namespace VCSnonideal {
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
#ifndef HAVE_MD_TIMER
double vcs_second(void)
/*************************************************************************
*
* vcs_second()
*
* Returns system cpu and wall clock time in seconds. This
* is a strictly Ansi C timer, since clock() is defined as an
* Ansi C function. On some machines clock() returns type
* unsigned long (HP) and on others (SUN) it returns type long.
* An attempt to recover the actual time for clocks which have
* rolled over is made also. However, it only works if this
* function is called fairly regularily during
* the solution procedure.
*
* clock() -> returns the time in microseconds. Division by
* the macro CLOCKS_PER_SEC recovers the time in seconds.
*************************************************************************/
{
static clock_t last_num_ticks = 0;
static double inv_clocks_per_sec = 1./(double)CLOCKS_PER_SEC;
static double clock_width =
(double)(1L<<((int)sizeof(clock_t)*8-2))*4./(double)CLOCKS_PER_SEC;
static int clock_rollovers = 0;
clock_t num_ticks = clock();
if (num_ticks < last_num_ticks) {
clock_rollovers++;
}
double value = num_ticks * inv_clocks_per_sec;
if (clock_rollovers) {
value += clock_rollovers * clock_width;
}
last_num_ticks = num_ticks;
return(value);
}
#else
#include <nx.h>
double vcs_second(void)
{
return dclock();
}
#endif
}