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
40824d9f
Commit
40824d9f
authored
7 years ago
by
Wang, Ruonan
Browse files
Options
Downloads
Patches
Plain Diff
for adding BP variable reading
parent
3dd2ccde
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!340
for BP buffer over WAN
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/adios2/toolkit/transportman/dataman/DataMan.cpp
+84
-9
84 additions, 9 deletions
source/adios2/toolkit/transportman/dataman/DataMan.cpp
source/adios2/toolkit/transportman/dataman/DataMan.h
+2
-0
2 additions, 0 deletions
source/adios2/toolkit/transportman/dataman/DataMan.h
with
86 additions
and
9 deletions
source/adios2/toolkit/transportman/dataman/DataMan.cpp
+
84
−
9
View file @
40824d9f
...
...
@@ -232,8 +232,8 @@ void DataMan::ReadThread(std::shared_ptr<Transport> trans,
{
while
(
m_Listening
)
{
// char *buffer = new char[m_BufferSize]
;
std
::
vector
<
char
>
buffer
(
m_BufferSize
);
std
::
vector
<
char
>
buffer
;
buffer
.
reserve
(
m_BufferSize
);
Transport
::
Status
status
;
trans
->
IRead
(
buffer
.
data
(),
m_BufferSize
,
status
);
...
...
@@ -246,15 +246,13 @@ void DataMan::ReadThread(std::shared_ptr<Transport> trans,
std
::
memcpy
(
m_BP3Deserializer
->
m_Data
.
m_Buffer
.
data
(),
buffer
.
data
(),
status
.
Bytes
);
/* TODO: remove this part */
m_Callback
->
RunCallback2
(
buffer
.
data
(),
"ss"
,
"rr"
,
"char"
,
adios2
::
Dims
{
128
});
/* write bp file for debugging */
/*
std::ofstream bpfile("datamanR.bp", std::ios_base::binary);
bpfile.write(m_BP3Deserializer->m_Data.m_Buffer.data(),
m_BP3Deserializer->m_Data.m_Buffer.size());
bpfile.close();
*/
m_BP3Deserializer
->
ParseMetadata
(
m_BP3Deserializer
->
m_Data
,
*
m_IO
);
...
...
@@ -262,19 +260,96 @@ void DataMan::ReadThread(std::shared_ptr<Transport> trans,
const
auto
variablesInfo
=
m_IO
->
GetAvailableVariables
();
for
(
const
auto
&
variableInfoPair
:
variablesInfo
)
{
std
::
cout
<<
"Variable Name: "
<<
variableInfoPair
.
first
<<
"
\n
"
;
std
::
string
var
=
variableInfoPair
.
first
;
std
::
string
type
=
"null"
;
for
(
const
auto
&
parameter
:
variableInfoPair
.
second
)
{
std
::
cout
<<
"
\t
Key: "
<<
parameter
.
first
<<
"
\t
Value: "
<<
parameter
.
second
<<
"
\n
"
;
if
(
parameter
.
first
==
"Type"
)
{
type
=
parameter
.
second
;
}
}
if
(
type
==
"string"
)
{
}
else
if
(
type
==
"char"
)
{
}
else
if
(
type
==
"unsigned char"
)
{
}
else
if
(
type
==
"short"
)
{
}
else
if
(
type
==
"unsigned short"
)
{
}
else
if
(
type
==
"int"
)
{
adios2
::
Variable
<
int
>
*
v
=
m_IO
->
InquireVariable
<
int
>
(
var
);
size_t
size
=
std
::
accumulate
(
v
->
m_Shape
.
begin
(),
v
->
m_Shape
.
end
(),
1
,
std
::
multiplies
<
size_t
>
());
std
::
vector
<
int
>
x
(
size
);
v
->
SetData
(
x
.
data
());
/* TODO: add read variable */
RunCallback
(
x
.
data
(),
"stream"
,
var
,
type
,
v
->
m_Shape
);
}
else
if
(
type
==
"unsigned int"
)
{
}
else
if
(
type
==
"long int"
)
{
}
else
if
(
type
==
"unsigned long int"
)
{
}
else
if
(
type
==
"long long int"
)
{
}
else
if
(
type
==
"unsigned long long int"
)
{
}
else
if
(
type
==
"float"
)
{
}
else
if
(
type
==
"double"
)
{
}
else
if
(
type
==
"long double"
)
{
}
else
if
(
type
==
"float complex"
)
{
}
else
if
(
type
==
"double complex"
)
{
}
else
if
(
type
==
"long double complex"
)
{
}
std
::
cout
<<
"Variable Name: "
<<
var
<<
std
::
endl
;
std
::
cout
<<
"Type: "
<<
type
<<
std
::
endl
;
}
}
}
}
}
void
DataMan
::
RunCallback
(
void
*
buffer
,
std
::
string
doid
,
std
::
string
var
,
std
::
string
dtype
,
std
::
vector
<
size_t
>
shape
)
{
if
(
m_Callback
!=
nullptr
&&
m_Callback
->
m_Type
==
"Signature2"
)
{
m_Callback
->
RunCallback2
(
buffer
,
doid
,
var
,
dtype
,
shape
);
}
}
}
// end namespace transportman
}
// end namespace adios2
This diff is collapsed.
Click to expand it.
source/adios2/toolkit/transportman/dataman/DataMan.h
+
2
−
0
View file @
40824d9f
...
...
@@ -65,6 +65,8 @@ private:
std
::
shared_ptr
<
Transport
>
ctl_trans
,
const
std
::
string
format
);
void
RunCallback
(
void
*
buffer
,
std
::
string
doid
,
std
::
string
var
,
std
::
string
dtype
,
std
::
vector
<
size_t
>
shape
);
std
::
vector
<
std
::
shared_ptr
<
Transport
>>
m_ControlTransports
;
std
::
vector
<
std
::
thread
>
m_ControlThreads
;
size_t
m_CurrentTransport
=
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