Open astamm opened 2 months ago
Benchmarking on the whole set of 100 curves leads to equivalent median times (35s) and memory allocation (159MB).
I see that setting the number of cores is handled by {RhpcBLASctl}. This package has the following warning:
openmp-related functions only work at build-time instructions. Omp_get * now returns NA_Integer if R was not built with openmp instructions. NOTE: if R itself is built without OpenMP instructions and BLAS thread is used with OpenMP, this package will not work...XD
In fact, if I run locally RhpcBLASctl::omp_get_num_procs()
, it returns NA
because R is built by default without OpenMP on macOS.
I will try to get a build with OpenMP to understand if this issue persists. However, it could be good to mention that CPU parallelisation does not work with default R builds on macOS.
Instructions to (re-)enable OpenMP support with macOS clang
compiler can be found here: https://mac.r-project.org/openmp/. Once done, re-installing from source RhpcBLASctl make it discover OpenMP and correctly find the number of cores.
It is trickier with rkeops because it is a wrapper that behind the scene uses the pykeops Python package. Hence, on macOS, one also needs to somehow tell the python installer where to find OpenMP libs and headers to properly build pykeops with OpenMP support.
The best way to handle this would be to provide a configure.ac
file which would generate a configure
file via a call to autoconf
in which we can generate different Makevars
files depending on the detected OS (see https://www.r-bloggers.com/2017/08/setting-up-optional-openmp-support-with-rcpparmadillo/ for example).
Hi, As the title of the issue explains, a small reprex for this (Hausdorff distance computation on functional data set).
Generate some data
Implement
dist()
function for Hausdorff distance via {rkeops}Benchmarks