Adding :

import multiprocessing as mp
if mp.get_start_method != 'fork' : mp.set_start_method('fork')

Lets one rerun the notebook without restarting the kernel.

One can delete the line:

os.environ['SAGE_NUM_THREADS'] = '4'

On Thursday, January 27, 2022 at 5:59:36 PM UTC Alan Stafford wrote:

> That works. I get all cores used.
> On Thursday, January 27, 2022 at 1:20:26 PM UTC egourg...@gmail.com wrote:
>
>> Le mardi 25 janvier 2022 à 23:59:20 UTC+1, John H Palmieri a écrit :
>>
>>> Are you using OS X? Could this possibly be due to how Python handles 
>>> multiprocessing on OS X vs. other platforms? (See 
>>>
>>> https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods,
>>>  
>>> in particular the comment "On macOS, the *spawn* start method is now 
>>> the default" and https://bugs.python.org/issue33725.)
>>>
>>>
>> Thank you John for pointing this!
>>
>> Alan, could you try to run your notebook after having added the following 
>> lines at the top of it?
>>
>> import multiprocessing as mp
>> mp.set_start_method('fork')
>>
>> Eric.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/d8095765-4b6a-480f-8d00-c240b7c4b97fn%40googlegroups.com.

Reply via email to