diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-08-26 02:55:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-08-26 02:55:00 +0000 |
commit | e15f981b761acb114010667880ef59fd508ee41a (patch) | |
tree | be57f518626e309b6a9b4219adfd1fcb4e89a7fe /Carpet/LoopControl/src/loopcontrol_fortran.h | |
parent | f6ff5079044289e1f748e800ce85e171fe766f5f (diff) |
LoopControl: Add automatic configuration based on simulated annealing
(Nice idea, but doesn't seem to work right. Maybe only the parameters
need to be chosen differently? But I rather think that a more
intelligent method is necessary.)
darcs-hash:20070826025505-dae7b-ed81bc28a4204d84776d28443be65a995c52699b.gz
Diffstat (limited to 'Carpet/LoopControl/src/loopcontrol_fortran.h')
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol_fortran.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Carpet/LoopControl/src/loopcontrol_fortran.h b/Carpet/LoopControl/src/loopcontrol_fortran.h new file mode 100644 index 000000000..e80bf358f --- /dev/null +++ b/Carpet/LoopControl/src/loopcontrol_fortran.h @@ -0,0 +1,64 @@ +/* -*-f90-mode-*- */ + +#ifndef LOOPCONTROL_FORTRAN_H +#define LOOPCONTROL_FORTRAN_H + + + +#define LC_DECLARE3(name, i,j,k) &&\ +type (lc_statmap_t), save :: name/**/_lm &&\ +logical, save :: name/**/_initialised = .false. &&\ +type (lc_control_t) :: name/**/_lc &&\ +integer :: name/**/_ii, name/**/_jj, name/**/_kk &&\ +integer :: name/**/_imax, name/**/_jmax, name/**/_kmax &&\ +integer :: i, j, k + + + +#define LC_PRIVATE3(name) \ +name/**/_lc, \ +name/**/_imax, name/**/_jmax, name/**/_kmax + + + +#define LC_LOOP3(name, i,j,k, imin,jmin,kmin, imax,jmax,kmax, ilsh,jlsh,klsh) &&\ +if (.not. name/**/_initialised) then &&\ +!$omp single &&\ + call lc_statmap_init (name/**/_lm, "name") &&\ +!$omp end single &&\ +!$omp single &&\ + /* Set this flag only after initialising */ &&\ + name/**/_initialised = .true. &&\ +!$omp end single &&\ +end if &&\ +call lc_control_init (name/**/_lc, name/**/_lm, imin,jmin,kmin, imax,jmax,kmax, ilsh,jlsh,klsh) &&\ + &&\ +/* Coarse loop */ &&\ +do name/**/_kk = name/**/_lc%kkmin + 1, name/**/_lc%kkmax, name/**/_lc%kkstep &&\ + name/**/_kmax = min (name/**/_kk - 1 + name/**/_lc%kkstep, name/**/_lc%kkmax) &&\ + do name/**/_jj = name/**/_lc%jjmin + 1, name/**/_lc%jjmax, name/**/_lc%jjstep &&\ + name/**/_jmax = min (name/**/_jj - 1 + name/**/_lc%jjstep, name/**/_lc%jjmax) &&\ + do name/**/_ii = name/**/_lc%iimin + 1, name/**/_lc%iimax, name/**/_lc%iistep &&\ + name/**/_imax = min (name/**/_ii - 1 + name/**/_lc%iistep, name/**/_lc%iimax) &&\ + &&\ + /* Fine loop */ &&\ + do k = name/**/_kk, name/**/_kmax &&\ + do j = name/**/_jj, name/**/_jmax &&\ + do i = name/**/_ii, name/**/_imax + + + +#define LC_ENDLOOP3(name) &&\ + end do &&\ + end do &&\ + end do &&\ + &&\ + end do &&\ + end do &&\ +end do &&\ + &&\ +call lc_control_finish (name/**/_lc) + + + +#endif /* #ifndef LOOPCONTROL_FORTRAN_H */ |