Skip to content

Bug in parallelized computations involving symbolic functions #27492

Description

@egourgoulhon

Sage fails in parallelized computations on tensor fields involving symbolic functions (without any symbolic function in the tensor components, everything is OK). Here is an example with Sage 9.3.beta6 (... indicates truncated output, see the attachment for the full log):

sage: Parallelism().set(nproc=2)                                                                    
sage: M = Manifold(2, 'M')                                                                          
sage: X.<x,y> = M.chart()                                                                           
sage: t = M.tensor_field(0, 2)                                                                      
sage: t[0,0], t[0,1], t[1,1] = function('f')(x), x+y, x-y                                           
sage: v = M.vector_field(1 + x*y, -x^2)                                                             
sage: s = t.contract(v)  # parallelized computation occurs here
---------------------------------------------------------------------------
RemoteTraceback                           Traceback (most recent call last)
RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/eric/sage/9.3.develop/local/lib/python3.8/site-packages/sage/interfaces/interface.py", line 718, in __init__
    self._name = parent._create(value, name=name)
  File "/home/eric/sage/9.3.develop/local/lib/python3.8/site-packages/sage/interfaces/maxima_lib.py", line 604, in _create
    self.set(name, value)
...
  File "sage/libs/ecl.pyx", line 352, in sage.libs.ecl.ecl_safe_funcall (build/cythonized/sage/libs/ecl.c:5735)
    raise RuntimeError("ECL says: {}".format(
RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "sage/misc/fpickle.pyx", line 104, in sage.misc.fpickle.call_pickled_function (build/cythonized/sage/misc/fpickle.c:2384)
    res = eval("f(*args, **kwds)",sage.all.__dict__, {'args':args, 'kwds':kwds, 'f':f})
  File "<string>", line 1, in <module>
  File "/home/eric/sage/9.2.develop/local/lib/python3.7/site-packages/sage/tensor/modules/comp.py", line 2329, in make_Contraction
    sm += this[[ind_s]] * other[[ind_o]]
...
 File "/home/eric/sage/9.3.develop/local/lib/python3.8/site-packages/sage/interfaces/interface.py", line 720, in __init__
    raise TypeError(x)
TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.
"""

The above exception was the direct cause of the following exception:

TypeError                                 Traceback (most recent call last)
<ipython-input-9-d1a8f1c47ea1> in <module>
----> 1 s = t.contract(v)  # parallelized computation occurs here
...
/usr/lib/python3.8/multiprocessing/pool.py in next(self, timeout)
    866         if success:
    867             return value
--> 868         raise value
    869 
    870     __next__ = next                    # XXX

TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.

The full error message is attached.

This issue has been reported in various places previously. With old Python-2 Sage it resulted in a silent error, see
this sage-devel post (see also this one).

CC: @man74cio @rwst @mkoeppe @tscrim

Component: symbolics

Keywords: parallelization, symbolic functions

Issue created by migration from https://trac.sagemath.org/ticket/27492

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions