Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Are rings of integers incompatible with multiprocessing?

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