Skip to content

Commit

Permalink
pre-post receives
Browse files Browse the repository at this point in the history
  • Loading branch information
MoraruMaxim committed Apr 15, 2024
1 parent 72a95c7 commit 0f9b8ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions benchmarks/burgers/burgers.pin
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# the public, perform publicly and display publicly, and to permit others to do so.
# ========================================================================================

<parthenon/comm>
prepost_recvs = 1

<parthenon/job>
problem_id = burgers

Expand Down
12 changes: 11 additions & 1 deletion src/mesh/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ Mesh::Mesh(ParameterInput *pin, ApplicationInput *app_in, Packages_t &packages,
RegionSize block_size;
BoundaryFlag block_bcs[6];
std::int64_t nbmax;

// Should we pre-post receives in `Mesh::Initialize`?
pin->GetOrAddBoolean("parthenon/comm","prepost_recvs",false);

// mesh test
if (mesh_test > 0) Globals::nranks = mesh_test;
Expand Down Expand Up @@ -1010,7 +1013,14 @@ void Mesh::Initialize(bool init_problem, ParameterInput *pin, ApplicationInput *
BuildGMGBoundaryBuffers(mdg);
}
}

// Pre-post the receives
if(pin->GetBoolean("parthenon/comm","prepost_recvs")){
for (int i = 0; i < num_partitions; i++) {
auto &md = mesh_data.GetOrAdd("base", i);
StartReceiveBoundaryBuffers(md);
}
}

std::vector<bool> sent(num_partitions, false);
bool all_sent;
std::int64_t send_iters = 0;
Expand Down

0 comments on commit 0f9b8ce

Please sign in to comment.