Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selective synchronization #1589

Draft
wants to merge 29 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d770227
Add dynamic tag
fsimonis Jan 31, 2023
8c4c806
Mark received meshes as dynamic
fsimonis Feb 1, 2023
76b147f
Fix warning in config
fsimonis Feb 1, 2023
64575d6
Add tests for MeshContexts
fsimonis Feb 1, 2023
f871b6e
Fix initialize data tests
fsimonis Feb 1, 2023
6b917d8
Add unconditional synchronization
fsimonis Feb 1, 2023
b9fff97
Add cplscheme self-awareness
fsimonis Feb 3, 2023
e3be155
Add updateDynamicParticipants
fsimonis Feb 3, 2023
c666b97
Forward dynamicity to cplschemes
fsimonis Feb 7, 2023
ef21470
Only synchronize if required
fsimonis Feb 7, 2023
550b91a
Add tests for dynamic serial and parallel coupling
fsimonis Feb 7, 2023
3d2c9d7
Add tests dynamic tests for multicoupling
fsimonis Mar 2, 2023
b04ffcc
Fix determining what is dynamic
fsimonis Mar 2, 2023
3055f87
Wording
fsimonis Mar 2, 2023
4417e7d
Documentation
fsimonis Mar 2, 2023
1663c27
Refactor dynamicity calculation
fsimonis Mar 2, 2023
aef7e26
Attempt to simplify
fsimonis Mar 2, 2023
173483e
Reworked the synchronization
fsimonis Mar 5, 2023
5f42f69
Added explanation
fsimonis Mar 5, 2023
5cbdb69
Remove unused registerDynamicParticipant
fsimonis Mar 7, 2023
785e22d
Remove rest
fsimonis Mar 7, 2023
5eae155
Add transitive and dynamic meshtests
fsimonis Mar 7, 2023
7511281
Fix transitively received meshes not marked
fsimonis Mar 7, 2023
10059e3
Add a test for dynamic and direct access
fsimonis Mar 7, 2023
cd282fe
Remove stale comment
fsimonis Mar 29, 2023
119b4fb
Improve doc of getDynamicMeshMap
fsimonis Mar 29, 2023
446cd73
Extend doc
fsimonis Apr 20, 2023
202d7b0
Merge branch 'develop' into add-selective-synchronization
fsimonis Jun 20, 2023
a309611
Add simplified test method and multi tests
fsimonis Jun 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a test for dynamic and direct access
  • Loading branch information
fsimonis committed Mar 7, 2023
commit 10059e3ff89b183045e0bd26581a046c434060d8
39 changes: 39 additions & 0 deletions src/precice/tests/MeshContextTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,45 @@ BOOST_AUTO_TEST_CASE(ExchangeTransitive)
}
}

BOOST_AUTO_TEST_CASE(ExchangeDirectAccess)
{
PRECICE_TEST(1_rank);

config::Configuration config;
xml::ConfigurationContext cont{"A", 0, 1};
xml::configure(config.getXMLTag(),
cont,
context.prefix("meshcontext-direct.xml"));
auto participants = config.getSolverInterfaceConfiguration().getParticipantConfiguration()->getParticipants();

BOOST_REQUIRE(participants.size() == 2);

for (const auto &participant : participants) {
auto pname = participant->getName();
BOOST_REQUIRE(pname == "A" || pname == "B");
const auto &contexts = participant->usedMeshContexts();

for (const auto &context : contexts) {
auto meshName = context->mesh->getName();
BOOST_REQUIRE(meshName == "Dynamic");
using Dynamicity = precice::impl::MeshContext::Dynamicity;
if (pname == "A") {
if (meshName == "Dynamic") {
BOOST_TEST(context->provideMesh);
BOOST_TEST((context->dynamic == Dynamicity::Yes));
}
}
if (pname == "B") {
if (meshName == "Dynamic") {
BOOST_TEST(!context->provideMesh);
BOOST_TEST(context->allowDirectAccess);
BOOST_TEST((context->dynamic == Dynamicity::Yes));
}
}
}
}
}

BOOST_AUTO_TEST_CASE(Partial)
{
PRECICE_TEST(1_rank);
Expand Down
34 changes: 34 additions & 0 deletions src/precice/tests/meshcontext-direct.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<precice-configuration>
<solver-interface dimensions="2" experimental="true">
<data:scalar name="Data1" />
<data:scalar name="Data2" />

<mesh name="Dynamic">
<use-data name="Data1" />
<use-data name="Data2" />
</mesh>

<participant name="A">
<provide-mesh name="Dynamic" dynamic="true" />
<write-data name="Data1" mesh="Dynamic" />
<read-data name="Data2" mesh="Dynamic" />
</participant>

<participant name="B">
<receive-mesh name="Dynamic" from="A" direct-access="true" />
<write-data name="Data2" mesh="Dynamic" />
<read-data name="Data1" mesh="Dynamic" />
</participant>

<m2n:sockets from="A" to="B" />

<coupling-scheme:serial-explicit>
<participants first="A" second="B" />
<max-time-windows value="1" />
<time-window-size value="1.0" />
<exchange data="Data1" mesh="Dynamic" from="A" to="B" />
<exchange data="Data2" mesh="Dynamic" from="B" to="A" />
</coupling-scheme:serial-explicit>
</solver-interface>
</precice-configuration>