Commit 7857faaa authored by Podhorszki, Norbert's avatar Podhorszki, Norbert
Browse files

comment out debug messages and use sin/cos function to init array instead of ranks

parent 6ad2127e
...@@ -158,16 +158,16 @@ void HeatTransfer::exchange(MPI_Comm comm) ...@@ -158,16 +158,16 @@ void HeatTransfer::exchange(MPI_Comm comm)
MPI_Status status; MPI_Status status;
if (m_s.rank_left >= 0) if (m_s.rank_left >= 0)
{ {
std::cout << "Rank " << m_s.rank << " send left to rank " // std::cout << "Rank " << m_s.rank << " send left to rank "
<< m_s.rank_left << std::endl; // << m_s.rank_left << std::endl;
for (unsigned int i = 0; i < m_s.ndx + 2; ++i) for (unsigned int i = 0; i < m_s.ndx + 2; ++i)
send_x[i] = m_TCurrent[i][1]; send_x[i] = m_TCurrent[i][1];
MPI_Send(send_x, m_s.ndx + 2, MPI_REAL8, m_s.rank_left, tag, comm); MPI_Send(send_x, m_s.ndx + 2, MPI_REAL8, m_s.rank_left, tag, comm);
} }
if (m_s.rank_right >= 0) if (m_s.rank_right >= 0)
{ {
std::cout << "Rank " << m_s.rank << " receive from right from rank " // std::cout << "Rank " << m_s.rank << " receive from right from rank "
<< m_s.rank_right << std::endl; // << m_s.rank_right << std::endl;
MPI_Recv(recv_x, m_s.ndx + 2, MPI_REAL8, m_s.rank_right, tag, comm, MPI_Recv(recv_x, m_s.ndx + 2, MPI_REAL8, m_s.rank_right, tag, comm,
&status); &status);
for (unsigned int i = 0; i < m_s.ndx + 2; ++i) for (unsigned int i = 0; i < m_s.ndx + 2; ++i)
...@@ -178,16 +178,16 @@ void HeatTransfer::exchange(MPI_Comm comm) ...@@ -178,16 +178,16 @@ void HeatTransfer::exchange(MPI_Comm comm)
tag = 2; tag = 2;
if (m_s.rank_right >= 0) if (m_s.rank_right >= 0)
{ {
std::cout << "Rank " << m_s.rank << " send right to rank " // std::cout << "Rank " << m_s.rank << " send right to rank "
<< m_s.rank_right << std::endl; // << m_s.rank_right << std::endl;
for (unsigned int i = 0; i < m_s.ndx + 2; ++i) for (unsigned int i = 0; i < m_s.ndx + 2; ++i)
send_x[i] = m_TCurrent[i][m_s.ndy]; 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); MPI_Send(send_x, m_s.ndx + 2, MPI_REAL8, m_s.rank_right, tag, comm);
} }
if (m_s.rank_left >= 0) if (m_s.rank_left >= 0)
{ {
std::cout << "Rank " << m_s.rank << " receive from left from rank " // std::cout << "Rank " << m_s.rank << " receive from left from rank "
<< m_s.rank_left << std::endl; // << m_s.rank_left << std::endl;
MPI_Recv(recv_x, m_s.ndx + 2, MPI_REAL8, m_s.rank_left, tag, comm, MPI_Recv(recv_x, m_s.ndx + 2, MPI_REAL8, m_s.rank_left, tag, comm,
&status); &status);
for (unsigned int i = 0; i < m_s.ndx + 2; ++i) for (unsigned int i = 0; i < m_s.ndx + 2; ++i)
...@@ -198,15 +198,15 @@ void HeatTransfer::exchange(MPI_Comm comm) ...@@ -198,15 +198,15 @@ void HeatTransfer::exchange(MPI_Comm comm)
tag = 3; tag = 3;
if (m_s.rank_down >= 0) if (m_s.rank_down >= 0)
{ {
std::cout << "Rank " << m_s.rank << " send down to rank " // std::cout << "Rank " << m_s.rank << " send down to rank "
<< m_s.rank_down << std::endl; // << m_s.rank_down << std::endl;
MPI_Send(m_TCurrent[m_s.ndx], m_s.ndy + 2, MPI_REAL8, m_s.rank_down, MPI_Send(m_TCurrent[m_s.ndx], m_s.ndy + 2, MPI_REAL8, m_s.rank_down,
tag, comm); tag, comm);
} }
if (m_s.rank_up >= 0) if (m_s.rank_up >= 0)
{ {
std::cout << "Rank " << m_s.rank << " receive from above from rank " // std::cout << "Rank " << m_s.rank << " receive from above from rank "
<< m_s.rank_up << std::endl; // << m_s.rank_up << std::endl;
MPI_Recv(m_TCurrent[0], m_s.ndy + 2, MPI_REAL8, m_s.rank_up, tag, comm, MPI_Recv(m_TCurrent[0], m_s.ndy + 2, MPI_REAL8, m_s.rank_up, tag, comm,
&status); &status);
} }
...@@ -215,14 +215,15 @@ void HeatTransfer::exchange(MPI_Comm comm) ...@@ -215,14 +215,15 @@ void HeatTransfer::exchange(MPI_Comm comm)
tag = 4; tag = 4;
if (m_s.rank_up >= 0) if (m_s.rank_up >= 0)
{ {
std::cout << "Rank " << m_s.rank << " send up to rank " << m_s.rank_up // std::cout << "Rank " << m_s.rank << " send up to rank " <<
<< std::endl; // m_s.rank_up
// << std::endl;
MPI_Send(m_TCurrent[1], m_s.ndy + 2, MPI_REAL8, m_s.rank_up, tag, comm); MPI_Send(m_TCurrent[1], m_s.ndy + 2, MPI_REAL8, m_s.rank_up, tag, comm);
} }
if (m_s.rank_down >= 0) if (m_s.rank_down >= 0)
{ {
std::cout << "Rank " << m_s.rank << " receive from below from rank " // std::cout << "Rank " << m_s.rank << " receive from below from rank "
<< m_s.rank_down << std::endl; // << m_s.rank_down << std::endl;
MPI_Recv(m_TCurrent[m_s.ndx + 1], m_s.ndy + 2, MPI_REAL8, m_s.rank_down, MPI_Recv(m_TCurrent[m_s.ndx + 1], m_s.ndy + 2, MPI_REAL8, m_s.rank_down,
tag, comm, &status); tag, comm, &status);
} }
......
...@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) ...@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
HeatTransfer ht(settings); HeatTransfer ht(settings);
IO io(settings, mpiHeatTransferComm); IO io(settings, mpiHeatTransferComm);
ht.init(true); ht.init(false);
// ht.printT("Initialized T:", mpiHeatTransferComm); // ht.printT("Initialized T:", mpiHeatTransferComm);
ht.heatEdges(); ht.heatEdges();
ht.exchange(mpiHeatTransferComm); ht.exchange(mpiHeatTransferComm);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment