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

WIP: Make thread safe #1045

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bee5684
trying to use new tasks
jdolence Dec 11, 2023
e881ad9
Merge branch 'lroberts36/bugfix-sparse-cache' into jdolence/new_tasking
jdolence Dec 14, 2023
90f3e59
remove debugging
jdolence Dec 14, 2023
92564e1
formatting
jdolence Dec 14, 2023
6fde57d
remove raw mpi.hpp include
jdolence Dec 14, 2023
2320c0e
style
jdolence Dec 14, 2023
95818ba
more style
jdolence Dec 14, 2023
d602a35
and more style
jdolence Dec 14, 2023
10a67f1
ok thats enough
jdolence Dec 14, 2023
23803d0
actually remove the old task stuff
jdolence Dec 14, 2023
a4db040
formatting
jdolence Dec 14, 2023
8b7d42a
maybe last style commit...
jdolence Dec 14, 2023
52f0d5a
oops, includes inside parthenon namespace
jdolence Dec 14, 2023
e6eb2e3
update TaskID unit test
jdolence Dec 14, 2023
ce7a6bb
missing header
jdolence Dec 14, 2023
1ddc2e0
port the poisson examples
jdolence Dec 15, 2023
0bd54cf
try to fix serial builds
jdolence Dec 15, 2023
6082812
clean up branching in `|` operator of TaskID
jdolence Dec 15, 2023
07ae71a
rename Queue ThreadQueue
jdolence Dec 15, 2023
c1dbcb3
formatting
jdolence Dec 15, 2023
fbbe02a
try to fix builds with threads
jdolence Dec 15, 2023
d39a31a
update tasking docs
jdolence Dec 18, 2023
b074ee6
formatting and update changelog
jdolence Dec 18, 2023
829e047
address review comments
jdolence Jan 9, 2024
fc16f0f
merge develop
jdolence Jan 9, 2024
b400c11
style
jdolence Jan 9, 2024
9957538
add a comment about the dependent variable in Task
jdolence Jan 9, 2024
4842676
add locks to sparse pack caching
jdolence Jan 12, 2024
7faf25b
merge develop
jdolence Jan 12, 2024
7ce9ed5
move thread pool to utils
jdolence Jan 12, 2024
97874e0
add thread pool to driver/mesh
jdolence Jan 12, 2024
e9630b7
random intermediate commit
jdolence Mar 22, 2024
3e7ea4b
merge develop
jdolence Apr 4, 2024
e51f4db
seems to be thread safe -- advection example works
jdolence Apr 5, 2024
be1f029
crazy state
jdolence Apr 23, 2024
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
update TaskID unit test
jdolence committed Dec 14, 2023
commit e6eb2e3e84351343b616632837378913d4a8a416
36 changes: 11 additions & 25 deletions tst/unit/test_taskid.cpp
Original file line number Diff line number Diff line change
@@ -19,34 +19,20 @@

#include <catch2/catch.hpp>

#include "tasks/task_id.hpp"
#include "tasks/tasks.hpp"

using parthenon::Task;
using parthenon::TaskID;

TEST_CASE("Just check everything", "[CheckDependencies][SetFinished][equal][or]") {
TEST_CASE("Just check everything", "[|][GetIDs][empty]") {
GIVEN("Some TaskIDs") {
TaskID a(1);
TaskID b(2);
TaskID c(BITBLOCK + 1); // make sure we get a task with more than one block
TaskID complete;

TaskID ac = (a | c);
bool should_be_false = ac.CheckDependencies(b);
bool should_be_truea = ac.CheckDependencies(a);
bool should_be_truec = ac.CheckDependencies(c);
TaskID abc = (a | b | c);
complete.SetFinished(abc);
bool equal_true = (complete == abc);
bool equal_false = (complete == ac);

REQUIRE(should_be_false == false);
REQUIRE(should_be_truea == true);
REQUIRE(should_be_truec == true);
REQUIRE(equal_true == true);
REQUIRE(equal_false == false);

WHEN("a negative number is passed") {
REQUIRE_THROWS_AS(a.Set(-1), std::invalid_argument);
}
Task ta,tb;
TaskID a(&ta);
TaskID b(&tb);
TaskID c = a | b;
TaskID none;

REQUIRE(none.empty() == true);
REQUIRE(c.GetIDs().size() == 2);
}
}