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
3738a897
Commit
3738a897
authored
7 years ago
by
Podhorszki, Norbert
Browse files
Options
Downloads
Patches
Plain Diff
Fix up ADIOS1Reader to at least compile the whole code base. It does no reading yet.
parent
ab7a714b
No related branches found
No related tags found
1 merge request
!55
Method.SetIOMode(); updates to ADIOS1Reader to make code base compile
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/engine/adios1/ADIOS1Reader.h
+2
-0
2 additions, 0 deletions
include/engine/adios1/ADIOS1Reader.h
source/engine/adios1/ADIOS1Reader.cpp
+36
-65
36 additions, 65 deletions
source/engine/adios1/ADIOS1Reader.cpp
with
38 additions
and
65 deletions
include/engine/adios1/ADIOS1Reader.h
+
2
−
0
View file @
3738a897
...
@@ -101,6 +101,8 @@ public:
...
@@ -101,6 +101,8 @@ public:
private:
private:
void
Init
();
///< called from constructor, gets the selected ADIOS1
void
Init
();
///< called from constructor, gets the selected ADIOS1
/// transport method from settings
/// transport method from settings
void
InitParameters
();
void
InitTransports
();
template
<
class
T
>
template
<
class
T
>
Variable
<
T
>
*
InquireVariableCommon
(
const
std
::
string
&
name
,
Variable
<
T
>
*
InquireVariableCommon
(
const
std
::
string
&
name
,
...
...
This diff is collapsed.
Click to expand it.
source/engine/adios1/ADIOS1Reader.cpp
+
36
−
65
View file @
3738a897
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
* Distributed under the OSI-approved Apache License, Version 2.0. See
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
* accompanying file Copyright.txt for details.
*
*
*
BPFile
Reader.cpp
*
ADIOS1
Reader.cpp
*
*
* Created on: Feb 27, 2017
* Created on: Feb 27, 2017
* Author: wfg
* Author: wfg
*/
*/
#include
"engine/adios1/ADIOS1Reader.h"
#include
"core/Support.h"
#include
"core/Support.h"
#include
"engine/bp/BPFileReader.h"
#include
"functions/adiosFunctions.h"
// CSVToVector
#include
"functions/adiosFunctions.h"
// CSVToVector
#include
"transport/file/FStream.h"
// uses C++ fstream
#include
"transport/file/FStream.h"
// uses C++ fstream
#include
"transport/file/FileDescriptor.h"
// uses POSIX
#include
"transport/file/FileDescriptor.h"
// uses POSIX
...
@@ -21,127 +21,128 @@ namespace adios
...
@@ -21,127 +21,128 @@ namespace adios
ADIOS1Reader
::
ADIOS1Reader
(
ADIOS
&
adios
,
const
std
::
string
&
name
,
ADIOS1Reader
::
ADIOS1Reader
(
ADIOS
&
adios
,
const
std
::
string
&
name
,
const
std
::
string
accessMode
,
MPI_Comm
mpiComm
,
const
std
::
string
accessMode
,
MPI_Comm
mpiComm
,
const
Method
&
method
)
const
Method
&
method
)
:
Engine
(
adios
,
"
BPFile
Reader"
,
name
,
accessMode
,
mpiComm
,
method
,
:
Engine
(
adios
,
"
ADIOS1
Reader"
,
name
,
accessMode
,
mpiComm
,
method
,
"
BPFile
Reader constructor (or call to ADIOS Open).
\n
"
)
"
ADIOS1
Reader constructor (or call to ADIOS Open).
\n
"
)
{
{
Init
();
Init
();
adios_read_init_method
(
read_method
,
mpiComm
,
""
);
}
}
BPFile
Reader
::~
BPFile
Reader
()
{}
ADIOS1
Reader
::~
ADIOS1
Reader
()
{}
Variable
<
void
>
*
Variable
<
void
>
*
BPFile
Reader
::
InquireVariable
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariable
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
// not yet implemented
const
bool
readIn
)
// not yet implemented
{
{
return
nullptr
;
return
nullptr
;
}
}
Variable
<
char
>
*
Variable
<
char
>
*
BPFile
Reader
::
InquireVariableChar
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableChar
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
char
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
char
>
(
variableName
,
readIn
);
}
}
Variable
<
unsigned
char
>
*
Variable
<
unsigned
char
>
*
BPFile
Reader
::
InquireVariableUChar
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableUChar
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
unsigned
char
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
unsigned
char
>
(
variableName
,
readIn
);
}
}
Variable
<
short
>
*
Variable
<
short
>
*
BPFile
Reader
::
InquireVariableShort
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableShort
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
short
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
short
>
(
variableName
,
readIn
);
}
}
Variable
<
unsigned
short
>
*
Variable
<
unsigned
short
>
*
BPFile
Reader
::
InquireVariableUShort
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableUShort
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
unsigned
short
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
unsigned
short
>
(
variableName
,
readIn
);
}
}
Variable
<
int
>
*
BPFile
Reader
::
InquireVariableInt
(
const
std
::
string
&
variableName
,
Variable
<
int
>
*
ADIOS1
Reader
::
InquireVariableInt
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
int
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
int
>
(
variableName
,
readIn
);
}
}
Variable
<
unsigned
int
>
*
Variable
<
unsigned
int
>
*
BPFile
Reader
::
InquireVariableUInt
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableUInt
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
unsigned
int
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
unsigned
int
>
(
variableName
,
readIn
);
}
}
Variable
<
long
int
>
*
Variable
<
long
int
>
*
BPFile
Reader
::
InquireVariableLInt
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableLInt
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
long
int
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
long
int
>
(
variableName
,
readIn
);
}
}
Variable
<
unsigned
long
int
>
*
Variable
<
unsigned
long
int
>
*
BPFile
Reader
::
InquireVariableULInt
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableULInt
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
unsigned
long
int
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
unsigned
long
int
>
(
variableName
,
readIn
);
}
}
Variable
<
long
long
int
>
*
Variable
<
long
long
int
>
*
BPFile
Reader
::
InquireVariableLLInt
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableLLInt
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
long
long
int
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
long
long
int
>
(
variableName
,
readIn
);
}
}
Variable
<
unsigned
long
long
int
>
*
Variable
<
unsigned
long
long
int
>
*
BPFile
Reader
::
InquireVariableULLInt
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableULLInt
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
unsigned
long
long
int
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
unsigned
long
long
int
>
(
variableName
,
readIn
);
}
}
Variable
<
float
>
*
Variable
<
float
>
*
BPFile
Reader
::
InquireVariableFloat
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableFloat
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
float
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
float
>
(
variableName
,
readIn
);
}
}
Variable
<
double
>
*
Variable
<
double
>
*
BPFile
Reader
::
InquireVariableDouble
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableDouble
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
double
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
double
>
(
variableName
,
readIn
);
}
}
Variable
<
long
double
>
*
Variable
<
long
double
>
*
BPFile
Reader
::
InquireVariableLDouble
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableLDouble
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
long
double
>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
long
double
>
(
variableName
,
readIn
);
}
}
Variable
<
std
::
complex
<
float
>>
*
Variable
<
std
::
complex
<
float
>>
*
BPFile
Reader
::
InquireVariableCFloat
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableCFloat
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
std
::
complex
<
float
>>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
std
::
complex
<
float
>>
(
variableName
,
readIn
);
}
}
Variable
<
std
::
complex
<
double
>>
*
Variable
<
std
::
complex
<
double
>>
*
BPFile
Reader
::
InquireVariableCDouble
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableCDouble
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
std
::
complex
<
double
>>
(
variableName
,
readIn
);
return
InquireVariableCommon
<
std
::
complex
<
double
>>
(
variableName
,
readIn
);
}
}
Variable
<
std
::
complex
<
long
double
>>
*
Variable
<
std
::
complex
<
long
double
>>
*
BPFile
Reader
::
InquireVariableCLDouble
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableCLDouble
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
InquireVariableCommon
<
std
::
complex
<
long
double
>>
(
variableName
,
return
InquireVariableCommon
<
std
::
complex
<
long
double
>>
(
variableName
,
...
@@ -149,31 +150,34 @@ BPFileReader::InquireVariableCLDouble(const std::string &variableName,
...
@@ -149,31 +150,34 @@ BPFileReader::InquireVariableCLDouble(const std::string &variableName,
}
}
VariableCompound
*
VariableCompound
*
BPFile
Reader
::
InquireVariableCompound
(
const
std
::
string
&
variableName
,
ADIOS1
Reader
::
InquireVariableCompound
(
const
std
::
string
&
variableName
,
const
bool
readIn
)
const
bool
readIn
)
{
{
return
nullptr
;
return
nullptr
;
}
}
void
BPFile
Reader
::
Close
(
const
int
transportIndex
)
{}
void
ADIOS1
Reader
::
Close
(
const
int
transportIndex
)
{}
// PRIVATE
// PRIVATE
void
BPFile
Reader
::
Init
()
void
ADIOS1
Reader
::
Init
()
{
{
if
(
m_DebugMode
==
true
)
if
(
m_DebugMode
==
true
)
{
{
if
(
m_AccessMode
!=
"r"
&&
m_AccessMode
!=
"read"
)
if
(
m_AccessMode
!=
"r"
&&
m_AccessMode
!=
"read"
)
throw
std
::
invalid_argument
(
throw
std
::
invalid_argument
(
"ERROR:
BPFile
Reader doesn't support access mode "
+
"ERROR:
ADIOS1
Reader doesn't support access mode "
+
m_AccessMode
+
m_AccessMode
+
", in call to ADIOS Open or
BPFile
Reader constructor
\n
"
);
", in call to ADIOS Open or
ADIOS1
Reader constructor
\n
"
);
}
}
InitParameters
();
InitTransports
();
InitTransports
();
}
}
void
BPFileReader
::
InitTransports
()
// maybe move this?
void
ADIOS1Reader
::
InitParameters
()
{}
void
ADIOS1Reader
::
InitTransports
()
{
{
if
(
m_DebugMode
==
true
)
if
(
m_DebugMode
==
true
)
{
{
if
(
TransportNamesUniqueness
()
==
false
)
if
(
TransportNamesUniqueness
()
==
false
)
...
@@ -188,43 +192,10 @@ void BPFileReader::InitTransports() // maybe move this?
...
@@ -188,43 +192,10 @@ void BPFileReader::InitTransports() // maybe move this?
for
(
const
auto
&
parameters
:
m_Method
.
m_TransportParameters
)
for
(
const
auto
&
parameters
:
m_Method
.
m_TransportParameters
)
{
{
auto
itTransport
=
parameters
.
find
(
"transport"
);
auto
itTransport
=
parameters
.
find
(
"transport"
);
if
(
itTransport
->
second
==
"file"
||
itTransport
->
second
==
"File"
)
if
(
itTransport
->
second
==
"file"
||
itTransport
->
second
==
"File"
||
itTransport
->
second
==
"bp"
||
itTransport
->
second
==
"BP"
)
{
{
auto
itLibrary
=
parameters
.
find
(
"library"
);
read_method
=
ADIOS_READ_METHOD_BP
;
if
(
itLibrary
==
parameters
.
end
()
||
itLibrary
->
second
==
"POSIX"
)
// use default POSIX
{
auto
file
=
std
::
make_shared
<
transport
::
FileDescriptor
>
(
m_MPIComm
,
m_DebugMode
);
// m_BP1Reader.OpenRankFiles( m_Name, m_AccessMode, *file );
m_Transports
.
push_back
(
std
::
move
(
file
));
}
else
if
(
itLibrary
->
second
==
"FILE*"
||
itLibrary
->
second
==
"stdio.h"
)
{
auto
file
=
std
::
make_shared
<
transport
::
FilePointer
>
(
m_MPIComm
,
m_DebugMode
);
// m_BP1Reader.OpenRankFiles( m_Name, m_AccessMode, *file );
m_Transports
.
push_back
(
std
::
move
(
file
));
}
else
if
(
itLibrary
->
second
==
"fstream"
||
itLibrary
->
second
==
"std::fstream"
)
{
auto
file
=
std
::
make_shared
<
transport
::
FStream
>
(
m_MPIComm
,
m_DebugMode
);
// m_BP1Reader.OpenRankFiles( m_Name, m_AccessMode, *file );
m_Transports
.
push_back
(
std
::
move
(
file
));
}
else
if
(
itLibrary
->
second
==
"MPI-IO"
)
{
}
else
{
if
(
m_DebugMode
==
true
)
throw
std
::
invalid_argument
(
"ERROR: file transport library "
+
itLibrary
->
second
+
" not supported, in "
+
m_Name
+
m_EndMessage
);
}
}
}
else
else
{
{
...
...
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