Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sassena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DAPHNE4NFDI
Sassena
Commits
8da63594
Commit
8da63594
authored
14 years ago
by
Benjamin Lindner2
Browse files
Options
Downloads
Patches
Plain Diff
manual MPI serialization for database, params,sample unit test
parent
96d933d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmake/CMakeLists.txt.executables
+2
-0
2 additions, 0 deletions
cmake/CMakeLists.txt.executables
cmake/CMakeLists.txt.intern
+9
-0
9 additions, 0 deletions
cmake/CMakeLists.txt.intern
tests/unit_broadcast.cpp
+9
-41
9 additions, 41 deletions
tests/unit_broadcast.cpp
with
20 additions
and
41 deletions
cmake/CMakeLists.txt.executables
+
2
−
0
View file @
8da63594
...
...
@@ -62,6 +62,8 @@ TARGET_LINK_LIBRARIES (unit_broadcast
sass_log
sass_controlio
sass_sample
sass_report
sass_mpi
${BOOST_LIBRARIES}
)
...
...
This diff is collapsed.
Click to expand it.
cmake/CMakeLists.txt.intern
+
9
−
0
View file @
8da63594
...
...
@@ -41,6 +41,10 @@ ADD_LIBRARY(sass_decomposition ${INTERNAL_LIBRARY_TYPE}
src/decomposition/decomposition_plan.cpp
)
ADD_LIBRARY(sass_mpi ${INTERNAL_LIBRARY_TYPE}
src/mpi/wrapper.cpp
)
ADD_LIBRARY(sass_report ${INTERNAL_LIBRARY_TYPE}
src/report/performance_analyzer.cpp
src/report/timer.cpp
...
...
@@ -72,6 +76,7 @@ SET_TARGET_PROPERTIES(sass_math PROPERTIES LINK_SEARCH_END_STATIC 1)
SET_TARGET_PROPERTIES(sass_log PROPERTIES LINK_SEARCH_END_STATIC 1)
SET_TARGET_PROPERTIES(sass_controlio PROPERTIES LINK_SEARCH_END_STATIC 1)
SET_TARGET_PROPERTIES(sass_report PROPERTIES LINK_SEARCH_END_STATIC 1)
SET_TARGET_PROPERTIES(sass_mpi PROPERTIES LINK_SEARCH_END_STATIC 1)
SET_TARGET_PROPERTIES(sass_decomposition PROPERTIES LINK_SEARCH_END_STATIC 1)
SET_TARGET_PROPERTIES(sass_scatter_devices PROPERTIES LINK_SEARCH_END_STATIC 1)
ENDIF(STATIC)
...
...
@@ -107,6 +112,10 @@ TARGET_LINK_LIBRARIES (sass_report
${Boost_LIBRARIES}
)
TARGET_LINK_LIBRARIES (sass_mpi
${Boost_LIBRARIES}
)
TARGET_LINK_LIBRARIES (sass_decomposition
sass_controlio
sass_sample
...
...
This diff is collapsed.
Click to expand it.
tests/unit_broadcast.cpp
+
9
−
41
View file @
8da63594
...
...
@@ -46,6 +46,7 @@
#include
"log.hpp"
#include
"report/performance_analyzer.hpp"
#include
"report/timer.hpp"
#include
"mpi/wrapper.hpp"
#include
"sample/sample.hpp"
#include
"scatter_devices/scatter_device_factory.hpp"
#include
"services.hpp"
...
...
@@ -249,79 +250,46 @@ int main(int argc,char* argv[]) {
if
(
world
.
rank
()
==
0
)
Info
::
Inst
()
->
write
(
"params... "
);
std
::
stringstream
paramsstream
;
char
*
paramsbuffer
=
NULL
;
size_t
paramsbuffersize
=
0
;
if
(
world
.
rank
()
==
0
)
{
boost
::
archive
::
text_oarchive
ar
(
paramsstream
);
ar
<<
*
params
;
paramsbuffer
=
const_cast
<
char
*>
(
paramsstream
.
str
().
c_str
());
paramsbuffersize
=
paramsstream
.
str
().
size
();
}
broadcast
(
world
,
&
params
buffersize
,
1
,
0
);
mpi
::
wrapper
::
broadcast
_stream
(
world
,
params
stream
,
0
);
if
(
world
.
rank
()
!=
0
)
{
paramsbuffer
=
(
char
*
)
malloc
(
paramsbuffersize
*
sizeof
(
char
));
}
broadcast
(
world
,
paramsbuffer
,
paramsbuffersize
,
0
);
if
(
world
.
rank
()
!=
0
)
{
std
::
stringstream
in
;
for
(
size_t
i
=
0
;
i
<
paramsbuffersize
;
++
i
)
in
<<
paramsbuffer
[
i
];
boost
::
archive
::
text_iarchive
ar
(
in
);
boost
::
archive
::
text_iarchive
ar
(
paramsstream
);
ar
>>
*
params
;
free
(
paramsbuffer
);
}
world
.
barrier
();
if
(
world
.
rank
()
==
0
)
Info
::
Inst
()
->
write
(
"database... "
);
std
::
stringstream
databasestream
;
char
*
databasebuffer
=
NULL
;
size_t
databasebuffersize
=
0
;
if
(
world
.
rank
()
==
0
)
{
boost
::
archive
::
text_oarchive
ar
(
databasestream
);
ar
<<
*
database
;
databasebuffer
=
const_cast
<
char
*>
(
databasestream
.
str
().
c_str
());
databasebuffersize
=
databasestream
.
str
().
size
();
}
broadcast
(
world
,
&
databasebuffersize
,
1
,
0
);
if
(
world
.
rank
()
!=
0
)
{
databasebuffer
=
(
char
*
)
malloc
(
databasebuffersize
*
sizeof
(
char
));
}
broadcast
(
world
,
database
buffer
,
databasebuffersize
,
0
);
mpi
::
wrapper
::
broadcast
_stream
(
world
,
database
stream
,
0
);
if
(
world
.
rank
()
!=
0
)
{
std
::
stringstream
in
;
for
(
size_t
i
=
0
;
i
<
databasebuffersize
;
++
i
)
in
<<
databasebuffer
[
i
];
boost
::
archive
::
text_iarchive
ar
(
in
);
boost
::
archive
::
text_iarchive
ar
(
databasestream
);
ar
>>
*
database
;
free
(
databasebuffer
);
}
world
.
barrier
();
if
(
world
.
rank
()
==
0
)
Info
::
Inst
()
->
write
(
"sample... "
);
std
::
stringstream
samplestream
;
char
*
samplebuffer
=
NULL
;
size_t
samplebuffersize
=
0
;
if
(
world
.
rank
()
==
0
)
{
boost
::
archive
::
text_oarchive
ar
(
samplestream
);
ar
<<
sample
;
samplebuffer
=
const_cast
<
char
*>
(
samplestream
.
str
().
c_str
());
samplebuffersize
=
samplestream
.
str
().
size
();
}
broadcast
(
world
,
&
sample
buffersize
,
1
,
0
);
mpi
::
wrapper
::
broadcast
_stream
(
world
,
sample
stream
,
0
);
if
(
world
.
rank
()
!=
0
)
{
samplebuffer
=
(
char
*
)
malloc
(
samplebuffersize
*
sizeof
(
char
));
}
broadcast
(
world
,
samplebuffer
,
samplebuffersize
,
0
);
if
(
world
.
rank
()
!=
0
)
{
std
::
stringstream
in
;
for
(
size_t
i
=
0
;
i
<
samplebuffersize
;
++
i
)
in
<<
samplebuffer
[
i
];
boost
::
archive
::
text_iarchive
ar
(
in
);
boost
::
archive
::
text_iarchive
ar
(
samplestream
);
ar
>>
sample
;
free
(
samplebuffer
);
}
world
.
barrier
();
timer
.
stop
(
"sample::communication"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment