Skip to content

Commit

Permalink
Fixed small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
golosio committed Mar 21, 2021
1 parent 2d8abb6 commit d4120ce
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/spike_mpi.cu
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,20 @@ int ConnectMpi::CopySpikeFromRemote(int n_hosts, int max_spike_per_host,
}
JoinSpike_time_ += (getRealTime() - time_mark);

time_mark = getRealTime();
gpuErrchk(cudaMemcpy(d_ExternalSourceSpikeNodeId,
h_ExternalSourceSpikeNodeId,
n_spike_tot*sizeof(int), cudaMemcpyHostToDevice));
RecvSpikeFromRemote_CUDAcp_time_ += (getRealTime() - time_mark);
// tolto controllo flag spike height ed eventuale ricezione
AddOffset<<<(n_spike_tot+1023)/1024, 1024>>>
(n_spike_tot, d_ExternalSourceSpikeNodeId, i_remote_node_0);
PushSpikeFromRemote<<<(n_spike_tot+1023)/1024, 1024>>>
(n_spike_tot, d_ExternalSourceSpikeNodeId);
gpuErrchk( cudaPeekAtLastError() );
cudaDeviceSynchronize();
if (n_spike_tot>0) {
time_mark = getRealTime();
gpuErrchk(cudaMemcpy(d_ExternalSourceSpikeNodeId,
h_ExternalSourceSpikeNodeId,
n_spike_tot*sizeof(int), cudaMemcpyHostToDevice));
RecvSpikeFromRemote_CUDAcp_time_ += (getRealTime() - time_mark);
// tolto controllo flag spike height ed eventuale ricezione
AddOffset<<<(n_spike_tot+1023)/1024, 1024>>>
(n_spike_tot, d_ExternalSourceSpikeNodeId, i_remote_node_0);
PushSpikeFromRemote<<<(n_spike_tot+1023)/1024, 1024>>>
(n_spike_tot, d_ExternalSourceSpikeNodeId);
gpuErrchk( cudaPeekAtLastError() );
cudaDeviceSynchronize();
}

return n_spike_tot;
}
Expand Down

0 comments on commit d4120ce

Please sign in to comment.