This commit is contained in:
Martin Reinecke 2018-10-26 16:06:30 +02:00
parent 18c82762c3
commit 1c5c9eb579
3 changed files with 18 additions and 5 deletions

View file

@ -25,7 +25,7 @@
/* /*
* Functionality for reading wall clock time * Functionality for reading wall clock time
* *
* Copyright (C) 2010, 2011 Max-Planck-Society * Copyright (C) 2010-2016 Max-Planck-Society
* Author: Martin Reinecke * Author: Martin Reinecke
*/ */
@ -33,6 +33,8 @@
#include <omp.h> #include <omp.h>
#elif defined (USE_MPI) #elif defined (USE_MPI)
#include "mpi.h" #include "mpi.h"
#elif defined (_WIN32)
#include <Windows.h>
#else #else
#include <sys/time.h> #include <sys/time.h>
#include <stdlib.h> #include <stdlib.h>
@ -46,6 +48,17 @@ double wallTime(void)
return omp_get_wtime(); return omp_get_wtime();
#elif defined (USE_MPI) #elif defined (USE_MPI)
return MPI_Wtime(); return MPI_Wtime();
#elif defined (_WIN32)
static double inv_freq = -1.;
if (inv_freq<0)
{
LARGE_INTEGER freq;
QueryPerformanceFrequency(&freq);
inv_freq = 1. / double(freq.QuadPart);
}
LARGE_INTEGER count;
QueryPerformanceCounter(&count);
return count.QuadPart*inv_freq;
#else #else
struct timeval t; struct timeval t;
gettimeofday(&t, NULL); gettimeofday(&t, NULL);

View file

@ -25,7 +25,7 @@
/*! \file sharp_cxx.h /*! \file sharp_cxx.h
* Spherical transform library * Spherical transform library
* *
* Copyright (C) 2012-2016 Max-Planck-Society * Copyright (C) 2012-2017 Max-Planck-Society
* \author Martin Reinecke * \author Martin Reinecke
*/ */
@ -48,8 +48,8 @@ class sharp_base
: ainfo(0), ginfo(0) {} : ainfo(0), ginfo(0) {}
~sharp_base() ~sharp_base()
{ {
sharp_destroy_geom_info(ginfo); if (ginfo) sharp_destroy_geom_info(ginfo);
sharp_destroy_alm_info(ainfo); if (ainfo) sharp_destroy_alm_info(ainfo);
} }
void set_general_geometry (int nrings, const int *nph, const ptrdiff_t *ofs, void set_general_geometry (int nrings, const int *nph, const ptrdiff_t *ofs,

View file

@ -25,7 +25,7 @@
/*! \file sharp_geomhelpers.c /*! \file sharp_geomhelpers.c
* Spherical transform library * Spherical transform library
* *
* Copyright (C) 2006-2018 Max-Planck-Society<br> * Copyright (C) 2006-2018 Max-Planck-Society
* \author Martin Reinecke * \author Martin Reinecke
*/ */