Changeset 723 for codes


Ignore:
Timestamp:
08/09/18 13:32:43 (6 years ago)
Author:
dubos
Message:

devel : created serial kernels to debug OpenMP (bugfix)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/Python/src/hexagonal/macros.jin

    r721 r723  
    2929#ifdef PASS_PRE2 
    3030 
     31#ifdef HEX_MASTER 
     32#define BARRIER 
     33#else 
    3134#define BARRIER !$OMP BARRIER 
     35#endif 
    3236 
    3337#define KERNEL(name) {% call define_kernel(#name) %} 
     
    8690{% macro at_level_primal(lev,ext) -%} 
    8791{{ define('LL', lev) }} 
     92!DIR$ SIMD 
    8893DO ij={{ ij_omp(ext) }} 
    89 {{ caller() }} 
     94  {{ caller() }} 
    9095END DO 
    9196{%- endmacro %} 
     
    9499{{ define('LL', 'l') }} 
    95100DO l = {{ range }} 
     101  !DIR$ SIMD 
    96102  DO ij={{ ij_omp(ext) }} 
    97103    {{ caller() }} 
     
    106112{% macro at_level_edge(lev,ext) -%} 
    107113{{ define('LL', lev) }} 
     114!DIR$ SIMD 
    108115DO ij={{ ij_omp(ext) }} 
    109116      {{ caller('u_right','t_right') }} 
     
    116123{{ define('LL', 'l') }} 
    117124DO l = {{ range }} 
     125   !DIR$ SIMD 
    118126   DO ij={{ ij_omp(ext) }} 
    119127      {{ caller('u_right','t_right') }} 
     
    147155we shall write special code for l=1 and start the loop at l=2 #} 
    148156 
    149 IF (ll_begin==1) THEN 
     157IF ({{ll_begin}}==1) THEN 
    150158  {{ define('IS_BOTTOM_LEVEL', '_TRUE_') }} 
    151159  {{ define_levels('1', 'ij,1', 'ij,1', thecode) }} 
    152    !DIR$ SIMD 
     160    !DIR$ SIMD 
    153161    DO ij={{ij_range}} 
    154162      {{ thecode }} 
    155163    END DO 
    156164END IF 
    157 {% set start_omp='ll_beginp1' %} 
     165{% set start_omp=ll_beginp1 %} 
    158166{% endif %} 
    159167 
     
    161169{{ 'ERROR : using _IS_TOP_LAYER_ in a loop ending at l=llm+1' if end=='llm+1' }} 
    162170{# the code checks whether l==llm, write special code for l=llm and end the loop at l=llm-1 #} 
    163 {% set end_omp, is_top_layer = 'll_endm1', True %} 
     171{% set end_omp, is_top_layer = ll_endm1, True %} 
    164172{% endif %} 
    165173 
     
    167175{# the code checks whether l==llm+1, write special code for l=llm+1 and end the loop at l=llm #} 
    168176{{ 'ERROR : using _IS_TOP_INTERFACE_ in a loop ending at l=llm' if end=='llm' }} 
    169 {% set end_omp, is_top_inter ='ll_end', True %} 
     177{% set end_omp, is_top_inter = ll_end, True %} 
    170178{% endif %} 
    171179 
     
    173181{{ define_levels('l', 'ij,l-1', 'ij,l', thecode) }} 
    174182DO l = {{start_omp}}, {{end_omp}} 
    175 !DIR$ SIMD 
     183  !DIR$ SIMD 
    176184  DO ij={{ij_range}} 
    177185  {{ thecode }} 
     
    180188 
    181189{% if is_top_layer %} 
    182 IF(ll_end==llm) THEN 
     190IF({{ll_end}}==llm) THEN 
    183191  {{ define('IS_TOP_LAYER', '_TRUE_') }} 
    184192  {{ define_levels('llm', 'ij,llm-1', 'ij,llm', thecode) }} 
     
    191199 
    192200{% if is_top_inter %} 
    193 IF(ll_endp1==llm+1) THEN 
     201IF({{ll_endp1}}==llm+1) THEN 
    194202  {{ define('IS_TOP_INTERFACE', '_TRUE_') }} 
    195203  {{ define_levels('llm+1', 'ij,llm', 'ij,llm', thecode) }} 
Note: See TracChangeset for help on using the changeset viewer.