Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Sage @fork parallel decorator causing issues with Singular
PostPosted: Wed Jan 01, 2020 10:10 pm 
Exception raised by child process with pid=1704:
Traceback (most recent call last):
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/parallel/use_fork.py", line 177, in __call__
self._subprocess(f, dir, *v0)
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/parallel/use_fork.py", line 302, in _subprocess
value = f(*args, **kwds)
File "<ipython-input-9-532b53e3019b>", line 167, in master
reduktion = reduction(polynomial)
File "<ipython-input-9-532b53e3019b>", line 94, in reduction
singular.set_ring(currentRing)
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/interfaces/singular.py", line 1098, in set_ring
self.eval("setring %s; short=0"%R.name(), allow_semicolon=True)
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/interfaces/singular.py", line 658, in eval
raise SingularError('Singular error:\n%s'%s)
SingularError: Singular error:
? sage1317 is no name of a ring/qring
? error occurred in or before STDIN line 11: `setring sage1317; short=0;`

I've been implementing parallelism on a program built in Sage MATH using its interface to Singular. I am attempting to use Sage's @fork parallel decorator, which seems to cause issues with Singular (this error does not occur if the decorator is not present). I'm very new to parallelism and am unsure what the issue here could be. Thanks for any and all help! :D


Report this post
Top
  
Reply with quote  
 Post subject: Re: Sage @fork parallel decorator causing issues with Singular
PostPosted: Fri Jan 10, 2020 4:00 pm 

Joined: Wed May 25, 2005 4:16 pm
Posts: 275
It seems that the ring for all the objects (sage1317 ) was defined in a different thread - and each thread strats a seperate Singular.
So the interafce should be changed: either define the rings in all threads or keep track of the threads whre a specific ring is defined
and - if it is needed in another thread - send the ring definition
instead of "setring ...;".


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Sage @fork parallel decorator causing issues with Singular
PostPosted: Fri Jan 10, 2020 6:11 pm 
Thanks for the clarification Hans!
If I follow you, I should just make sure all my initializations happen inside of the thread - rings, polynomials and such - and then I should be good to go.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 10:54 am
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group