38#ifndef MADNESS_WORLD_TIMERS_H__INCLUDED
39#define MADNESS_WORLD_TIMERS_H__INCLUDED
50#include <catamount/dclock.h>
54# define BG_CYCLES_PER_MICROSECOND 850
55# define BG_SECONDS_PER_CYCLE 1.176470588235294033e-09
56# include </bgsys/drivers/ppcfloor/arch/include/bpcore/ppc450_inlines.h>
60# define BG_CYCLES_PER_MICROSECOND 1600
61# define BG_SECONDS_PER_CYCLE 6.25e-10
62# include <hwi/include/bqc/A2_inlines.h>
84#if defined(HAVE_IBMBGP)
88 asm volatile (
"mftbu %0" :
"=r"(
rx) );
89 asm volatile (
"mftb %0" :
"=r"(
ry) );
90 asm volatile (
"mftbu %0" :
"=r"(
rz) );
95#elif defined(HAVE_IBMBGQ)
99 __asm__ volatile(
".byte 0x0f, 0x31" :
"=A"(x));
102 __asm__ volatile(
"rdtsc" :
"=a"(
a),
"=d"(
d));
129#if defined(X86_32) || defined(X86_64) || defined(HAVE_IBMBGP)
134#elif defined(HAVE_IBMBGP)
136#elif defined(HAVE_IBMBGQ)
139 const auto now = std::chrono::steady_clock::now();
153#if defined(CLOCK_PROCESS_CPUTIME_ID)
156 return static_cast<double>(
ts.tv_sec) + 1.0e-9 *
static_cast<double>(
ts.tv_nsec);
159 return static_cast<double>(std::clock()) /
static_cast<double>(
CLOCKS_PER_SEC);
167#if defined(X86_32) || defined(X86_64)
168 asm volatile(
"rep;nop" : : :
"memory");
169#elif defined(HAVE_IBMBGP) || defined(HAVE_IBMBGQ)
170 asm volatile (
"nop\n");
174 asm volatile (
"nop\n");
183#if defined(HAVE_CRAYXT)
189#elif defined(HAVE_IBMBGP) || defined(HAVE_IBMBGQ)
191 for (
int i=0; i<count; i++) {
192 asm volatile (
"nop\n");
Macros and tools pertaining to the configuration of MADNESS.
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
static double process_cpu_time()
Returns the CPU time consumed by this process, in seconds.
Definition timers.h:152
static double cpu_time()
Returns the cpu time in seconds relative to an arbitrary origin.
Definition timers.h:128
static void myusleep(unsigned int us)
Sleep or spin for specified number of microseconds.
Definition timers.h:182
double cpu_frequency()
Estimate the processor frequency, in Hz.
Definition timers.cc:79
double wall_time()
Returns the wall time in seconds relative to an arbitrary origin.
Definition timers.cc:48
void cpu_relax()
Do nothing and especially do not touch memory.
Definition timers.h:166
static uint64_t cycle_count()
On some machines we have access to a cycle count.
Definition timers.h:82
static XNonlinearSolver< std::vector< Function< T, NDIM > >, T, vector_function_allocator< T, NDIM > > nonlinear_vector_solver(World &world, const long nvec)
Definition nonlinsol.h:371
static const double d
Definition nonlinschro.cc:121
static const double a
Definition nonlinschro.cc:118
void e()
Definition test_sig.cc:75