@@ -212,20 +212,16 @@ void DeepPotPT::compute(ENERGYVTYPE& ener,
212212 nlist_data.padding ();
213213 if (do_message_passing) {
214214 int nswap = lmp_list.nswap ;
215- select_real_atoms_sendlist (comm_sendlist_, comm_sendnum_, comm_recvnum_,
216- lmp_list, fwd_map);
217- comm_sendlist_ptrs_.resize (nswap);
218- for (int s = 0 ; s < nswap; ++s) {
219- comm_sendlist_ptrs_[s] = comm_sendlist_[s].data ();
220- }
221215 torch::Tensor sendproc_tensor =
222216 torch::from_blob (lmp_list.sendproc , {nswap}, int32_option);
223217 torch::Tensor recvproc_tensor =
224218 torch::from_blob (lmp_list.recvproc , {nswap}, int32_option);
225- torch::Tensor sendnum_tensor =
226- torch::from_blob (comm_sendnum_. data () , {nswap}, int32_option);
219+ torch::Tensor firstrecv_tensor =
220+ torch::from_blob (lmp_list. firstrecv , {nswap}, int32_option);
227221 torch::Tensor recvnum_tensor =
228- torch::from_blob (comm_recvnum_.data (), {nswap}, int32_option);
222+ torch::from_blob (lmp_list.recvnum , {nswap}, int32_option);
223+ torch::Tensor sendnum_tensor =
224+ torch::from_blob (lmp_list.sendnum , {nswap}, int32_option);
229225 torch::Tensor communicator_tensor;
230226 if (lmp_list.world == 0 ) {
231227 communicator_tensor = torch::empty ({1 }, torch::kInt64 );
@@ -234,9 +230,11 @@ void DeepPotPT::compute(ENERGYVTYPE& ener,
234230 const_cast <void *>(lmp_list.world ), {1 }, torch::kInt64 );
235231 }
236232
237- int ptr_len = nswap * static_cast <int >(sizeof (int *) / sizeof (int32_t ));
238- torch::Tensor sendlist_tensor = torch::from_blob (
239- comm_sendlist_ptrs_.data (), {std::max (ptr_len, 1 )}, int32_option);
233+ torch::Tensor nswap_tensor = torch::tensor (nswap, int32_option);
234+ int total_send =
235+ std::accumulate (lmp_list.sendnum , lmp_list.sendnum + nswap, 0 );
236+ torch::Tensor sendlist_tensor =
237+ torch::from_blob (lmp_list.sendlist , {total_send}, int32_option);
240238 comm_dict.insert_or_assign (" send_list" , sendlist_tensor);
241239 comm_dict.insert_or_assign (" send_proc" , sendproc_tensor);
242240 comm_dict.insert_or_assign (" recv_proc" , recvproc_tensor);
0 commit comments