Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 7a230ba

Browse files
iomaganarisolupton
authored andcommitted
Added depend in update from clauses
1 parent aac0915 commit 7a230ba

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

coreneuron/network/netcvode.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ void NetCvode::check_thresh(NrnThread* nt) { // for default method
571571
#endif
572572
nrn_pragma_acc(update host(nsbuffer [0:nt->_net_send_buffer_cnt]) async(nt->streams[nt->stream_id]))
573573
nrn_pragma_acc(wait async(nt->streams[nt->stream_id]))
574-
nrn_pragma_omp(target update from(nsbuffer [0:nt->_net_send_buffer_cnt]))
574+
nrn_pragma_omp(target update from(nsbuffer [0:nt->_net_send_buffer_cnt]) depend(inout: nt->streams[nt->stream_id]) nowait)
575+
nrn_pragma_omp(taskwait)
575576
}
576577

577578
// on CPU...

coreneuron/network/partrans.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void nrnmpi_v_transfer() {
6363
}
6464
nrn_pragma_acc(update host(src_gather [0:n_src_gather]) if (nt->compute_gpu)
6565
async(nt->streams[nt->stream_id]))
66-
nrn_pragma_omp(target update from(src_gather [0:n_src_gather]) if (nt->compute_gpu))
66+
nrn_pragma_omp(target update from(src_gather [0:n_src_gather]) if (nt->compute_gpu) depend(inout: nt->streams[nt->stream_id]) nowait)
6767
}
6868

6969
// copy gathered source values to outsrc_buf_

coreneuron/sim/fadvance_core.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void nrncore2nrn_send_values(NrnThread* nth) {
317317
double* gather_i = tr->gather[i];
318318
nrn_pragma_acc(update self(gather_i [0:1]) if (nth->compute_gpu)
319319
async(nth->streams[nth->stream_id]))
320-
nrn_pragma_omp(target update from(gather_i [0:1]) if (nth->compute_gpu))
320+
nrn_pragma_omp(target update from(gather_i [0:1]) if (nth->compute_gpu) depend(inout: nth->streams[nth->stream_id]) nowait)
321321
}
322322
nrn_pragma_acc(wait async(nth->streams[nth->stream_id]))
323323
for (int i = 0; i < tr->n_trajec; ++i) {
@@ -344,7 +344,6 @@ static void* nrn_fixed_step_thread(NrnThread* nth) {
344344
nrn_pragma_acc(update device(nth->_t) if (nth->compute_gpu) async(nth->streams[nth->stream_id]))
345345
nrn_pragma_acc(wait async(nth->streams[nth->stream_id]))
346346
nrn_pragma_omp(target update to(nth->_t) if (nth->compute_gpu))
347-
nrn_pragma_omp(taskwait)
348347
fixed_play_continuous(nth);
349348

350349
{
@@ -381,7 +380,6 @@ void* nrn_fixed_step_lastpart(NrnThread* nth) {
381380
nrn_pragma_acc(update device(nth->_t) if (nth->compute_gpu) async(nth->streams[nth->stream_id]))
382381
nrn_pragma_acc(wait async(nth->streams[nth->stream_id]))
383382
nrn_pragma_omp(target update to(nth->_t) if (nth->compute_gpu))
384-
nrn_pragma_omp(taskwait)
385383
fixed_play_continuous(nth);
386384
nonvint(nth);
387385
nrncore2nrn_send_values(nth);

0 commit comments

Comments
 (0)