You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run your script a few times on different setup. Interestingly, I obtained different results :)
The main reason is that numpy already has some multi-threaded function (and it spawns a number of workers that depends on python version and platform).1
Once numpy is forced to a single thread2 the best performance are obtained.
Multiprocessing is always slightly better than pathos (reasonable, as pathos uses multiprocessing as backend).3
With 12 cores and numpy set to 1 thread I got throughput_rays_per_sec around 430 with both Py 3.7.9, Py 3.8.5 and P 3.9.1 4
Default Setting numpy to 1 thread
[1] This is evident by CPU usage that is double or 4 times the expected. How many workers are present depends on numpy compile settings for accelerated algebra libraries (BLAST and friends) and environmental variables. More info with:
```python
import numpy as np
np.show_config()
```
[2] i.e. by setting the following environmental variable before importing numpy
They will have different scaling behaviour because the script retains full history - very slow! The CLI will saved reduced data using the --end-rays option.
I've run your script a few times on different setup. Interestingly, I obtained different results :)
The main reason is that numpy already has some multi-threaded function (and it spawns a number of workers that depends on python version and platform).1
Once numpy is forced to a single thread2 the best performance are obtained.
Multiprocessing is always slightly better than pathos (reasonable, as pathos uses multiprocessing as backend).3
With 12 cores and numpy set to 1 thread I got throughput_rays_per_sec around 430 with both Py 3.7.9, Py 3.8.5 and P 3.9.1 4
Default
![image](https://user-images.githubusercontent.com/2422614/105640976-c3944b80-5e81-11eb-927f-d62060c44b9f.png)
![image](https://user-images.githubusercontent.com/2422614/105640252-4c5cb880-5e7d-11eb-8b03-ae42c373b561.png)
Setting numpy to 1 thread
[1] This is evident by CPU usage that is double or 4 times the expected. How many workers are present depends on numpy compile settings for accelerated algebra libraries (BLAST and friends) and environmental variables. More info with: ```python import numpy as np np.show_config() ```
[2] i.e. by setting the following environmental variable before importing numpy
[3] If
pathos.pools.ProcessPool
is used, performance are further reduced (roughtly 10%).[4] For Py>=3.8 the following line is needed to prevent an AttributeError in multiprocessing (see: https://bugs.python.org/issue39414)
Originally posted by @dcambie in #48 (comment)
The text was updated successfully, but these errors were encountered: