Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HEPnOS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
HEP
HEPnOS
Commits
cd411b09
Commit
cd411b09
authored
Mar 13, 2020
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test of prefetcher for load/store of objects
parent
3f69eaf5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
test/LoadStoreTest.cpp
test/LoadStoreTest.cpp
+39
-0
test/LoadStoreTest.hpp
test/LoadStoreTest.hpp
+2
-0
No files found.
test/LoadStoreTest.cpp
View file @
cd411b09
...
...
@@ -447,3 +447,42 @@ void LoadStoreTest::testPrefetchLoadStore() {
}
}
}
void
LoadStoreTest
::
testAsyncPrefetchLoadStore
()
{
auto
root
=
datastore
->
root
();
auto
mds
=
root
.
createDataSet
(
"prefetch_run"
);
std
::
string
label
=
"key"
;
{
TestObjectA
obj_a
;
TestObjectB
obj_b
;
for
(
unsigned
i
=
0
;
i
<
20
;
i
++
)
{
obj_a
.
x
()
=
i
;
obj_a
.
y
()
=
2
*
i
;
obj_b
.
a
()
=
3
*
i
;
obj_b
.
b
()
=
"matthieu"
;
auto
r
=
mds
.
createRun
(
i
);
CPPUNIT_ASSERT
(
r
.
valid
());
r
.
store
(
label
,
obj_a
);
r
.
store
(
label
,
obj_b
);
}
}
{
// iterate through the dataset with a prefetcher
AsyncEngine
async
(
*
datastore
,
1
);
Prefetcher
p
(
*
datastore
,
async
);
p
.
fetchProduct
<
TestObjectA
>
(
label
);
p
.
fetchProduct
<
TestObjectB
>
(
label
);
unsigned
i
=
0
;
for
(
auto
&
run
:
p
(
mds
.
runs
()))
{
TestObjectA
obj_a
;
TestObjectB
obj_b
;
run
.
load
(
p
,
label
,
obj_a
);
run
.
load
(
p
,
label
,
obj_b
);
CPPUNIT_ASSERT
(
obj_a
.
x
()
==
i
);
CPPUNIT_ASSERT
(
obj_a
.
y
()
==
2
*
i
);
CPPUNIT_ASSERT
(
obj_b
.
a
()
==
3
*
i
);
CPPUNIT_ASSERT
(
obj_b
.
b
()
==
"matthieu"
);
i
+=
1
;
}
}
}
test/LoadStoreTest.hpp
View file @
cd411b09
...
...
@@ -19,6 +19,7 @@ class LoadStoreTest : public CppUnit::TestFixture
CPPUNIT_TEST
(
testAsyncLoadStoreSubRun
);
CPPUNIT_TEST
(
testAsyncLoadStoreEvent
);
CPPUNIT_TEST
(
testPrefetchLoadStore
);
CPPUNIT_TEST
(
testAsyncPrefetchLoadStore
);
CPPUNIT_TEST_SUITE_END
();
public:
...
...
@@ -36,6 +37,7 @@ class LoadStoreTest : public CppUnit::TestFixture
void
testAsyncLoadStoreSubRun
();
void
testAsyncLoadStoreEvent
();
void
testPrefetchLoadStore
();
void
testAsyncPrefetchLoadStore
();
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment