Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADIOS2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
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
Podhorszki, Norbert
ADIOS2
Commits
e79fc480
Commit
e79fc480
authored
7 years ago
by
Podhorszki, Norbert
Browse files
Options
Downloads
Patches
Plain Diff
Fix heatTransfer codes for refactored classes
parent
d96fd39f
No related branches found
No related tags found
1 merge request
!124
Refactor
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/heatTransfer/write/IO_adios2.cpp
+6
-6
6 additions, 6 deletions
examples/heatTransfer/write/IO_adios2.cpp
examples/heatTransfer/write/IO_ph5_adios2.cpp
+10
-12
10 additions, 12 deletions
examples/heatTransfer/write/IO_ph5_adios2.cpp
with
16 additions
and
18 deletions
examples/heatTransfer/write/IO_adios2.cpp
+
6
−
6
View file @
e79fc480
...
...
@@ -28,8 +28,8 @@ IO::IO(const Settings &s, MPI_Comm comm)
// Define method for engine creation
adios
::
IO
&
bp
WriterSettings
=
ad
->
DeclareIO
(
"output"
);
if
(
!
bp
WriterSettings
.
InConfigFile
())
adios
::
IO
&
bp
io
=
ad
->
DeclareIO
(
"output"
);
if
(
!
bp
io
.
InConfigFile
())
{
// if not defined by user, we can change the default settings
// BPFileWriter is the default engine
...
...
@@ -39,11 +39,11 @@ IO::IO(const Settings &s, MPI_Comm comm)
// Passing parameters to the transport
}
varGndx
=
&
bp
WriterSettings
.
DefineVariable
<
unsigned
int
>
(
"gndx"
);
bp
WriterSettings
.
DefineVariable
<
unsigned
int
>
(
"gndy"
);
varGndx
=
&
bp
io
.
DefineVariable
<
unsigned
int
>
(
"gndx"
);
bp
io
.
DefineVariable
<
unsigned
int
>
(
"gndy"
);
// define T as 2D global array
varT
=
&
bp
WriterSettings
.
DefineVariable
<
double
>
(
varT
=
&
bp
io
.
DefineVariable
<
double
>
(
"T"
,
// Global dimensions
{
s
.
gndx
,
s
.
gndy
},
...
...
@@ -58,7 +58,7 @@ IO::IO(const Settings &s, MPI_Comm comm)
// varT.AddTransform( tr,"accuracy=0.001" ); // for ZFP
bpWriter
=
bp
WriterSettings
.
Open
(
m_outputfilename
,
adios
::
OpenMode
::
w
,
comm
);
bp
io
.
Open
(
m_outputfilename
,
adios
::
OpenMode
::
w
,
comm
);
if
(
!
bpWriter
)
{
...
...
This diff is collapsed.
Click to expand it.
examples/heatTransfer/write/IO_ph5_adios2.cpp
+
10
−
12
View file @
e79fc480
...
...
@@ -24,46 +24,44 @@ IO::IO(const Settings &s, MPI_Comm comm)
{
rank_saved
=
s
.
rank
;
m_outputfilename
=
s
.
outputfile
+
".h5"
;
// adios::ADIOS adios(comm, adios::Verbose::INFO, false);
ad
=
new
adios
::
ADIOS
(
comm
,
adios
::
Verbose
::
INFO
,
false
);
ad
=
new
adios
::
ADIOS
(
comm
,
adios
::
DebugOFF
);
// Define method for engine creation
// 1. Get method def from config file or define new one
adios
::
Method
&
h5writerSettings
=
ad
->
Declare
Method
(
"output"
);
if
(
!
h5
writerSettings
.
IsUserDefined
())
adios
::
IO
&
h5io
=
ad
->
Declare
IO
(
"output"
);
if
(
!
h5
io
.
InConfigFile
())
{
// if not defined by user, we can change the default settings
// BPFileWriter is the default engine
h5
writerSettings
.
SetEngine
(
"HDF5Writer"
);
h5
io
.
SetEngine
(
"HDF5Writer"
);
// Allow an extra thread for data processing
const
std
::
string
aggregatorsParam
(
"Aggregators="
+
std
::
to_string
((
s
.
nproc
+
1
)
/
2
));
h5writerSettings
.
SetParameters
(
"have_metadata_file=yes"
,
aggregatorsParam
);
h5io
.
SetParameters
(
"have_metadata_file=yes"
,
aggregatorsParam
);
}
// ad->DefineScalar<unsigned int>("gndx", true);
varGndx
=
&
(
ad
->
DefineVariable
<
unsigned
int
>
(
"gndx"
)
)
;
ad
->
DefineVariable
<
unsigned
int
>
(
"gndy"
);
varGndx
=
&
h5io
.
DefineVariable
<
unsigned
int
>
(
"gndx"
);
h5io
.
DefineVariable
<
unsigned
int
>
(
"gndy"
);
// define T as 2D global array
varT
=
&
(
ad
->
Define
Array
<
double
>
(
varT
=
&
h5io
.
Define
Variable
<
double
>
(
"T"
,
// Global dimensions
{
s
.
gndx
,
s
.
gndy
},
// starting offset of the local array in the global space
{
s
.
offsx
,
s
.
offsy
},
// local size, could be defined later using SetSelection()
{
s
.
ndx
,
s
.
ndy
})
)
;
{
s
.
ndx
,
s
.
ndy
});
// add transform to variable
// adios::Transform tr = adios::transform::BZIP2( );
// varT.AddTransform( tr, "" );
// varT.AddTransform( tr,"accuracy=0.001" ); // for ZFP
h5writer
=
ad
->
Open
(
m_outputfilename
,
"w"
,
comm
,
h5writerSettings
);
h5writer
=
h5io
.
Open
(
m_outputfilename
,
adios
::
OpenMode
::
w
,
comm
);
if
(
h5writer
==
nullptr
)
throw
std
::
ios_base
::
failure
(
"ERROR: failed to open ADIOS h5writer
\n
"
);
...
...
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