CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   wall clock time for each processor (https://www.cfd-online.com/Forums/openfoam-programming-development/137532-wall-clock-time-each-processor.html)

openfoammaofnepo June 18, 2014 05:43

wall clock time for each processor
 
Dear All,

I am trying to know the wall clock time for each processor. For instance, the following code:

Code:

            // --- PIMPLE loop
            while (pimple.loop())
            {
                #include "UEqn.H"
                #include "YEEqn.H"

                // --- Pressure corrector loop
                while (pimple.correct())
                {
                    #include "pEqn.H"
                }

                if (pimple.turbCorr())
                {
                    turbulence->correct();
                }
            }

I would like to know for each processor, how long is the wall clock time to calculate the following:
Code:

#include "UEqn.H"
I noticed that in the OF, we always use
Code:

runTime.elapsedClockTime()
to return the wall clock time for each time step, but this is not for one processor.

Does anybody know something about how to output the wall clock time for each processor?
OFFO

openfoammaofnepo June 23, 2014 06:47

In Openfoam, I found that we can use the following two functions to the wall clock time and cpu time:

Code:

time_t Foam::clock::clockTimeIncrement() const
double Foam::cpuTime::cpuTimeIncrement() const

When I add them into the code, I need to test both - the wall clock time and cpu time time. But I found that if put these functions together like :

Code:

......
runTime.cpuTimeIncrement();
runTime.clockTimeIncrement();
......

In this case, the function clockTimeIncrement() always returns the zero wall clock time. This maybe caused by the fact that these two functions are executed consecutively, i.e. newTime_-LastTime = 0. So I cannot get the wall clocktime in this way.

Do you have some suggestions if I indeed to extract the both wall clock time and cputime? Thank you very much.


All times are GMT -4. The time now is 23:34.