Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-alugrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-alugrid
Commits
5e9961b1
Commit
5e9961b1
authored
12 years ago
by
Martin Nolte
Browse files
Options
Downloads
Patches
Plain Diff
make headercheck pass
parent
cdbb5d0d
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
dune/alugrid/src/serial/Makefile.am
+2
-0
2 additions, 0 deletions
dune/alugrid/src/serial/Makefile.am
dune/alugrid/src/serial/serialize.h
+24
-22
24 additions, 22 deletions
dune/alugrid/src/serial/serialize.h
with
26 additions
and
22 deletions
dune/alugrid/src/serial/Makefile.am
+
2
−
0
View file @
5e9961b1
EXTRA_DIST
=
gitter_geo.cc gitter_impl.cc gitter_mgb.cc gitter_sti.cc mapp_cube_3d.cc
\
EXTRA_DIST
=
gitter_geo.cc gitter_impl.cc gitter_mgb.cc gitter_sti.cc mapp_cube_3d.cc
\
mapp_tetra_3d.cc myalloc.cc ghost_elements.cc ghost_info.cc
\
mapp_tetra_3d.cc myalloc.cc ghost_elements.cc ghost_info.cc
\
gitter_hexa_top.cc gitter_tetra_top.cc
gitter_hexa_top.cc gitter_tetra_top.cc
include
$(top_srcdir)/am/global-rules
This diff is collapsed.
Click to expand it.
dune/alugrid/src/serial/serialize.h
+
24
−
22
View file @
5e9961b1
...
@@ -5,8 +5,11 @@
...
@@ -5,8 +5,11 @@
#define SERIALIZE_H_INCLUDED
#define SERIALIZE_H_INCLUDED
#include
<cassert>
#include
<cassert>
#include
<cstdio>
#include
<cstdlib>
#include
<cstdlib>
#include
<cstring>
#include
<cstring>
#include
<string>
#include
<utility>
class
ObjectStream
;
class
ObjectStream
;
...
@@ -199,10 +202,10 @@ public:
...
@@ -199,10 +202,10 @@ public:
// make sure that char has size of 1,
// make sure that char has size of 1,
// otherwise check doExchange in mpAccess_MPI.cc
// otherwise check doExchange in mpAccess_MPI.cc
char
*
buffer
=
(
char
*
)
malloc
(
newSize
*
sizeof
(
char
))
;
char
*
buffer
=
(
char
*
)
malloc
(
newSize
*
sizeof
(
char
))
;
if
(
!
buffer
)
if
(
!
buffer
)
{
{
perror
(
"**EXCEPTION in ObjectStream
::
allocateBuffer(size_t) "
)
;
perror
(
"**EXCEPTION in ObjectStream::allocateBuffer(
size_t
) "
)
;
throw
OutOfMemoryException
()
;
throw
OutOfMemoryException
();
}
}
return
buffer
;
return
buffer
;
}
}
...
@@ -309,7 +312,8 @@ protected:
...
@@ -309,7 +312,8 @@ protected:
}
;
}
;
// bufchunk 0.25 Megabyte
// bufchunk 0.25 Megabyte
class
ObjectStream
:
public
ObjectStreamImpl
class
ObjectStream
:
public
ObjectStreamImpl
{
{
typedef
ObjectStreamImpl
BaseType
;
typedef
ObjectStreamImpl
BaseType
;
...
@@ -319,38 +323,36 @@ class ObjectStream : public ObjectStreamImpl
...
@@ -319,38 +323,36 @@ class ObjectStream : public ObjectStreamImpl
// true if object stream was not set
// true if object stream was not set
bool
notReceived_
;
bool
notReceived_
;
public
:
public
:
// ENDOFSTREAM should be in range of char, i.e. 0 to 256
// ENDOFSTREAM should be in range of char, i.e. 0 to 256
// and not conflict with refinement rules in gitter_sti.h
// and not conflict with refinement rules in gitter_sti.h
static
const
char
ENDOFSTREAM
=
127
;
static
const
char
ENDOFSTREAM
=
127
;
// create empty object stream
// create empty object stream
inline
ObjectStream
()
ObjectStream
()
:
BaseType
(
BufChunk
),
:
BaseType
(
BufChunk
),
notReceived_
(
true
)
notReceived_
(
true
)
{
{}
}
// create empty object stream with given chunk size
// create empty object stream with given chunk size
explicit
ObjectStream
(
const
size_t
chunkSize
)
explicit
ObjectStream
(
const
std
::
size_t
chunkSize
)
:
BaseType
(
chunkSize
),
:
BaseType
(
chunkSize
),
notReceived_
(
true
)
notReceived_
(
true
)
{
{}
}
// copy constructor
// copy constructor
inline
ObjectStream
(
const
ObjectStream
&
os
)
ObjectStream
(
const
ObjectStream
&
os
)
:
BaseType
(
os
),
:
BaseType
(
static_cast
<
const
BaseType
&
>
(
os
)
),
notReceived_
(
true
)
notReceived_
(
true
)
{}
{}
public
:
public
:
// assigment of streams, owner ship of buffer is
// assigment of streams, owner ship of buffer is
// passed from os to this stream to avoid copy of large memory areas
// passed from os to this stream to avoid copy of large memory areas
inline
ObjectStream
&
operator
=
(
const
ObjectStream
&
os
)
ObjectStream
&
operator
=
(
const
ObjectStream
&
os
)
{
{
BaseType
::
operator
=
(
os
);
static_cast
<
BaseType
&
>
(
*
this
)
=
static_cast
<
const
BaseType
&
>
(
os
);
notReceived_
=
os
.
notReceived_
;
notReceived_
=
os
.
notReceived_
;
return
*
this
;
return
*
this
;
}
}
...
@@ -368,10 +370,10 @@ protected:
...
@@ -368,10 +370,10 @@ protected:
// assign pair of char buffer and size to this object stream
// assign pair of char buffer and size to this object stream
// osvec will contain zeros after that assignment
// osvec will contain zeros after that assignment
// used by mpAccess_MPI.cc
// used by mpAccess_MPI.cc
ObjectStream
&
operator
=
(
std
::
pair
<
char
*
,
int
>
&
osvec
)
ObjectStream
&
operator
=
(
std
::
pair
<
char
*
,
int
>
&
osvec
)
{
{
BaseType
::
removeObj
();
BaseType
::
removeObj
();
BaseType
::
assign
(
osvec
.
first
,
osvec
.
second
);
BaseType
::
assign
(
osvec
.
first
,
osvec
.
second
);
// reset osvec
// reset osvec
osvec
.
first
=
0
;
osvec
.
first
=
0
;
osvec
.
second
=
0
;
osvec
.
second
=
0
;
...
...
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