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

Function create_index_map

cpp/test/common/index_map.cpp:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 4

test_scatter_fwdFunction · 0.70
test_scatter_revFunction · 0.70
test_rank_splitFunction · 0.70
test_rank_weightsFunction · 0.70

Calls 2

IndexMapClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected