~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/armci/tcgmsg/ipcv5.0/mtime.c

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if HAVE_CONFIG_H
 
2
#   include "config.h"
 
3
#endif
 
4
 
 
5
/* $Header: /tmp/hpctools/ga/tcgmsg/ipcv5.0/mtime.c,v 1.5 2002-03-12 18:59:31 d3h325 Exp $ */
 
6
 
 
7
#if HAVE_STDIO_H
 
8
#   include <stdio.h>
 
9
#endif
 
10
 
 
11
#include "srftoc.h"
 
12
 
 
13
 
 
14
/**
 
15
 * return wall clock time in centiseconds
 
16
 */
 
17
long MTIME_()
 
18
{
 
19
    double TCGTIME_();
 
20
    return (long) (TCGTIME_()*100.0);
 
21
}
 
22
 
 
23
#if defined(LAPI) && defined(AIX)
 
24
#   define LAPI_AIX
 
25
#endif
 
26
 
 
27
#ifndef LAPI_AIX
 
28
 
 
29
#if HAVE_SYS_TYPES_H
 
30
#   include <sys/types.h>
 
31
#endif
 
32
#if HAVE_SYS_TIME_H
 
33
#   include <sys/time.h>
 
34
#endif
 
35
 
 
36
static unsigned firstsec=0;     /* Reference for timer */
 
37
static unsigned firstusec=0;    /* Reference for timer */
 
38
 
 
39
void MtimeReset()               /* Sets timer reference */
 
40
{
 
41
    struct timeval tp;
 
42
    struct timezone tzp;
 
43
 
 
44
    (void) gettimeofday(&tp,&tzp);
 
45
 
 
46
    firstsec = tp.tv_sec;
 
47
    firstusec = tp.tv_usec;
 
48
}
 
49
 
 
50
 
 
51
/**
 
52
 * Return wall clock time in seconds as accurately as possible
 
53
 */
 
54
double TCGTIME_()
 
55
{
 
56
    static int firstcall=1;
 
57
    double low, high;
 
58
 
 
59
    struct timeval tp;
 
60
    struct timezone tzp;
 
61
 
 
62
    if (firstcall) {
 
63
        MtimeReset();
 
64
        firstcall = 0;
 
65
    }
 
66
 
 
67
    (void) gettimeofday(&tp,&tzp);
 
68
 
 
69
    low = (double) (tp.tv_usec>>1) - (double) (firstusec>>1);
 
70
    high = (double) (tp.tv_sec - firstsec);
 
71
 
 
72
    return high + 1.0e-6*(low+low);
 
73
}
 
74
 
 
75
#endif
 
76
 
 
77
#ifdef LAPI_AIX
 
78
 
 
79
#if HAVE_SYS_TIME_H
 
80
#   include <sys/time.h>
 
81
#endif
 
82
#if HAVE_SYS_SYSTEMCFG_H
 
83
#   include <sys/systemcfg.h>
 
84
#endif
 
85
 
 
86
static int firstsec=0;    /* Reference for timer */
 
87
static int firstnsec=0;    
 
88
 
 
89
void MtimeReset()               /* Sets timer reference */
 
90
{
 
91
    timebasestruct_t t;
 
92
    read_real_time(&t, TIMEBASE_SZ);
 
93
    time_base_to_time(&t, TIMEBASE_SZ);
 
94
 
 
95
    firstsec = t.tb_high;
 
96
    firstnsec = t.tb_low;
 
97
}
 
98
 
 
99
 
 
100
/**
 
101
 * Return wall clock time in seconds as accurately as possible
 
102
 */
 
103
double TCGTIME_()
 
104
{
 
105
    static int firstcall=1;
 
106
    timebasestruct_t t;
 
107
    int low, high;
 
108
    int secs, nsecs;
 
109
 
 
110
    if (firstcall) {
 
111
        MtimeReset();
 
112
        firstcall = 0;
 
113
    }
 
114
 
 
115
 
 
116
    read_real_time(&t, TIMEBASE_SZ);
 
117
    time_base_to_time(&t, TIMEBASE_SZ);
 
118
 
 
119
    secs = t.tb_high - firstsec;
 
120
    nsecs = t.tb_low - firstnsec;
 
121
 
 
122
    /* If there was a carry from low-order to high-order during
 
123
       the measurement, we have to undo it */
 
124
    if(nsecs < 0){
 
125
        secs--;
 
126
        nsecs+= 1000000000;
 
127
    }
 
128
    return (double)(secs + 1.0e-9*nsecs);
 
129
}
 
130
 
 
131
#endif /* LAPI_AIX */