MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / create_index_map

Function create_index_map

cpp/test/graph.cpp:19–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17namespace
18{
19common::IndexMap create_index_map(MPI_Comm comm, int size_local, int num_ghosts)
20{
21 const int mpi_size = dolfinx::MPI::size(comm);
22 const int mpi_rank = dolfinx::MPI::rank(comm);
23
24 // Create some ghost entries on next process
25 std::vector<std::int64_t> ghosts(num_ghosts);
26 for (int i = 0; i < num_ghosts; ++i)
27 ghosts[i] = (mpi_rank + 1) % mpi_size * size_local + i;
28
29 std::vector<int> global_ghost_owner(ghosts.size(), (mpi_rank + 1) % mpi_size);
30
31 // Create an IndexMap
32 return common::IndexMap(MPI_COMM_WORLD, size_local, ghosts,
33 global_ghost_owner);
34}
35
36void test_adjacency_list_create()
37{

Callers 1

test_comm_graphsFunction · 0.70

Calls 2

IndexMapClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected