This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

get_lock IOError: [Errno 38] Function not implemented

+1 vote

Hello,

I have a bunch of Pyhton functions based on FEniCS which have been working nice for a long time in my pc. I decided to test them in a cluster. After I managed to compile and install FEniCS in the cluster (CentOS) using dorsal, I am getting the following error, for which I have no clue. Thank you very much for your help.

V = FunctionSpace(mesh, Element, Order)

File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/dolfin/functions/fu
nctionspace.py", line 468, in init
FunctionSpaceBase.init(self, mesh, element, constrained_domain)
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/dolfin/functions/fu
nctionspace.py", line 153, in init
ufc_element, ufc_dofmap = jit(self._ufl_element)
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/dolfin/compilemodul
es/jit.py", line 62, in mpi_jit
return local_jit(*args, **kwargs)
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/dolfin/compilemodul
es/jit.py", line 126, in jit
return jit_compile(form, parameters=p)
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py"
, line 75, in jit
return jit_element(ufl_object, parameters)
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py"
, line 186, in jit_element
compiled_form, module, form_data, prefix = jit_form(form, parameters)
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py"
, line 124, in jit_form
module_name + "_0") as lock:
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/instant/locking.py"
, line 161, in __enter__
self.lock = get_lock(self.cache_dir, self.module_name)
File "/scratch/corcoles/FEniCS/lib/python2.7/site-packages/instant/locking.py"
, line 102, in get_lock
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
IOError: [Errno 38] Function not implemented

asked Sep 17, 2014 by Juan Córcoles FEniCS Novice (250 points)

1 Answer

+1 vote
 
Best answer

It is the file locking that does not work. Your cluster might have disabled some functionality wrt files and locking. You might want to try install flufl.lock.

https://launchpad.net/flufl.lock

Johan

answered Sep 17, 2014 by johanhake FEniCS Expert (22,480 points)
selected Sep 17, 2014 by chris_richardson

Thank you very much, this worked like a charm. The scripts are now working, but I cannot get them to work under slurm sbatch. I've already contacted the cluster admin but maybe I'll send another question.

Thanks again.

Hi,

I just installed fenics 1.6 on a cluster and get the same error:

>>> V = FunctionSpace(mesh, 'CG', 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/dolfin/functions/functionspace.py", line 468, in __init__
    FunctionSpaceBase.__init__(self, mesh, element, constrained_domain)
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/dolfin/functions/functionspace.py", line 153, in __init__
    ufc_element, ufc_dofmap = jit(self._ufl_element, mpi_comm=mesh.mpi_comm())
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 64, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 128, in jit
    return form_compiler.jit(form, parameters=p)
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/ffc/jitcompiler.py", line 72, in jit
    return jit_element(ufl_object, parameters)
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/ffc/jitcompiler.py", line 180, in jit_element
    compiled_form, module, prefix = jit_form(form, parameters)
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/ffc/jitcompiler.py", line 115, in jit_form
    module_name + "_0") as lock:
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/instant/locking.py", line 161, in __enter__
    self.lock = get_lock(self.cache_dir, self.module_name)
  File "/home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages/instant/locking.py", line 102, in get_lock
    fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
IOError: [Errno 38] Function not implemented

However, flufl.lock is already installed:

% pip show flufl.lock   
---
Metadata-Version: 1.1
Name: flufl.lock
Version: 2.3.1
Summary: NFS-safe file locking with timeouts for POSIX systems
Home-page: http://launchpad.net/flufl.lock
Author: Barry Warsaw
Author-email: barry@python.org
License: LGPLv3
Location: /home/dnolte/.hashdist/bld/profile/bn2pqeeul7r2/lib/python2.7/site-packages
Requires: 

Any ideas? Thanks a lot!
David

...