Re: [sage-devel] SageMath 10.1 for macOs ARM randomly fails to compute the Riemann/Ricci tensor or Ricci scalar when using threads

2023-10-03 Thread Alejandro Marino Vaquero Avilés-Casco
Thank you, Eric. Indeed, that’s the issue, and I’m happy to see some clever 
people are working on it.

> El 3 oct 2023, a las 10:55, Eric Gourgoulhon  
> escribió:
> 
> Hi, 
> 
> Le lundi 2 octobre 2023 à 13:42:29 UTC+2, Alejandro Marino Vaquero 
> Avilés-Casco a écrit :
> When running sagemath release version 10.1 in macOs for the arm architecture 
> (the target tested has a M2 processor) with multiple threads, the calculation 
> of the Riemann tensor, the Ricci tensor or the Ricci scalar normally fails, 
> although sometimes it randomly success. Executing single thread solves the 
> problem. 
> 
> This is the issue 
> https://github.com/sagemath/sage/issues/35580
> regarding Sage parallel computations on macOS.
> Many macOS users are facing it and I hope it will be solved someday...
> 
> Eric. 
> 
> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "sage-devel" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sage-devel/F_kWM6GBXl4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> sage-devel+unsubscr...@googlegroups.com 
> <mailto:sage-devel+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/a068f844-3b2f-49fb-8aa7-d0107140b731n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sage-devel/a068f844-3b2f-49fb-8aa7-d0107140b731n%40googlegroups.com?utm_medium=email_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5E1A1FB6-82D8-4AD9-8039-B4C96515C35C%40gmail.com.


[sage-devel] SageMath 10.1 for macOs ARM randomly fails to compute the Riemann/Ricci tensor or Ricci scalar when using threads

2023-10-02 Thread Alejandro Marino Vaquero Avilés-Casco
When running sagemath release version 10.1 in macOs for the arm 
architecture (the target tested has a M2 processor) with multiple threads, 
the calculation of the Riemann tensor, the Ricci tensor or the Ricci scalar 
normally fails, although sometimes it randomly success. Executing single 
thread solves the problem. Looks like a race condition of some kind.

The error is the following:

Process SpawnPoolWorker-37: Traceback (most recent call last): File 
"/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/multiprocessing/process.py",
 
line 314, in _bootstrap self.run() File 
"/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/multiprocessing/process.py",
 
line 108, in run self._target(*self._args, **self._kwargs) File 
"/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/multiprocessing/pool.py",
 
line 114, in worker task = get() ^ File 
"/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/multiprocessing/queues.py",
 
line 367, in get return _ForkingPickler.loads(res) 
^^ File 
"/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/manifolds/differentiable/vectorframe.py",
 
line 220, in  from sage.tensor.modules.free_module_basis import 
(FreeModuleBasis, File 
"/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/tensor/modules/free_module_basis.py",
 
line 35, in  from sage.rings.integer_ring import ZZ File 
"sage/rings/integer_ring.pyx", line 1, in init sage.rings.integer_ring 
(build/cythonized/sage/rings/integer_ring.c:18143) r""" File 
"sage/rings/integer.pyx", line 1, in init sage.rings.integer 
(build/cythonized/sage/rings/integer.c:55476) r""" File 
"sage/rings/rational.pyx", line 77, in init sage.rings.rational 
(build/cythonized/sage/rings/rational.cpp:39842) from .integer_ring import 
ZZ 
ImportError: cannot import name ZZ

I find the error several times repeated. The error appears even if the 
system is extremely simple: I tried with 2D cartesian coordinates and the 
Minkowski metric, and the calculation failed.

I attach the commands in my Jupyter Notebook of the simplest case I tried

-
Parallelism().set(nproc=12) # Commenting this line makes the code work
M = Manifold(2, 'M', structure='Lorentzian')
X. = M.chart(r't x:(-oo,+oo)')
g = M.metric()
g[0,0] = -1
g[1,1] = 1
g.ricci_scalar().display()
--


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/dc9e2fc5-19f4-48f3-9919-08e452c2fab3n%40googlegroups.com.