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

Commit 83e43f2

Browse files
committed
Added depend in update from clauses
1 parent d9d819e commit 83e43f2

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,9 @@ 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]))
323-
nrn_pragma_omp(taskwait)
324323
for (int i = 0; i < tr->n_trajec; ++i) {
325324
*(tr->scatter[i]) = *(tr->gather[i]);
326325
}
@@ -345,7 +344,6 @@ static void* nrn_fixed_step_thread(NrnThread* nth) {
345344
nrn_pragma_acc(update device(nth->_t) if (nth->compute_gpu) async(nth->streams[nth->stream_id]))
346345
nrn_pragma_acc(wait async(nth->streams[nth->stream_id]))
347346
nrn_pragma_omp(target update to(nth->_t) if (nth->compute_gpu))
348-
nrn_pragma_omp(taskwait)
349347
fixed_play_continuous(nth);
350348

351349
{
@@ -382,7 +380,6 @@ void* nrn_fixed_step_lastpart(NrnThread* nth) {
382380
nrn_pragma_acc(update device(nth->_t) if (nth->compute_gpu) async(nth->streams[nth->stream_id]))
383381
nrn_pragma_acc(wait async(nth->streams[nth->stream_id]))
384382
nrn_pragma_omp(target update to(nth->_t) if (nth->compute_gpu))
385-
nrn_pragma_omp(taskwait)
386383
fixed_play_continuous(nth);
387384
nonvint(nth);
388385
nrncore2nrn_send_values(nth);

0 commit comments

Comments
 (0)