Function to get the number of CPUs / cores. This is used to determine the number of processes to spawn. Default (if not implemented) = 2
()
| 36 | ierr.value += 1 |
| 37 | |
| 38 | def num_cpus(): |
| 39 | """ |
| 40 | Function to get the number of CPUs / cores. This is used to determine the number of processes to spawn. |
| 41 | Default (if not implemented) = 2 |
| 42 | """ |
| 43 | try: |
| 44 | return mp.cpu_count() |
| 45 | except NotImplementedError: |
| 46 | return 2 |
| 47 | |
| 48 | class cKDTree_MP(cKDTree): |
| 49 | """ |