Skip to content

Commit 4a2027e

Browse files
committed
fix bugs
1 parent 4dab5d8 commit 4a2027e

2 files changed

Lines changed: 3 additions & 33 deletions

File tree

source/api_cc/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ file(GLOB INC_SRC include/*.h ${CMAKE_CURRENT_BINARY_DIR}/version.h)
88
set(libname "${LIB_DEEPMD_CC}")
99
add_library(${libname} SHARED ${LIB_SRC})
1010

11-
if(ENABLE_PYTORCH)
12-
find_package(MPI)
13-
if(MPI_FOUND)
14-
target_link_libraries(${libname} PRIVATE MPI::MPI_CXX)
15-
target_compile_definitions(${libname} PRIVATE USE_MPI)
16-
endif()
17-
endif()
18-
1911
# link: libdeepmd libdeepmd_op libtensorflow_cc libtensorflow_framework
2012
target_link_libraries(${libname} PUBLIC ${LIB_DEEPMD})
2113
if(ENABLE_TENSORFLOW)

source/api_cc/src/DeepPotPT.cc

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
#include "device.h"
1111
#include "errors.h"
1212

13-
#ifdef USE_MPI
14-
#include <mpi.h>
15-
#endif
16-
1713
using namespace deepmd;
1814

1915
void DeepPotPT::translate_error(std::function<void()> f) {
@@ -199,27 +195,9 @@ void DeepPotPT::compute(ENERGYVTYPE& ener,
199195
}
200196

201197
std::vector<int> recvnum_new(nswap, 0);
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, &recv_cnt,
212-
1, MPI_INT, recv_from, TAG_BASE + s, comm,
213-
MPI_STATUS_IGNORE);
214-
recvnum_new[s] = recv_cnt;
215-
}
216-
} else
217-
#endif
218-
{
219-
// need check
220-
for (int s = 0; s < nswap; ++s) {
221-
recvnum_new[s] = sendnum_new[s];
222-
}
198+
// need check
199+
for (int s = 0; s < nswap; ++s) {
200+
recvnum_new[s] = sendnum_new[s];
223201
}
224202

225203
std::vector<int> firstrecv_new(nswap, 0);

0 commit comments

Comments
 (0)