|
12 | 12 |
|
13 | 13 | #ifdef USE_MPI |
14 | 14 | #include <mpi.h> |
15 | | -#ifdef OMPI_MPI_H |
16 | | -#include <mpi-ext.h> |
17 | | -#endif |
18 | 15 | #endif |
19 | 16 |
|
20 | 17 | using namespace deepmd; |
@@ -202,23 +199,24 @@ void DeepPotPT::compute(ENERGYVTYPE& ener, |
202 | 199 | } |
203 | 200 |
|
204 | 201 | std::vector<int> recvnum_new(nswap, 0); |
205 | | -#ifdef MPI_FOUND |
206 | | - if (lmp_list.world) { |
207 | | - MPI_Comm comm = *static_cast<MPI_Comm*>(lmp_list.world); |
208 | | - const int TAG_BASE = 0x7a31; |
209 | | - for (int s = 0; s < nswap; ++s) { |
210 | | - const int send_to = lmp_list.sendproc[s]; |
211 | | - const int recv_from = lmp_list.recvproc[s]; |
212 | | - int send_cnt = sendnum_new[s]; |
213 | | - int recv_cnt = 0; |
214 | | - MPI_Sendrecv(&send_cnt, 1, MPI_INT, send_to, TAG_BASE + s, &recv_cnt, |
215 | | - 1, MPI_INT, recv_from, TAG_BASE + s, comm, |
216 | | - MPI_STATUS_IGNORE); |
217 | | - recvnum_new[s] = recv_cnt; |
218 | | - } |
219 | | - } else |
| 202 | +#ifdef USE_MPI |
| 203 | + if (lmp_list.world) { |
| 204 | + MPI_Comm comm = *static_cast<MPI_Comm*>(lmp_list.world); |
| 205 | + const int TAG_BASE = 0x7a31; |
| 206 | + for (int s = 0; s < nswap; ++s) { |
| 207 | + const int send_to = lmp_list.sendproc[s]; |
| 208 | + const int recv_from = lmp_list.recvproc[s]; |
| 209 | + int send_cnt = sendnum_new[s]; |
| 210 | + int recv_cnt = 0; |
| 211 | + MPI_Sendrecv(&send_cnt, 1, MPI_INT, send_to, TAG_BASE + s, |
| 212 | + &recv_cnt, 1, MPI_INT, recv_from, TAG_BASE + s, |
| 213 | + comm, MPI_STATUS_IGNORE); |
| 214 | + recvnum_new[s] = recv_cnt; |
| 215 | + } |
| 216 | + } else |
220 | 217 | #endif |
221 | 218 | { |
| 219 | + // need check |
222 | 220 | for (int s = 0; s < nswap; ++s) { |
223 | 221 | recvnum_new[s] = sendnum_new[s]; |
224 | 222 | } |
|
0 commit comments