diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-01-16 14:46:17 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-01-16 14:46:17 -0500 |
commit | e0ddb73239c73c6de42a01204194173ce65ebff4 (patch) | |
tree | d0380bec049f7807836d68a0001f2ec492f62d0e /Carpet/LoopControl/src/loopcontrol.F90 | |
parent | 1cddd960d62da42ccd111022f1326740f688b48d (diff) |
LoopControl: Rewrite
Rewrite code in C++.
Remove dependency on GSL.
Modify algorithm; now traverses arrays bottom-up (by splitting the looping region into equal-sized blocks) instead of top-down (splitting the region into a certain number of blocks)
Make multi-threading dynamic
Support SMT (hyper-threading), i.e. threads which share the same cache
Diffstat (limited to 'Carpet/LoopControl/src/loopcontrol.F90')
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol.F90 | 70 |
1 files changed, 49 insertions, 21 deletions
diff --git a/Carpet/LoopControl/src/loopcontrol.F90 b/Carpet/LoopControl/src/loopcontrol.F90 index e27e34726..9d91ec407 100644 --- a/Carpet/LoopControl/src/loopcontrol.F90 +++ b/Carpet/LoopControl/src/loopcontrol.F90 @@ -1,41 +1,69 @@ +#include "cctk.h" + +#include "loopcontrol.h" + + + module loopcontrol - use loopcontrol_types + implicit none interface - subroutine lc_statmap_init (initialised, lc_lm, name) + subroutine lc_stats_init(stats, name) use loopcontrol_types implicit none - integer, intent(out) :: initialised - type (lc_statmap_t) :: lc_lm - character(*) :: name - end subroutine lc_statmap_init + CCTK_POINTER :: stats + character(*) :: name + end subroutine lc_stats_init - subroutine lc_control_init (lc_lc, lc_lm, & - imin,jmin,kmin, imax,jmax,kmax, ilsh,jlsh,klsh,di) + subroutine lc_control_init( & + control, stats, & + imin, jmin, kmin, & + imax, jmax, kmax, & + iash, jash, kash, & + di, dj, dk) use loopcontrol_types implicit none - type (lc_control_t) :: lc_lc - type (lc_statmap_t) :: lc_lm - integer, intent(in) :: imin, jmin, kmin - integer, intent(in) :: imax, jmax, kmax - integer, intent(in) :: ilsh, jlsh, klsh - integer, intent(in) :: di + type(lc_control_t) :: control + CCTK_POINTER :: stats + CCTK_POINTER :: imin, jmin, kmin + CCTK_POINTER :: imax, jmax, kmax + CCTK_POINTER :: iash, jash, kash + CCTK_POINTER :: di, dj, dk end subroutine lc_control_init - - subroutine lc_control_finish (lc_lc) + + subroutine lc_control_finish(control, stats) use loopcontrol_types implicit none - type (lc_control_t) :: lc_lc + type(lc_control_t) :: control + CCTK_POINTER :: stats end subroutine lc_control_finish - - subroutine lc_get_fortran_type_sizes (sum_of_type_sizes) + + subroutine lc_thread_init(control) + use loopcontrol_types + implicit none + type(lc_control_t) :: control + end subroutine lc_thread_init + + logical function lc_thread_done(control) + use loopcontrol_types + implicit none + type(lc_control_t) :: control + end function lc_thread_done + + subroutine lc_thread_step(control) use loopcontrol_types implicit none - integer, intent(out) :: sum_of_type_sizes + type(lc_control_t) :: control + end subroutine lc_thread_step + + subroutine lc_get_fortran_type_sizes(type_sizes) + use loopcontrol_types + implicit none + CCTK_POINTER :: type_sizes(4) end subroutine lc_get_fortran_type_sizes - + end interface end module loopcontrol |