Opened 5 years ago
Closed 5 years ago
#830 closed bug (not a bug)
rings returned via parallel.lib do not remember their objects
Reported by: | ren | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | 4-2-0 and higher |
Component: | dontKnow | Version: | 4-1-0 |
Keywords: | Cc: |
Description
While parallelizing my code for tropical geometry, I realized that rings returned from a function called via parallel.lib do not remember their members. Is this something that is easily fixable within the current framework?
proc ttt() { ring r; ideal I; export(I); return(r); } def r = ttt(); setring r; listvar(); // contains I LIB "parallel.lib"; list out = parallelWaitAll("ttt",list(list())); def s = out[1]; setring s; listvar(); // no I
Note: See
TracTickets for help on using
tickets.
No, it wouldn't be easy to change this and in fact, it is not supposed to work like this. The technical background is the following: The input data for parallel tasks usually doesn't need to be sent over Singular links. It is already "there" due to the fork mechanism (copy-on-write). In contrast to this, the output data must always be sent over a link. In your case, only the ring is sent, but not the ideal.
A possible solution is to use a newstruct as in the following code: