def METHOD_NAME(mesh, tmpdir, variable_layers=False):
    # Parameters
    fname = os.path.join(str(tmpdir), "test_io_mesh_extrusion_dump.h5")
    fname = COMM_WORLD.bcast(fname, root=0)
    # Save mesh.
    v = _compute_integral(mesh)
    with CheckpointFile(fname, "w", comm=COMM_WORLD) as afile:
        afile.save_mesh(mesh)
    # Load -> Save -> Load ...
    ntimes = COMM_WORLD.size
    grank = COMM_WORLD.rank
    for i in range(ntimes):
        mycolor = (grank > ntimes - i)
        comm = COMM_WORLD.Split(color=mycolor, key=grank)
        if mycolor == 0:
            # Load.
            with CheckpointFile(fname, "r", comm=comm) as afile:
                mesh = afile.load_mesh(name=mesh_name)
            if variable_layers:
                # Check loaded layers equals computed layers
                layers = _compute_random_layers(mesh._base_mesh)
                layers[:, 1] += 1 + layers[:, 0]
                assert np.array_equal(mesh.topology.layers, layers)
            v1 = _compute_integral(mesh)
            assert abs(v1 - v) < 2.e-14
            # Save.
            with CheckpointFile(fname, "w", comm=comm) as afile:
                afile.save_mesh(mesh)