Commit 4845ce2
committed
Consolidating OpenACC device-host memory transfers
This PR consolidates much of the OpenACC host and device data transfers during
the course of the dynamical execution to two subroutines mpas_atm_pre_dynamics
_h2d and mpas_atm_post_dynamics_d2h that are called before and after the call
to atm_srk3 subroutine. Due to atm_compute_solve_diagnostics also being called
once before the start of model run, we also have a pair of subroutines mpas_atm
_pre_computesolvediag_h2d and mpas_atm_post_computesolvediag_d2h to handle data
movements around the first call to atm_compute_solve_diagnostics. Any fields
copied onto the device in these subroutines are removed from explicit data
movement statements in the dynamical core.
The mesh/time-invariant fields are still copied onto the device in mpas_atm_
dynamics_init and removed from the device in mpas_atm_dynamics_finalize, with
the exception of select fields moved in mpas_atm_pre_computesolvediag_h2d and
mpas_atm_post_computesolvediag_d2h. This is a special case due to atm_compute_
solve_diagnostics being called for the first time before the call to mpas_atm_
dynamics_init
This PR also includes explicit host-device data transfers in the mpas_atm_iau,
mpas_atmphys_interface and mpas_atmphys_todynamics modules to ensure that the
physics and IAU regions, which run on CPU, use the latest values from the
dynamical core running on GPUs, and vice versa. In addition, this PR also
includes explicit data transfers around halo exchanges in the atm_srk3
subroutine.
These subroutines for data routines, and the acc update statements are an
interim solution until we have a book-keeping method in place. This PR also
introduces a couple of new timers to keep track of the cost of data transfers.1 parent 956b020 commit 4845ce2
File tree
6 files changed
+1071
-376
lines changed- src/core_atmosphere
- dynamics
- physics
6 files changed
+1071
-376
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | 313 | | |
315 | | - | |
316 | 314 | | |
317 | 315 | | |
318 | | - | |
319 | 316 | | |
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
323 | 320 | | |
324 | | - | |
325 | 321 | | |
326 | 322 | | |
327 | 323 | | |
| |||
341 | 337 | | |
342 | 338 | | |
343 | 339 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | 340 | | |
352 | 341 | | |
353 | 342 | | |
| |||
448 | 437 | | |
449 | 438 | | |
450 | 439 | | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | 440 | | |
455 | 441 | | |
456 | 442 | | |
| |||
461 | 447 | | |
462 | 448 | | |
463 | 449 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | 450 | | |
468 | 451 | | |
469 | 452 | | |
470 | 453 | | |
471 | 454 | | |
472 | 455 | | |
473 | 456 | | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | 457 | | |
479 | 458 | | |
480 | 459 | | |
| |||
484 | 463 | | |
485 | 464 | | |
486 | 465 | | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | 466 | | |
491 | 467 | | |
492 | 468 | | |
| |||
567 | 543 | | |
568 | 544 | | |
569 | 545 | | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | 546 | | |
575 | 547 | | |
576 | 548 | | |
| |||
582 | 554 | | |
583 | 555 | | |
584 | 556 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | 557 | | |
590 | 558 | | |
591 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
| |||
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
| 151 | + | |
140 | 152 | | |
141 | 153 | | |
142 | 154 | | |
| |||
149 | 161 | | |
150 | 162 | | |
151 | 163 | | |
| 164 | + | |
| 165 | + | |
152 | 166 | | |
153 | 167 | | |
154 | 168 | | |
| |||
0 commit comments