Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Buehlmann
GenericIO
Commits
cda87e9f
Commit
cda87e9f
authored
Aug 26, 2016
by
Hal Finkel
Browse files
The GIO write benchmark should not use completely trivial data (so compression is not trivial)
parent
72ac664b
Changes
1
Hide whitespace changes
Inline
Side-by-side
GenericIOBenchmarkWrite.cxx
View file @
cda87e9f
...
...
@@ -43,6 +43,7 @@
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <string>
#include <cassert>
...
...
@@ -56,6 +57,18 @@
using
namespace
std
;
using
namespace
gio
;
template
<
typename
T
>
struct
Generator
{
Generator
(
T
start
,
T
inc
)
:
value
(
start
),
inc
(
inc
)
{}
T
operator
()()
{
value
+=
inc
;
return
value
;
}
T
value
;
T
inc
;
};
int
main
(
int
argc
,
char
*
argv
[])
{
MPI_Init
(
&
argc
,
&
argv
);
...
...
@@ -119,14 +132,14 @@ int main(int argc, char *argv[]) {
id
.
resize
(
Np
+
GIO
.
requestedExtraSpace
()
/
sizeof
(
ID_T
));
mask
.
resize
(
Np
+
GIO
.
requestedExtraSpace
()
/
sizeof
(
MASK_T
));
std
::
fill
(
xx
.
begin
(),
xx
.
end
(),
25
);
std
::
fill
(
yy
.
begin
(),
yy
.
end
(),
25
);
std
::
fill
(
zz
.
begin
(),
zz
.
end
(),
25
);
std
::
fill
(
vx
.
begin
(),
vx
.
end
(),
25
);
std
::
fill
(
vy
.
begin
(),
vy
.
end
(),
25
);
std
::
fill
(
vz
.
begin
(),
vz
.
end
(),
25
);
std
::
fill
(
phi
.
begin
(),
phi
.
end
(),
25
);
std
::
fill
(
id
.
begin
(),
id
.
end
(),
25
);
std
::
generate
(
xx
.
begin
(),
xx
.
end
(),
Generator
<
POSVEL_T
>
(
25
,
3
)
);
std
::
generate
(
yy
.
begin
(),
yy
.
end
(),
Generator
<
POSVEL_T
>
(
25
,
3
)
);
std
::
generate
(
zz
.
begin
(),
zz
.
end
(),
Generator
<
POSVEL_T
>
(
25
,
3
)
);
std
::
generate
(
vx
.
begin
(),
vx
.
end
(),
Generator
<
POSVEL_T
>
(
25
,
3
)
);
std
::
generate
(
vy
.
begin
(),
vy
.
end
(),
Generator
<
POSVEL_T
>
(
25
,
3
)
);
std
::
generate
(
vz
.
begin
(),
vz
.
end
(),
Generator
<
POSVEL_T
>
(
25
,
3
)
);
std
::
generate
(
phi
.
begin
(),
phi
.
end
(),
Generator
<
POSVEL_T
>
(
25
,
3
)
);
std
::
generate
(
id
.
begin
(),
id
.
end
(),
Generator
<
ID_T
>
(
25
,
3
)
);
std
::
fill
(
mask
.
begin
(),
mask
.
end
(),
25
);
GIO
.
addVariable
(
"x"
,
xx
,
CoordFlagsX
|
GenericIO
::
VarHasExtraSpace
);
...
...
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