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

Partition mesh on single process

0 votes

I am coding up a parallel algorithm in which each processor has a copy of a mesh. Each processor then identifies a subset of the cells in this coarse mesh as its 'home domain.' The home domains should be distinct and cover the whole coarse mesh.
I want to know how I can partition the mesh on each processor to identify home domains by leveraging the mesh partitioning already implemented in fenics. It is as if I want to parallelize a local mesh: I want to calculate which cells should be owned by each processor, but don't want to actually redistribute these cells.
Bellow is a minimal working example for what I'm trying right now (I'm running on 4 mpi processes). This does not give the desired result, however: cell_partition ends up only splitting the mesh between 2 processes in each case (e.g. on rank 0, the mesh is partitioned between only ranks 0 and 1). Is there a way to tweak this to get what I want (or a different way altogether which works better)?
Thanks.

    // Initialize some coarse mesh on each processor
    UnitSquareMesh mesh(MPI_COMM_SELF,2,2);
    // Get partitioning of this coarse mesh to determine home turf
    SCOTCH scotch;
    std::vector<std::size_t> cell_partition;
    std::map<std::size_t, dolfin::Set<unsigned int>> ghost_procs;
    LocalMeshData mesh_data(MPI_COMM_WORLD);
    mesh_data.extract_mesh_data(mesh);
    scotch.compute_partition(MPI_COMM_WORLD, cell_partition, ghost_procs, mesh_data);
asked Jan 28, 2016 by wayne.b.mitchell FEniCS Novice (160 points)

1 Answer

0 votes

Yes, this is something on the radar... at the moment, the cells are divided according to the number of processes. This could be an argument to the cell partitioning routine instead.

If you raise an issue on bitbucket, it might rise up the agenda ...

answered Jan 29, 2016 by chris_richardson FEniCS Expert (31,740 points)
...