simetenn/uncertainpy

Conflict with firedrake import

handraqui opened this issue · 0 comments

I've been trying to use uncertainpy for uncertainty quantification over FEM methods with firedrake. I ran into a 'PETSC ERROR" thatI could isolate in the coffee_cup example. After running the model, at UQ.quantify, this appears:

`[0]PETSC ERROR: [0]PETSC ERROR: [...]
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end
[0]PETSC ERROR: [0]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end [...]
[0]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end
[0]PETSC ERROR: [0]PETSC ERROR: [0]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end [...]
[0]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end[...]
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: [0]PETSC ERROR: [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [...]
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: [0]PETSC ERROR: [0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
Try option -start_in_debugger or -on_error_attach_debugger [...]
or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: [0]PETSC ERROR: [0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: [0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
to get more information on the crash.
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
to get more information on the crash.
[0]PETSC ERROR: [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: [0]PETSC ERROR: to get more information on the crash.
to get more information on the crash.
configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: [0]PETSC ERROR: to get more information on the crash.
to get more information on the crash.
to get more information on the crash.
[0]PETSC ERROR: to get more information on the crash. [...]
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[unset]: [unset]: [unset]: [unset]: [unset]: [unset]: [unset]: PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
[unset]: PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
[unset]: PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
[unset]: PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
: [...]
system msg for write_line failure : Bad file descriptor
PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
: [...]
system msg for write_line failure : Bad file descriptor
[unset]: PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
system msg for write_line failure : Bad file descriptor
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[unset]: PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
system msg for write_line failure : Bad file descriptor
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 13 Broken Pipe: Likely while reading or writing to a socket
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[unset]: PMIU_write error; fd=-1 buf=:cmd=abort exitcode=59 message=application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
:
system msg for write_line failure : Bad file descriptor
Calculating PC for each feature: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 108.52it/s]
Calculating statistics from PCE: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.25s/it]
Saving data as: data/coffee_cup.h5
--- Logging error ---
Traceback (most recent call last):
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/multiprocess/managers.py", line 827, in _callmethod
conn = self._tls.connection
AttributeError: 'ForkAwareLocal' object has no attribute 'connection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/uncertainpy/utils/logger.py", line 128, in emit
self.send(s)
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/uncertainpy/utils/logger.py", line 108, in send
self.queue.put_nowait(s)
File "", line 2, in put_nowait
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/multiprocess/managers.py", line 831, in _callmethod
self._connect()
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/multiprocess/managers.py", line 818, in _connect
conn = self._Client(self._token.address, authkey=self._authkey)
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/multiprocess/connection.py", line 505, in Client
c = SocketClient(address)
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/multiprocess/connection.py", line 633, in SocketClient
s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused
Call stack:
File "Scripts/IsolatePETSCError/isolate_copy.py", line 197, in
data = UQ.quantify(seed = 10)
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/uncertainpy/uncertainty.py", line 415, in quantify
data = self.polynomial_chaos(uncertain_parameters=uncertain_parameters,
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/uncertainpy/uncertainty.py", line 721, in polynomial_chaos
self.save(filename, folder=data_folder)
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/uncertainpy/uncertainty.py", line 1230, in save
logger.info("Saving data as: {}".format(save_path))
File "/usr/lib/python3.8/logging/init.py", line 1446, in info
self._log(INFO, msg, args, **kwargs)
File "/usr/lib/python3.8/logging/init.py", line 1589, in _log
self.handle(record)
File "/usr/lib/python3.8/logging/init.py", line 1599, in handle
self.callHandlers(record)
File "/usr/lib/python3.8/logging/init.py", line 1661, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.8/logging/init.py", line 954, in handle
self.emit(record)
File "/home/users/henrique.aquino/firedrake/lib/python3.8/site-packages/uncertainpy/utils/logger.py", line 132, in emit
self.handleError(record)`

I cut some repeated parts. It turned out that this error happens only by importing firedrake. So, if, in the beginning of the coffee_cup file, I add
import firedrake as fd,
this error happens. Even importing like this, even if I don't use any fd.method at all. And my intention is to use firedrake if the main routine of my model.

I couldn't figure out if