Problem reading mesh checkpoints (N-to-M) with adios4dolfinx

,

I am using

adios4dolfinx 0.8.1
fenics-basix 0.8.0
fenics-dolfinx 0.8.0
fenics-ffcx 0.8.0
fenics-ufl 2024.1.0

and I was running writing_mesh_checkpoint.py

There seem to be a problem running the

# ## Reading mesh checkpoints (N-to-M)
# We can now read the checkpoint on a different number of processes than we wrote it on.

with ipp.Cluster(engines="mpi", n=4, log_level=logging.ERROR) as cluster:
    # Write mesh to file
    cluster[:].push({"print_mesh_info": print_mesh_info})
    query = cluster[:].apply_async(read_mesh, mesh_file)
    query.wait()
    assert query.successful(), query.error
    print("".join(query.stdout))

section and here’s the Traceback:

Traceback (most recent call last):
  File "/home/xx/writing_mesh_checkpoint.py", line 142, in <module>
    assert query.successful(), query.error
AssertionError: [<RemoteError[ ]:TypeError(__init__(): incompatible function arguments. The following argument types are supported:
    1. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int) -> None
    2. __init__(self, element: basix::FiniteElement<double>) -> None
    3. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int, variant: int) -> None

Invoked with types: dolfinx.cpp.fem.CoordinateElement_float64, basix._basixcpp.FiniteElement_float64)>, <RemoteError[ ]:TypeError(__init__(): incompatible function arguments. The following argument types are supported:
    1. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int) -> None
    2. __init__(self, element: basix::FiniteElement<double>) -> None
    3. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int, variant: int) -> None

Invoked with types: dolfinx.cpp.fem.CoordinateElement_float64, basix._basixcpp.FiniteElement_float64)>, <RemoteError[ ]:TypeError(__init__(): incompatible function arguments. The following argument types are supported:
    1. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int) -> None
    2. __init__(self, element: basix::FiniteElement<double>) -> None
    3. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int, variant: int) -> None

Invoked with types: dolfinx.cpp.fem.CoordinateElement_float64, basix._basixcpp.FiniteElement_float64)>, <RemoteError[ ]:TypeError(__init__(): incompatible function arguments. The following argument types are supported:
    1. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int) -> None
    2. __init__(self, element: basix::FiniteElement<double>) -> None
    3. __init__(self, celltype: dolfinx.cpp.mesh.CellType, degree: int, variant: int) -> None

Invoked with types: dolfinx.cpp.fem.CoordinateElement_float64, basix._basixcpp.FiniteElement_float64)>]

I dont really understand the error, any help would be greatly appreciated
Please also note that I manually applied a patch to dolfinx as in post

I cannot reproduce this with:

docker run -ti --network=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/root/shared -w /root/shared --rm --shm-size=512m --entrypoint=/bin/bash ghcr.io/fenics/dolfinx/dolfinx:stable
python3 -m pip install adios4dolfinx==0.8.1
python3 -m pip install ipyparallel
python3 writing_mesh_checkpoint.py 

The error looks like incompatible versions of nanobind have been used to compile basix and DOLFINx.

Thanks for replying to me this quick! I have nanobind 1.8.0 installed (and have basix and dolfinx rebuilt and reinstalled afterwards). Also dolfinx seems to run with no problem at all (I’m using it in WSL2). What would you suggest me to do?

it might be that you are simply not calling the initializer in DOLFINx that adios4dolfinx uses to create coordinate elements.

As you can see from the error message, what adios4dolfinx is trying to do is to create a dolfinx.cpp.fem.CoordianteElement_float64:

I would need a reproducible environment to debug this further.
For instance a docker instruction set where you explain how you have installed the packages would be of help.

Thank you for your help. I haven’t used docker before but will look into it now. Thanks!

An example of how I use docker for testing is shown in:

where I base my code on the ghcr.io/fenics/dolfinx/dolfinx:nightly image, but this can be replaced with:
ghcr.io/fenics/test-env:v0.8.0-mpich and then you could add line by line the instructions you used to install dolfinx and depdencies (i.e. git clone, cmake, pip install etc).

I solved the problem by a fresh install of everything with Ubuntu PPA. I built almost all dependcies by hand before and I suppose it would be too hard to figure out where the problem is.