[sage-support] Re: Tensor Multiprocessing broken. SageMath 9.5 on Apple Mac OSX 12.1 . SageMath-9.5_x86_64

2022-01-27 Thread 'Alan Stafford' via sage-support
mp.set_start_method('fork',force=True)

lets one rerun the notebook without restarting.
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/e6b8a0fd-999e-49a8-b9af-cd12192d1762n%40googlegroups.com.


[sage-support] Re: Tensor Multiprocessing broken. SageMath 9.5 on Apple Mac OSX 12.1 . SageMath-9.5_x86_64

2022-01-27 Thread 'Alan Stafford' via sage-support
if mp.get_start_method() != 'fork' : mp.set_start_method('fork')

Lets one rerun the notebook without restarting the kernel. 
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/a79f263b-9f52-416a-a341-15eb2452753en%40googlegroups.com.


[sage-support] Re: Tensor Multiprocessing broken. SageMath 9.5 on Apple Mac OSX 12.1 . SageMath-9.5_x86_64

2022-01-27 Thread 'Alan Stafford' via sage-support
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.


[sage-support] Re: Tensor Multiprocessing broken. SageMath 9.5 on Apple Mac OSX 12.1 . SageMath-9.5_x86_64

2022-01-27 Thread 'Alan Stafford' via sage-support
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/ffb5cbc1-fa62-416f-84e7-825524894acan%40googlegroups.com.


[sage-support] Re: Tensor Multiprocessing broken. SageMath 9.5 on Apple Mac OSX 12.1 . SageMath-9.5_x86_64

2022-01-27 Thread Eric Gourgoulhon

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/ba792649-1a5c-4b34-8a39-fbd74a795d04n%40googlegroups.com.


[sage-support] Re: Tensor Multiprocessing broken. SageMath 9.5 on Apple Mac OSX 12.1 . SageMath-9.5_x86_64

2022-01-27 Thread 'Alan Stafford' via sage-support
ImportError: cannot import name 'NumberField' from partially initialized 
module 'sage.rings.number_field.number_field' (most likely due to a 
circular import) 
(/private/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/rings/number_field/number_field.py)
 
Process SpawnPoolWorker-3:
On Wednesday, January 26, 2022 at 1:45:41 PM UTC Alan Stafford wrote:

> SageMath 9.1 works with the 9.5 version of ncpus.py so one can disregard 
> my tinkering with  it. 
>
> On Wednesday, January 26, 2022 at 10:12:33 AM UTC Alan Stafford wrote:
>
>> I am using Mac OS 12.1 Monterey. The notebook works on Sagemath 9.1 if I 
>> hack ncpus.py to return 4. 
>>
>> On Tuesday, January 25, 2022 at 10:59:20 PM UTC John H Palmieri wrote:
>>
>>> 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.)
>>>
>>>
>>>
>>> On Tuesday, January 25, 2022 at 12:34:07 PM UTC-8 
>>> alan_thoma...@yahoo.co.uk wrote:
>>>
 Process SpawnPoolWorker-1: Traceback (most recent call last): File 
 "/private/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/multiprocessing/process.py",
  
 line 315, in _bootstrap self.run() File 
 "/private/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/multiprocessing/process.py",
  
 line 108, in run self._target(*self._args, **self._kwargs) File 
 "/private/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/multiprocessing/pool.py",
  
 line 114, in worker task = get() File 
 "/private/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/multiprocessing/queues.py",
  
 line 368, in get return _ForkingPickler.loads(res) File 
 "/private/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/manifolds/differentiable/chart.py",
  
 line 36, in 
 On Tuesday, January 25, 2022 at 8:13:20 PM UTC egourg...@gmail.com 
 wrote:

> Hi,
>
> Le mardi 25 janvier 2022 à 12:54:57 UTC+1, alan_thoma...@yahoo.co.uk 
> a écrit :
>
>> I get errors in this notebook if I set the variable tpar to any value 
>> greater than one. (Number of Tensor processing cores.)
>>
>> *http://alan.atstafford.co.uk/Sage9.5Problem.ipynb 
>> *
>>
>
> Your notebook works well with tpar=4 on my Ubuntu computer running 
> Sage 9.5.rc4.
> What kind of error do you get?
>
> 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/d0782dd6-41d5-48da-8b8b-e00bc356e9b6n%40googlegroups.com.