Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Podhorszki, Norbert
ADIOS2
Commits
7857faaa
Commit
7857faaa
authored
Jun 30, 2017
by
Podhorszki, Norbert
Browse files
comment out debug messages and use sin/cos function to init array instead of ranks
parent
6ad2127e
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/heatTransfer/write/HeatTransfer.cpp
View file @
7857faaa
...
...
@@ -158,16 +158,16 @@ void HeatTransfer::exchange(MPI_Comm comm)
MPI_Status
status
;
if
(
m_s
.
rank_left
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" send left to rank "
<<
m_s
.
rank_left
<<
std
::
endl
;
//
std::cout << "Rank " << m_s.rank << " send left to rank "
//
<< m_s.rank_left << std::endl;
for
(
unsigned
int
i
=
0
;
i
<
m_s
.
ndx
+
2
;
++
i
)
send_x
[
i
]
=
m_TCurrent
[
i
][
1
];
MPI_Send
(
send_x
,
m_s
.
ndx
+
2
,
MPI_REAL8
,
m_s
.
rank_left
,
tag
,
comm
);
}
if
(
m_s
.
rank_right
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" receive from right from rank "
<<
m_s
.
rank_right
<<
std
::
endl
;
//
std::cout << "Rank " << m_s.rank << " receive from right from rank "
//
<< m_s.rank_right << std::endl;
MPI_Recv
(
recv_x
,
m_s
.
ndx
+
2
,
MPI_REAL8
,
m_s
.
rank_right
,
tag
,
comm
,
&
status
);
for
(
unsigned
int
i
=
0
;
i
<
m_s
.
ndx
+
2
;
++
i
)
...
...
@@ -178,16 +178,16 @@ void HeatTransfer::exchange(MPI_Comm comm)
tag
=
2
;
if
(
m_s
.
rank_right
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" send right to rank "
<<
m_s
.
rank_right
<<
std
::
endl
;
//
std::cout << "Rank " << m_s.rank << " send right to rank "
//
<< m_s.rank_right << std::endl;
for
(
unsigned
int
i
=
0
;
i
<
m_s
.
ndx
+
2
;
++
i
)
send_x
[
i
]
=
m_TCurrent
[
i
][
m_s
.
ndy
];
MPI_Send
(
send_x
,
m_s
.
ndx
+
2
,
MPI_REAL8
,
m_s
.
rank_right
,
tag
,
comm
);
}
if
(
m_s
.
rank_left
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" receive from left from rank "
<<
m_s
.
rank_left
<<
std
::
endl
;
//
std::cout << "Rank " << m_s.rank << " receive from left from rank "
//
<< m_s.rank_left << std::endl;
MPI_Recv
(
recv_x
,
m_s
.
ndx
+
2
,
MPI_REAL8
,
m_s
.
rank_left
,
tag
,
comm
,
&
status
);
for
(
unsigned
int
i
=
0
;
i
<
m_s
.
ndx
+
2
;
++
i
)
...
...
@@ -198,15 +198,15 @@ void HeatTransfer::exchange(MPI_Comm comm)
tag
=
3
;
if
(
m_s
.
rank_down
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" send down to rank "
<<
m_s
.
rank_down
<<
std
::
endl
;
//
std::cout << "Rank " << m_s.rank << " send down to rank "
//
<< m_s.rank_down << std::endl;
MPI_Send
(
m_TCurrent
[
m_s
.
ndx
],
m_s
.
ndy
+
2
,
MPI_REAL8
,
m_s
.
rank_down
,
tag
,
comm
);
}
if
(
m_s
.
rank_up
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" receive from above from rank "
<<
m_s
.
rank_up
<<
std
::
endl
;
//
std::cout << "Rank " << m_s.rank << " receive from above from rank "
//
<< m_s.rank_up << std::endl;
MPI_Recv
(
m_TCurrent
[
0
],
m_s
.
ndy
+
2
,
MPI_REAL8
,
m_s
.
rank_up
,
tag
,
comm
,
&
status
);
}
...
...
@@ -215,14 +215,15 @@ void HeatTransfer::exchange(MPI_Comm comm)
tag
=
4
;
if
(
m_s
.
rank_up
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" send up to rank "
<<
m_s
.
rank_up
<<
std
::
endl
;
// std::cout << "Rank " << m_s.rank << " send up to rank " <<
// m_s.rank_up
// << std::endl;
MPI_Send
(
m_TCurrent
[
1
],
m_s
.
ndy
+
2
,
MPI_REAL8
,
m_s
.
rank_up
,
tag
,
comm
);
}
if
(
m_s
.
rank_down
>=
0
)
{
std
::
cout
<<
"Rank "
<<
m_s
.
rank
<<
" receive from below from rank "
<<
m_s
.
rank_down
<<
std
::
endl
;
//
std::cout << "Rank " << m_s.rank << " receive from below from rank "
//
<< m_s.rank_down << std::endl;
MPI_Recv
(
m_TCurrent
[
m_s
.
ndx
+
1
],
m_s
.
ndy
+
2
,
MPI_REAL8
,
m_s
.
rank_down
,
tag
,
comm
,
&
status
);
}
...
...
examples/heatTransfer/write/main.cpp
View file @
7857faaa
...
...
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
HeatTransfer
ht
(
settings
);
IO
io
(
settings
,
mpiHeatTransferComm
);
ht
.
init
(
tru
e
);
ht
.
init
(
fals
e
);
// ht.printT("Initialized T:", mpiHeatTransferComm);
ht
.
heatEdges
();
ht
.
exchange
(
mpiHeatTransferComm
);
...
...
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