Skip to content

Commit

Permalink
Reapply "debug"
Browse files Browse the repository at this point in the history
This reverts commit e264828.
  • Loading branch information
njzjz committed Jul 25, 2024
1 parent 3b7d70a commit 6e82ca4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
env:
DP_BUILD_TESTING: 1
if: ${{ !matrix.check_memleak }}
- run: pytest --cov=deepmd source/lmp/tests
- run: pytest -s --cov=deepmd source/lmp/tests
env:
OMP_NUM_THREADS: 1
TF_INTRA_OP_PARALLELISM_THREADS: 1
Expand Down
7 changes: 7 additions & 0 deletions source/op/pt/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Border : public torch::autograd::Function<Border> {
int nghost = nghost_tensor.item<int>();
int ntotal = nlocal + nghost;
torch::Tensor recv_g1_tensor = g1;
printf("nlocal: %d, nghost: %d, lineno: %d\n", nlocal, nghost, __LINE__);

#ifdef USE_MPI
int mpi_init = 0;
Expand Down Expand Up @@ -120,6 +121,9 @@ class Border : public torch::autograd::Function<Border> {
for (int iswap = 0; iswap < nswap; ++iswap) {
int nrecv = recvnum[iswap];
int nsend = sendnum[iswap];
printf("me: %d, iswap: %d, nrecv: %d, nsend: %d, lineno: %d\n", me, iswap,
nrecv, nsend, __LINE__);

torch::Tensor isendlist =
torch::from_blob(sendlist[iswap], {nsend}, int32_options)
.to(recv_g1_tensor.device());
Expand Down Expand Up @@ -214,6 +218,7 @@ class Border : public torch::autograd::Function<Border> {
MPI_Comm_size(world, &world_size);
MPI_Datatype mpi_type = get_mpi_type<FPTYPE>();
MPI_Request request;
printf("world_size: %d, rank: %d, lineno: %d\n", world_size, me, __LINE__);
#if defined(GOOGLE_CUDA) || defined(TENSORFLOW_USE_ROCM)
if (world_size != 1) {
int version, subversion;
Expand Down Expand Up @@ -265,6 +270,8 @@ class Border : public torch::autograd::Function<Border> {
for (int iswap = nswap - 1; iswap >= 0; --iswap) {
int nrecv = recvnum[iswap];
int nsend = sendnum[iswap];
printf("me: %d, iswap: %d, nrecv: %d, nsend: %d, lineno: %d\n", me, iswap,
nrecv, nsend, __LINE__);

torch::Tensor irecvlist;
if (nrecv) {
Expand Down

0 comments on commit 6e82ca4

Please sign in to comment.