Hi again,
Ok so I created the environment and ran it as a script, the script being
import numpy as np
from numba import njit, prange
import timeit
def pi_montecarlo_python(n):
in_circle = 0
for i in prange(n):
x, y = np.random.random(), np.random.random()
if x ** 2 + y ** 2 <= 1.0:
in_circle += 1
return 4.0 * in_circle / n
pi_montecarlo_python_parallel = njit(parallel=True)(pi_montecarlo_python)
n = 100000
print('njit_python_parallel run 1')
t0 = timeit.timeit()
pi_montecarlo_python_parallel(n)
print(timeit.timeit()-t0)
print('njit_python_parallel run 2')
t1 = timeit.timeit()
pi_montecarlo_python_parallel(n)
print(timeit.timeit()-t1)
It ran but this was the output
njit_python_parallel run 1
OMP: Info #270: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
0.001960516999999995
njit_python_parallel run 2
-1.5994999999935366e-05
So there is still something it doesn’t like about OMP ? Don’t always get negative time, that doesnt really make sense…
numba -s output
System info:
--------------------------------------------------------------------------------
__Time Stamp__
Report started (local time) : 2021-03-05 09:29:36.784206
UTC start time : 2021-03-05 09:29:36.784217
Running time (s) : 1.497689
Hardware Information
Machine : x86_64
CPU Name : icelake-client
CPU Count : 8
Number of accessible CPUs : ?
List of accessible CPUs cores : ?
CFS Restrictions (CPUs worth of runtime) : None
CPU Features : 64bit adx aes avx avx2
avx512bitalg avx512bw avx512cd
avx512dq avx512f avx512ifma
avx512vbmi avx512vbmi2 avx512vl
avx512vnni avx512vpopcntdq bmi
bmi2 clflushopt cmov cx16 cx8 f16c
fma fsgsbase fxsr gfni invpcid
lzcnt mmx movbe pclmul popcnt
prfchw rdpid rdrnd rdseed sahf sgx
sha sse sse2 sse3 sse4.1 sse4.2
ssse3 vaes vpclmulqdq xsave xsavec
xsaveopt xsaves
Memory Total (MB) : 16384
Free Memory (MB) : 244
OS Information
Platform Name : Darwin-19.6.0-x86_64-i386-64bit
Platform Release : 19.6.0
OS Name : Darwin
OS Version : Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64
OS Specific Version : 10.15.7 x86_64
Libc Version : ?
Python Information
Python Compiler : Clang 10.0.0
Python Implementation : CPython
Python Version : 3.7.10
Python Locale : en_IE.UTF-8
LLVM Information
LLVM Version : 10.0.1
CUDA Information
CUDA Device Initialized : False
CUDA Driver Version : ?
CUDA Detect Output:
None
CUDA Librairies Test Output:
None
ROC information
ROC Available : False
ROC Toolchains : None
HSA Agents Count : 0
HSA Agents:
None
HSA Discrete GPUs Count : 0
HSA Discrete GPUs : None
SVML Information
SVML State, config.USING_SVML : False
SVML Library Loaded : False
llvmlite Using SVML Patched LLVM : True
SVML Operational : False
Threading Layer Information
TBB Threading Layer Available : False
±-> Disabled due to Unknown import problem.
OpenMP Threading Layer Available : True
±->Vendor: Intel
Workqueue Threading Layer Available : True
±->Workqueue imported successfully.
Numba Environment Variable Information
None found.
Conda Information
Conda Build : not installed
Conda Env : 4.9.2
Conda Platform : osx-64
Conda Python Version : 3.8.5.final.0
Conda Root Writable : True
Installed Packages
blas 1.0 mkl
ca-certificates 2021.1.19 hecd8cb5_0
certifi 2020.12.5 py37hecd8cb5_0
intel-openmp 2019.4 233
libcxx 10.0.0 1
libedit 3.1.20191231 h1de35cc_1
libffi 3.3 hb1e8313_2
libllvm10 10.0.1 h76017ad_5
llvm-openmp 10.0.0 h28b9765_0
llvmlite 0.35.0 py37he4411ff_4
mkl 2019.4 233
mkl-service 2.3.0 py37h9ed2024_0
mkl_fft 1.3.0 py37ha059aab_0
mkl_random 1.1.1 py37h959d312_0
ncurses 6.2 h0a44026_1
numba 0.52.0 np1.11py3.7h6440ff4_g1882505_0 numba
numpy 1.19.2 py37h456fd55_0
numpy-base 1.19.2 py37hcfb5961_0
openssl 1.1.1j h9ed2024_0
pip 21.0.1 py37hecd8cb5_0
python 3.7.10 h88f2d9e_0
readline 8.1 h9ed2024_0
setuptools 52.0.0 py37hecd8cb5_0
six 1.15.0 py37hecd8cb5_0
sqlite 3.33.0 hffcf06c_0
tk 8.6.10 hb0a8c7a_0
wheel 0.36.2 pyhd3eb1b0_0
xz 5.2.5 h1de35cc_0
zlib 1.2.11 h1de35cc_3
No errors reported.
Warning log
Warning (cuda): CUDA driver library cannot be found or no CUDA enabled devices are present.
Exception class: <class ‘numba.cuda.cudadrv.error.CudaSupportError’>
Warning (roc): Error initialising ROC: No ROC toolchains found.
Warning (roc): No HSA Agents found, encountered exception when searching: Error at driver init:
HSA is not currently supported on this platform (darwin).
:
Warning (psutil): psutil cannot be imported. For more accuracy, consider installing it.
If requested, please copy and paste the information between
the dashed (----) lines, or from a given specific section as
appropriate.
=============================================================
IMPORTANT: Please ensure that you are happy with sharing the
contents of the information present, any information that you
wish to keep private you should remove before sharing.
Thanks for looking into this, really appreciated!
Fionnuala