[Pw_forum] CPU times

Axel Kohlmeyer akohlmey at cmm.chem.upenn.edu
Tue May 22 19:49:45 CEST 2007


On Tue, 22 May 2007, Amos Leffler wrote:

amos,

AL> Dear Forum,
AL>        I am using SuSE Linux 10.2 and have found that it configures and 
AL> compiles espresso-3.2 using the simple commands in the users' manual.  
AL> The program appears to run properly with one curious exception. The CPU 
AL> times that are listed during the calculations are incorrect and are 
AL> always barely larger than zero.  The Wall times seem reasonable.  Where 
AL> is the CPU time calculated and can this be changed?

it should be fixed in the cvs version (at least it was fixed for me
on several machines after i sent in the patch last november). the 
code is in clib/cptimer.c see attachement.

cheers,
  axel.

AL>                                                                          
AL>             Amos Leffler
AL> _______________________________________________
AL> Pw_forum mailing list
AL> Pw_forum at pwscf.org
AL> http://www.democritos.it/mailman/listinfo/pw_forum
AL> 

-- 
=======================================================================
Axel Kohlmeyer   akohlmey at cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.
-------------- next part --------------
/*
  Copyright (C) 2002-2006 Quantum-Espresso group
  This file is distributed under the terms of the
  GNU General Public License. See the file `License'
  in the root directory of the present distribution,
  or http://www.gnu.org/copyleft/gpl.txt .
*/

#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>

#include "c_defs.h"

double F77_FUNC(cclock,CCLOCK)()

/* Return the second elapsed since Epoch (00:00:00 UTC, January 1, 1970)
*/

{

    struct timeval tmp;
    double sec;
    gettimeofday( &tmp, (struct timezone *)0 );
    sec = tmp.tv_sec + ((double)tmp.tv_usec)/1000000.0;
    return sec;

}

double F77_FUNC(scnds,SCNDS) ( )

/* Return the cpu time associated to the current process 
*/

{
        static struct rusage T;

        getrusage(RUSAGE_SELF, &T);

        return ((double)T.ru_utime.tv_sec + ((double)T.ru_utime.tv_usec)/1000000.0);
}



More information about the users mailing list