diff --git a/examples/nemo/scripts/omp_gpu_trans.py b/examples/nemo/scripts/omp_gpu_trans.py index f5192db6e6..fb0cd875cf 100755 --- a/examples/nemo/scripts/omp_gpu_trans.py +++ b/examples/nemo/scripts/omp_gpu_trans.py @@ -37,7 +37,7 @@ ''' PSyclone transformation script showing the introduction of OpenMP for GPU directives into Nemo code. ''' -import os +# import os from utils import ( insert_explicit_loop_parallelism, normalise_loops, add_profiling, enhance_tree_information, PASSTHROUGH_ISSUES, PARALLELISATION_ISSUES) @@ -55,7 +55,8 @@ "iom_nf90.f90", "iom_def.f90", "timing.f90", # Compiler error: Subscript, substring, or argument illegal - "lbcnfd.f90", # Illegal address during kernel execution - line 1012: lbc_nfd_dp + "lbcnfd.f90", # Illegal address during kernel execution + # - line 1012: lbc_nfd_dp "lib_mpp.f90", # Compiler error: Illegal substring expression "prtctl.f90", # Compiler error: Illegal substring expression "sbcblk.f90", # Compiler error: Vector expression used where scalar @@ -63,18 +64,22 @@ ] OFFLOADING_ISSUES = [ - "trcrad.f90", # Illegal address during kernel execution, unless the dimensions are small - "tranxt.f90", # String comparison not allowed inside omp teams (this worked fine with omp loop) - "trazdf.f90", # String comparison not allowed inside omp teams (this worked fine with omp loop) - "crsdom.f90", # String comparison not allowed inside omp teams (this worked fine with omp loop) - "zdftke.f90", # returned error 700 (CUDA_ERROR_ILLEGAL_ADDRESS): Illegal address during kernel execution - "dynzdf.f90", # returned error 700 (CUDA_ERROR_ILLEGAL_ADDRESS): Illegal address during kernel execution + "trcrad.f90", # Illegal address during kernel execution, unless the + # dimensions are small + "tranxt.f90", # String comparison not allowed inside omp teams + # (this worked fine with omp loop) + "trazdf.f90", # String comparison not allowed inside omp teams + "crsdom.f90", # String comparison not allowed inside omp teams + "zdftke.f90", # returned error 700 (CUDA_ERROR_ILLEGAL_ADDRESS): + # Illegal address during kernel execution + "dynzdf.f90", # returned error 700 (CUDA_ERROR_ILLEGAL_ADDRESS) ] PRIVATISATION_ISSUES = [ "ldftra.f90", # Wrong runtime results ] + def trans(psyir): ''' Add OpenMP Target and Loop directives to all loops, including the implicit ones, to parallelise the code and execute it in an acceleration diff --git a/examples/nemo/scripts/utils.py b/examples/nemo/scripts/utils.py index 5b22029c1d..1451edd542 100755 --- a/examples/nemo/scripts/utils.py +++ b/examples/nemo/scripts/utils.py @@ -100,7 +100,7 @@ 'gamma_moist', 'gamma_moist_sclr', 'gamma_moist_vctr', 'get_unit', 'grt_cir_dis', 'grt_cir_dis_saa', 'icb_alloc', 'icb_utl_bilin', 'icb_utl_bilin_2d_h', 'icb_utl_bilin_3d_h', 'icb_utl_bilin_e', - 'icb_utl_bilin_h', 'icb_utl_bilin_x',' icb_utl_count', 'icb_utl_heat', + 'icb_utl_bilin_h', 'icb_utl_bilin_x', 'icb_utl_count', 'icb_utl_heat', 'icb_utl_mass', 'icb_utl_yearday', 'ice1D_alloc', 'ice_alloc', 'ice_dia_alloc', 'ice_dyn_rdgrft_alloc', 'ice_perm_eff', 'ice_thd_pnd_alloc', 'ice_update_alloc', 'ice_var_sshdyn', 'in_hdom', @@ -227,9 +227,10 @@ def enhance_tree_information(schedule): reference.symbol.name.startswith('glob_') or reference.symbol.name.startswith('SIGN_') or reference.symbol.name.startswith('netcdf_') or - (reference.symbol.name.startswith('nf90_') and not - reference.symbol.name in ['nf90_64bit_offset', 'nf90_short', - 'nf90_clobber'])): + (reference.symbol.name.startswith('nf90_') and + reference.symbol.name not in ['nf90_64bit_offset', + 'nf90_short', + 'nf90_clobber'])): if reference.symbol.is_import or reference.symbol.is_unresolved: # The parser gets these wrong, they are Calls not ArrayRefs if not isinstance(reference.symbol, RoutineSymbol):