Ask Your Question
1

I keep getting this error for any calculation that I do: TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.

asked 2024-08-20 10:56:27 +0200

aneet gravatar image

updated 2024-08-20 14:11:08 +0200

Emmanuel Charpentier gravatar image

The snippet of my code is here

### #minkowski nmetric
eta= M.metric('eta')
eta[0,0],eta[1,1],eta[2,2],eta[3,3]=-1,1,1,1
eta_inv=eta.inverse()

### #perturbation metric
h=M.metric('h')
for i in range (4):
    for j in range (4):
        h[i,j]=function(f'h{i}{j}')(t, x, y, z)
        h[i,j]=h[j,i]
h[:]

up till this point the calculations are fine. At the next step I get an error

### #contraction
eta_inv.contract(h)

###error
---------------------------------------------------------------------------
RemoteTraceback                           Traceback (most recent call last)
RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/penguin/sage/src/sage/interfaces/interface.py", line 749, in __init__
    self._name = parent._create(value, name=name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/penguin/sage/src/sage/interfaces/maxima_lib.py", line 632, in _create
    self.set(name, value)
  File "/home/penguin/sage/src/sage/interfaces/maxima_lib.py", line 540, in set
    self.eval(cmd)
  File "/home/penguin/sage/src/sage/interfaces/maxima_lib.py", line 486, in _eval_line
    maxima_eval("#$%s$" % statement)
  File "sage/libs/ecl.pyx", line 837, in sage.libs.ecl.EclObject.__call__
    lispargs = EclObject(list(args))
  File "sage/libs/ecl.pyx", line 698, in sage.libs.ecl.EclObject.__init__
    self.set_obj(python_to_ecl(args[0], True))
  File "sage/libs/ecl.pyx", line 481, in sage.libs.ecl.python_to_ecl
    L = cl_cons(python_to_ecl(pyobj[i], read_strings), L)
  File "sage/libs/ecl.pyx", line 458, in sage.libs.ecl.python_to_ecl
    return ecl_safe_funcall(read_from_string_clobj, o)
  File "sage/libs/ecl.pyx", line 342, in sage.libs.ecl.ecl_safe_funcall
    raise RuntimeError("ECL says: {}".format(message))
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 "/home/penguin/sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "sage/misc/fpickle.pyx", line 116, in sage.misc.fpickle.call_pickled_function
    res = eval("f(*args, **kwds)", toplevel.__dict__,
  File "<string>", line 1, in <module>
  File "/home/penguin/sage/src/sage/tensor/modules/comp.py", line 2425, in make_Contraction
    sm += this[[ind_s]] * other[[ind_o]]
          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
  File "sage/structure/element.pyx", line 1504, in sage.structure.element.Element.__mul__
    return (<Element>left)._mul_(right)
  File "sage/structure/element.pyx", line 1550, in sage.structure.element.Element._mul_
    return python_op(other)
  File "/home/penguin/sage/src/sage/manifolds/scalarfield.py", line 2811, in _mul_
    result._express[chart] = self._express[chart] * other._express[chart]
                             ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
  File "sage/structure/element.pyx", line 1504, in sage.structure.element.Element.__mul__
    return (<Element>left)._mul_(right)
  File "sage/structure/element.pyx", line 1550, in sage.structure.element.Element._mul_
    return python_op(other)
  File "/home/penguin/sage/src/sage/manifolds/chart_func.py", line 1451, in _mul_
    res = self._simplify(self.expr() * other.expr())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/penguin/sage/src/sage/manifolds/chart_func.py", line 407, in _simplify
    res = self._calc_method.simplify(expr)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/penguin/sage/src/sage/manifolds/calculus_method.py", line 281, in simplify
    return self._simplify_dict[method](expression)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/penguin/sage/src/sage/manifolds/utilities.py", line 602, in simplify_chain_real
    expr = expr.simplify_factorial()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "sage/symbolic/expression.pyx", line 11218, in sage.symbolic.expression.Expression.simplify_factorial
    return self.parent()(self._maxima_().makefact().factcomb().minfactorial())
  File "sage/symbolic/expression.pyx", line 1228, in sage.symbolic.expression.Expression._maxima_
    return super()._interface_(maxima)
  File "sage/structure/sage_object.pyx", line 725, in sage.structure.sage_object.SageObject._interface_
    X = I(s)
  File "/home/penguin/sage/src/sage/interfaces/interface.py", line 299, in __call__
    return cls(self, x, name=name)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/penguin/sage/src/sage/interfaces/interface.py", line 751, 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)
Cell In[28], line 1
----> 1 eta_inv.contract(h)

File ~/sage/src/sage/manifolds/differentiable/tensorfield_paral.py:1826, in TensorFieldParal.contract(self, *args)
   1752 r"""
   1753 Contraction with another tensor field, on one or more indices.
   1754 
   (...)
   1822 
   1823 """
   1824 # This is to ensure the call to the TensorField version instead of
   1825 # the FreeModuleTensor one
-> 1826 return TensorField.contract(self, *args)

File ~/sage/src/sage/manifolds/differentiable/tensorfield.py:3412, in TensorField.contract(self, *args)
   3409 if ambient_dom_resu.is_manifestly_parallelizable():
   3410     # call of the FreeModuleTensor version:
   3411     args = pos1 + (other_r,) + pos2
-> 3412     return FreeModuleTensor.contract(self_r, *args)
   3413 com_dom = []
   3414 for dom in self_r._restrictions:

File ~/sage/src/sage/tensor/modules/free_module_tensor.py:2847, in FreeModuleTensor.contract(self, *args)
   2845     raise ValueError("no common basis for the contraction")
   2846 args = pos1 + (other._components[basis],) + pos2
-> 2847 cmp_res = self._components[basis].contract(*args)
   2848 if self._tensor_rank + other._tensor_rank - 2*ncontr == 0:
   2849     # Case of scalar output:
   2850     return cmp_res

File ~/sage/src/sage/tensor/modules/comp.py:2429, in Components.contract(self, *args)
   2426         local_res.append([ind, sm])
   2427     return local_res
-> 2429 for ii, val in make_Contraction(listParalInput):
   2430     for jj in val:
   2431         res[[jj[0]]] = jj[1]

File ~/sage/src/sage/parallel/multiprocessing_sage.py:77, in parallel_iter(processes, f, inputs)
     73 fp = pickle_function(f)
     75 result = p.imap_unordered(call_pickled_function,
     76                           [(fp, t) for t in inputs])
---> 77 yield from result
     78 p.close()
     79 p.join()

File ~/sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/multiprocessing/pool.py:873, in IMapIterator.next(self, timeout)
    871 if success:
    872     return value
--> 873 raise value

TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.
edit retag flag offensive close merge delete

Comments

Edited (correctly, I hope...) for legibility.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2024-08-20 14:12:37 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2024-08-20 11:33:27 +0200

eric_g gravatar image

updated 2024-08-20 11:36:09 +0200

Unfortunately, this is the long standing bug #27492: parallelized computations involving symbolic functions are failling in SageMath. In your case, the symbolic functions are introduced in the line h[i,j]=function(f'h{i}{j}')(t, x, y, z). If you switch off parallelization via

Parallelism().set(nproc=1)

there should be no issue (albeit the computation will be quite long...)

edit flag offensive delete link more

Comments

Thank you for your response. Are you aware of any other method I can use to speed up my calculations?

aneet gravatar imageaneet ( 2024-08-20 14:24:56 +0200 )edit
1

You could try to use a simplification chain lighter than the default one, since this is where most of the CPU time is spent. See https://doc.sagemath.org/html/en/refe...

eric_g gravatar imageeric_g ( 2024-08-21 10:04:55 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-08-20 10:56:27 +0200

Seen: 195 times

Last updated: Aug 20