firedrakeproject / firedrake

Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)
https://firedrakeproject.org
Other
498 stars 157 forks source link

A problem about run code on supercomputer #2462

Closed tu1620808124 closed 2 years ago

tu1620808124 commented 2 years ago

Because we cannot use external networks on the supercomputers we use, the supercomputers administrator has installed firedrake using containers.However, we get the following error when running some of the code.

Traceback (most recent call last):
  File "/home/firedrake/firedrake/src/PyOP2/pyop2/caching.py", line 205, in __new__
    return cls._cache_lookup(key)
  File "/home/firedrake/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 71, in _cache_lookup
    return cls._cache.get((key, commkey)) or cls._read_from_disk(key, comm)
  File "/home/firedrake/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 92, in _read_from_disk
    raise KeyError(f"Object with key {key} not found")
KeyError: 'Object with key 2a300e6b8438ad78d09070fe944defb8 not found'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/public1/home/scg3287/para/exactsolution/test.py", line 102, in <module>
    icp = project(sin(2*pi*x)*sin(2*pi*y), V)
  File "PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "/home/firedrake/firedrake/src/firedrake/firedrake/adjoint/projection.py", line 33, in wrapper
    output = project(*args, **kwargs)
  File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 75, in project
    val = Projector(v, V, bcs=bcs, solver_parameters=solver_parameters,
  File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 172, in project
    self.apply_massinv(self.target, self.rhs)
  File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 217, in rhs
    self.assembler()
  File "/home/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 388, in assemble
    for parloop in self.parloops:
  File "/home/firedrake/firedrake/src/PyOP2/pyop2/utils.py", line 62, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/home/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 444, in parloops
    for lknl, gknl in zip(self.local_kernels, self.global_kernels))
  File "/home/firedrake/firedrake/src/PyOP2/pyop2/utils.py", line 62, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/home/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 421, in local_kernels
    return tsfc_interface.compile_form(self._form, "form", diagonal=self.diagonal,
File "PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "/home/firedrake/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 236, in compile_form
    kinfos = TSFCKernel(f, prefix, parameters,
  File "/home/firedrake/firedrake/src/PyOP2/pyop2/caching.py", line 208, in __new__
    cls._cache_store(key, obj)
  File "/home/firedrake/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 107, in _cache_store
    os.makedirs(os.path.join(cls._cachedir, shard), exist_ok=True)
  File "/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/home/firedrake/firedrake/.cache/tsfc/2a'
ead-only file system: '/home/firedrake/firedrake/.cache/tsff
c/2a

And this code runs on my personal computer with no errors.

danshapero commented 2 years ago

The code and object files that Firedrake generates have to live somewhere and it looks like the default directory on that system isn't writable. You can override where they get written by setting the environment variables PYOP2_CACHE_DIR and FIREDRAKE_TSFC_KERNEL_CACHE_DIR to a directory that is writable. Can you try that and see if it fixes the problem?

tu1620808124 commented 2 years ago

Thank you, the solution worked!