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:
1if CHarm was compiled in single precision (--enable-single-precision),2if CHarm was compiled in double precision (--enable-double-precisionor no precision flag),3if CHarm was compiled quadruple precision (--enable-quad-precision).
- pyharm.misc.buildopt_simd()#
Returns:
0if CHarm was compiled with SIMD instructions disabled,1if CHarm was compiled with AVX instructions enabled (--enable-avx),2if CHarm was compiled with AVX2 instructions enabled (--enable-avx2),3if CHarm was compiled with AVX-512 instructions enabled (--enable-avx-512),4if CHarm was compiled with NEON instructions enabled (--enable-neon),5if 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
1otherwise (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, returnsn/a,-1,-1,-1, respectively.- Returns:
ver_str (str) – Version of the MPFR library determined on runtime
ver_major (integer) – Symbolic constant
MPFR_VERSION_MAJORdetermined on compile timever_minor (integer) – Symbolic constant
MPFR_VERSION_MINORdetermined on compile timever_patch (integer) – Symbolic constant
MPFR_VERSION_PATCHLEVELdetermined on compile time
- pyharm.misc.buildopt_version_gmp()#
The same as
buildopt_version_mpfr()but for the GMP library (note that--enable-gmpis not a valid installation flag, though).
- pyharm.misc.buildopt_isfinite()#
Returns a non-zero value if correctly working
isfinitemacro was found in the system’smath.hheader file before the compilation. Otherwise, zero is returned.On some systems,
isfiniteis available inmath.h, but it is not working correctly with__float128floating point data type (quadruple precision). The macro may also not work correctly with the-ffast-mathcompiler flag (e.g.,gccandclang). In these cases, zero is returned.