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
7857faaa
Commit
7857faaa
authored
7 years ago
by
Podhorszki, Norbert
Browse files
Options
Downloads
Patches
Plain Diff
comment out debug messages and use sin/cos function to init array instead of ranks
parent
6ad2127e
No related branches found
No related tags found
1 merge request
!203
fix the left-right/up-down direction in code to make communication co…
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/heatTransfer/write/HeatTransfer.cpp
+17
-16
17 additions, 16 deletions
examples/heatTransfer/write/HeatTransfer.cpp
examples/heatTransfer/write/main.cpp
+1
-1
1 addition, 1 deletion
examples/heatTransfer/write/main.cpp
with
18 additions
and
17 deletions
examples/heatTransfer/write/HeatTransfer.cpp
+
17
−
16
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
);
}
...
...
This diff is collapsed.
Click to expand it.
examples/heatTransfer/write/main.cpp
+
1
−
1
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
);
...
...
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