Skip to content

Commit

Permalink
delete nl before new
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Feb 3, 2024
1 parent 2904c7c commit da55888
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/api_c/include/deepmd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ void inline convert_nlist(InputNlist &to_nlist,
to_nlist.numneigh[ii] = from_nlist[ii].size();
to_nlist.firstneigh[ii] = &from_nlist[ii][0];
}
// delete the original nl
DP_DeleteNlist(to_nlist.nl);
to_nlist.nl = DP_NewNlist(to_nlist.inum, to_nlist.ilist, to_nlist.numneigh,
to_nlist.firstneigh);
}
Expand Down

0 comments on commit da55888

Please sign in to comment.