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
1d210aa6
Commit
1d210aa6
authored
14 years ago
by
Benjamin Lindner2
Browse files
Options
Downloads
Patches
Plain Diff
manual MPI serialization for database, params,sample unit test
parent
8da63594
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/mpi/wrapper.hpp
+24
-0
24 additions, 0 deletions
include/mpi/wrapper.hpp
src/mpi/wrapper.cpp
+43
-0
43 additions, 0 deletions
src/mpi/wrapper.cpp
with
67 additions
and
0 deletions
include/mpi/wrapper.hpp
0 → 100644
+
24
−
0
View file @
1d210aa6
/*
* This file is part of the software sassena
*
* Authors:
* Benjamin Lindner, ben@benlabs.net
*
* Copyright 2008-2010 Benjamin Lindner
*
*/
#ifndef MPI__WRAPPER_HPP_
#define MPI__WRAPPER_HPP_
#include
"boost/mpi.hpp"
namespace
mpi
{
namespace
wrapper
{
void
broadcast_stream
(
boost
::
mpi
::
communicator
&
comm
,
std
::
stringstream
&
stream
,
size_t
root
);
}
}
#endif
// end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mpi/wrapper.cpp
0 → 100644
+
43
−
0
View file @
1d210aa6
/*
* This file is part of the software sassena
*
* Authors:
* Benjamin Lindner, ben@benlabs.net
*
* Copyright 2008-2010 Benjamin Lindner
*
*/
// direct header
#include
<sstream>
#include
<boost/mpi.hpp>
using
namespace
std
;
namespace
mpi
{
namespace
wrapper
{
void
broadcast_stream
(
boost
::
mpi
::
communicator
&
comm
,
std
::
stringstream
&
stream
,
size_t
root
)
{
char
*
buffer
=
NULL
;
size_t
buffersize
=
0
;
if
(
comm
.
rank
()
==
root
)
{
buffer
=
const_cast
<
char
*>
(
stream
.
str
().
c_str
());
buffersize
=
stream
.
str
().
size
();
}
boost
::
mpi
::
broadcast
(
comm
,
&
buffersize
,
1
,
root
);
if
(
comm
.
rank
()
!=
root
)
{
buffer
=
(
char
*
)
malloc
(
buffersize
*
sizeof
(
char
));
}
boost
::
mpi
::
broadcast
(
comm
,
buffer
,
buffersize
,
root
);
if
(
comm
.
rank
()
!=
root
)
{
for
(
size_t
i
=
0
;
i
<
buffersize
;
++
i
)
stream
<<
buffer
[
i
];
free
(
buffer
);
}
}
}
}
// end of file
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