Are rings of integers incompatible with multiprocessing?

asked 2022-12-12 07:45:40 +0200

Alex Karenin gravatar image

The code below crashen on sage 9.5:

from multiprocessing import Pool
def print_stuff(stuff):
    print(stuff)      
pool = Pool(processes = 1 )  #make a pool objects
K.<z> = CyclotomicField(16)
OK = K.ring_of_integers()
task = pool.apply_async( print_stuff, (OK, ) )   #load the tasks into the list   
outputs = task.get() #complete the tasks
print(outputs)  #print the outputs

Am I handling rings of integers wrong? How can I access them in parallel without recomputing? The message ends with:

  File "sage/matrix/matrix_integer_dense.pyx", line 2066, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.echelon_form (build/cythonized/sage/matrix/matrix_integer_dense.cpp:18127)
  File "sage/matrix/matrix_integer_dense.pyx", line 5744, in sage.matrix.matrix_integer_dense.Matrix_integer_dense._hnf_pari (build/cythonized/sage/matrix/matrix_integer_dense.cpp:47633)
cysignals.signals.SignalError: Segmentation fault
edit retag flag offensive close merge delete

Comments

Something is wrong with your sage as the code runs without an issue at sagecell.

Max Alekseyev gravatar imageMax Alekseyev ( 2022-12-12 12:31:39 +0200 )edit

The copy-pasted code works also fine in 9.8.beta5. You should rather give us a truely failing code, not a too much simplified version.

FrédéricC gravatar imageFrédéricC ( 2022-12-12 17:27:02 +0200 )edit

Which operating system ? how did you install sage ? Can you try to upgrade to 9.7 or 9.8.beta5 ?

FrédéricC gravatar imageFrédéricC ( 2022-12-13 09:10:58 +0200 )edit