pyharm.misc#

Module defining some miscellaneous functions, constants, etc.

Note

All functions that deal with numerics are written in double precision.

pyharm.misc.get_version()#

Returns a string specifying the CHarm version number determined on compilation time.

pyharm.misc.print_info()#

Prints library info (library name, version, compilation date, precision, etc).

pyharm.misc.buildopt_precision()#

Returns:

  • 1 if CHarm was compiled in single precision (--enable-single-precision),

  • 2 if CHarm was compiled in double precision (--enable-double-precision or no precision flag),

  • 3 if CHarm was compiled quadruple precision (--enable-quad-precision).

pyharm.misc.buildopt_simd()#

Returns:

  • 0 if CHarm was compiled with SIMD instructions disabled,

  • 1 if CHarm was compiled with AVX instructions enabled (--enable-avx),

  • 2 if CHarm was compiled with AVX2 instructions enabled (--enable-avx2),

  • 3 if CHarm was compiled with AVX-512 instructions enabled (--enable-avx-512),

  • 4 if CHarm was compiled with NEON instructions enabled (--enable-neon),

  • 5 if CHarm was compiled with SSE4.1 instructions enabled (--enable-sse4.1).

pyharm.misc.buildopt_simd_vector_size()#

Returns the size of SIMD vectors if CHarm was compiled with SIMD instructions enabled and 1 otherwise (SIMD instructions disabled).

pyharm.misc.buildopt_omp_charm()#

Returns a non-zero value if CHarm was compiled with the OpenMP parallelization enabled (--enable-openmp). Otherwise, zero is returned.

pyharm.misc.buildopt_omp_fftw()#

Returns a non-zero value if the host’s FFTW library supports OpenMP parallelization. Otherwise, zero is returned.

If non-zero, all FFTW computations are parallelized.

pyharm.misc.buildopt_mpi()#

Returns a non-zero value if CHarm was compiled with the MPI parallelization enabled (--enable-mpi). Otherwise, zero is returned.

pyharm.misc.buildopt_mpfr()#

Returns a non-zero value if CHarm was compiled with the MPFR enabled (--enable-mpfr). Otherwise, zero is returned.

pyharm.misc.buildopt_version_fftw()#

Returns a string specifying the FFTW version used to compile CHarm.

pyharm.misc.buildopt_version_mpi()#

If CHarm was compiled with the MPI parallelization enabled (--enable-mpi), returns the version and subversion numbers of the MPI standard that is being supported by the linked MPI implementation. If MPI parallelization is disabled, all four values are set to -1.

Note

All four version numbers returned are related to the MPI standard. To see the version of the linked MPI implementation, call print_info().

Returns:

  • major_header (integer) – Version of the MPI standard determined on compile time

  • minor_header (integer) – Subversion of the MPI standard determined on compile time

  • major_lib (integer) – Version of the MPI standard determined on runtime

  • minor_lib (integer) – Subversion of the MPI standard determined on runtine

pyharm.misc.buildopt_version_mpfr()#

If CHarm was compiled with MPFR enabled (--enable-mpfr), returns the version of the MPFR library. If CHarm was compiled with MPFR disabled, returns n/a, -1, -1, -1, respectively.

Returns:

  • ver_str (str) – Version of the MPFR library determined on runtime

  • ver_major (integer) – Symbolic constant MPFR_VERSION_MAJOR determined on compile time

  • ver_minor (integer) – Symbolic constant MPFR_VERSION_MINOR determined on compile time

  • ver_patch (integer) – Symbolic constant MPFR_VERSION_PATCHLEVEL determined on compile time

pyharm.misc.buildopt_version_gmp()#

The same as buildopt_version_mpfr() but for the GMP library (note that --enable-gmp is not a valid installation flag, though).

pyharm.misc.buildopt_isfinite()#

Returns a non-zero value if correctly working isfinite macro was found in the system’s math.h header file before the compilation. Otherwise, zero is returned.

On some systems, isfinite is available in math.h, but it is not working correctly with __float128 floating point data type (quadruple precision). The macro may also not work correctly with the -ffast-math compiler flag (e.g., gcc and clang). In these cases, zero is returned.