From a67c43c191536108d70088da96a214869a1483d2 Mon Sep 17 00:00:00 2001 From: Erwan Cossevin Date: Fri, 3 Jan 2025 10:47:59 +0000 Subject: [PATCH] Fixing bug in dataflow analysis --- .../cpphinp.intfb.h | 35 ++++ .../cpphinp_openacc.intfb.h | 40 ++++ .../path_map_openacc.pkl | Bin 0 -> 142 bytes .../tests/test_parallel_routine_dispatch.py | 191 ++++++++++-------- .../parallel_routine_dispatch.py | 90 +++++---- 5 files changed, 230 insertions(+), 126 deletions(-) create mode 100644 transformations/tests/sources/projParallelRoutineDispatch/cpphinp.intfb.h create mode 100644 transformations/tests/sources/projParallelRoutineDispatch/cpphinp_openacc.intfb.h create mode 100644 transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl diff --git a/transformations/tests/sources/projParallelRoutineDispatch/cpphinp.intfb.h b/transformations/tests/sources/projParallelRoutineDispatch/cpphinp.intfb.h new file mode 100644 index 000000000..5e08a3b53 --- /dev/null +++ b/transformations/tests/sources/projParallelRoutineDispatch/cpphinp.intfb.h @@ -0,0 +1,35 @@ +INTERFACE +SUBROUTINE CPPHINP(YDGEOMETRY,YDMODEL,KIDIA,KFDIA,& + & PGEMU,PGELAM,& + & PUT0,PVT0,PQT0,PQT0L,PQT0M,PQSLT0L,PQSLT0M,& + & PRDELP0,PEVEL0,PCVGQSL,& + & PMU0,PMU0LU,PMU0M,PMU0N,PCVGQ,PCVGT) +USE PARKIND1 , ONLY : JPIM, JPRB +USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK +USE TYPE_MODEL , ONLY : MODEL +USE GEOMETRY_MOD , ONLY : GEOMETRY +IMPLICIT NONE +TYPE(GEOMETRY) ,INTENT(IN) :: YDGEOMETRY +TYPE(MODEL) ,INTENT(IN) :: YDMODEL +INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA +INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA +REAL(KIND=JPRB) ,INTENT(IN) :: PGEMU(YDGEOMETRY%YRDIM%NPROMA) +REAL(KIND=JPRB) ,INTENT(IN) :: PGELAM(YDGEOMETRY%YRDIM%NPROMA) +REAL(KIND=JPRB) ,INTENT(IN) :: PUT0(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PVT0(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PQT0(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PQT0L(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PQT0M(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PQSLT0L(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PQSLT0M(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PRDELP0(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PEVEL0(YDGEOMETRY%YRDIM%NPROMA,0:YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(IN) :: PCVGQSL(YDGEOMETRY%YRDIM%NPROMA,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(OUT) :: PMU0(YDGEOMETRY%YRDIM%NPROMA) +REAL(KIND=JPRB) ,INTENT(OUT) :: PMU0LU(YDGEOMETRY%YRDIM%NPROMA) +REAL(KIND=JPRB) ,INTENT(OUT) :: PMU0M(YDGEOMETRY%YRDIM%NPROMA) +REAL(KIND=JPRB) ,INTENT(OUT) :: PMU0N(YDGEOMETRY%YRDIM%NPROMA) +REAL(KIND=JPRB) ,INTENT(OUT) :: PCVGQ(YDGEOMETRY%YRDIM%NPROMM,YDGEOMETRY%YRDIMV%NFLEVG) +REAL(KIND=JPRB) ,INTENT(OUT) :: PCVGT(YDGEOMETRY%YRDIM%NPROMM, YDGEOMETRY%YRDIMV%NFLEVG) +END SUBROUTINE CPPHINP +END INTERFACE diff --git a/transformations/tests/sources/projParallelRoutineDispatch/cpphinp_openacc.intfb.h b/transformations/tests/sources/projParallelRoutineDispatch/cpphinp_openacc.intfb.h new file mode 100644 index 000000000..cdfeede4b --- /dev/null +++ b/transformations/tests/sources/projParallelRoutineDispatch/cpphinp_openacc.intfb.h @@ -0,0 +1,40 @@ +INTERFACE +SUBROUTINE CPPHINP (YDGEOMETRY, YDMODEL, KIDIA, KFDIA, PGEMU, PGELAM,& +& PUT0, PVT0, PTT0L, PTT0M, PQT0, PQT0L, PQT0M, PQSLT0L, PQSLT0M, PRDELP0, PEVEL0& +&, PCVGQSL, PMU0, PSOLO, PMU0LU, PMU0M, PMU0N, PCVGQ, PCVGT, YDSTACK) +!$acc routine (CPPHINP_OPENACC) seq +USE PARKIND1,ONLY:JPIM, JPRB +USE TYPE_MODEL,ONLY:MODEL +USE GEOMETRY_MOD,ONLY:GEOMETRY +USE ABOR1_ACC_MOD +USE STACK_MOD +IMPLICIT NONE +TYPE (GEOMETRY), INTENT (IN)::YDGEOMETRY +TYPE (MODEL), INTENT (IN)::YDMODEL +INTEGER (KIND=JPIM), INTENT (IN)::KIDIA +INTEGER (KIND=JPIM), INTENT (IN)::KFDIA +REAL (KIND=JPRB), INTENT (IN)::PGEMU (YDGEOMETRY%YRDIM%NPROMA) +REAL (KIND=JPRB), INTENT (IN)::PGELAM (YDGEOMETRY%YRDIM%NPROMA) +REAL (KIND=JPRB), INTENT (IN)::PUT0 (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PVT0 (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PQT0 (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PQT0L (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PQT0M (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PTT0L (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PTT0M (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PQSLT0L (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PQSLT0M (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PRDELP0 (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PEVEL0 (YDGEOMETRY%YRDIM%NPROMA, 0:YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (IN)::PCVGQSL (YDGEOMETRY%YRDIM%NPROMA, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (OUT)::PMU0 (YDGEOMETRY%YRDIM%NPROMA) +REAL (KIND=JPRB), INTENT (OUT)::PSOLO (YDGEOMETRY%YRDIM%NPROMA) +REAL (KIND=JPRB), INTENT (OUT)::PMU0LU (YDGEOMETRY%YRDIM%NPROMA) +REAL (KIND=JPRB), INTENT (OUT)::PMU0M (YDGEOMETRY%YRDIM%NPROMA) +REAL (KIND=JPRB), INTENT (OUT)::PMU0N (YDGEOMETRY%YRDIM%NPROMA) +REAL (KIND=JPRB), INTENT (OUT)::PCVGQ (YDGEOMETRY%YRDIM%NPROMM, YDGEOMETRY%YRDIMV%NFLEVG) +REAL (KIND=JPRB), INTENT (OUT)::PCVGT (YDGEOMETRY%YRDIM%NPROMM, YDGEOMETRY%YRDIMV%NFLEVG) +TYPE(STACK) :: YDSTACK +ENDSUBROUTINE CPPHINP + +END INTERFACE diff --git a/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl b/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl new file mode 100644 index 0000000000000000000000000000000000000000..7f2bab16da3dc317b644755556e46fe43b5049b3 GIT binary patch literal 142 zcmXYqF%H5o3`H4`xJ`Wt4uH4-GLcJ6li0FdHYB939m9R8fIq#ry#Lz2m)&pAz8;cl z=B9l$$WjSz6&0#!g(U9u;6_kn;>##DeF?&_`KA?vr8xw7IJnG~$U#l+Cp0XD%30>v U0!MbmNE!ZT1GgBjL+(C&0BCtNuK)l5 literal 0 HcmV?d00001 diff --git a/transformations/tests/test_parallel_routine_dispatch.py b/transformations/tests/test_parallel_routine_dispatch.py index 10f4fbf06..71fa68a0d 100644 --- a/transformations/tests/test_parallel_routine_dispatch.py +++ b/transformations/tests/test_parallel_routine_dispatch.py @@ -18,6 +18,8 @@ import os +import pickle + @pytest.fixture(scope='module', name='here') def fixture_here(): @@ -40,7 +42,7 @@ def test_parallel_routine_dispatch_dr_hook(here, frontend): "KPROMA", "YDDIM%NPROMA", "NPROMA" ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -64,7 +66,7 @@ def test_parallel_routine_dispatch_decl_local_arrays(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -122,7 +124,7 @@ def test_parallel_routine_dispatch_decl_field_create_delete(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -178,7 +180,7 @@ def test_parallel_routine_dispatch_derived_dcl(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -216,7 +218,7 @@ def test_parallel_routine_dispatch_derived_var(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -254,14 +256,21 @@ def test_parallel_routine_dispatch_get_data(here, frontend): item = ProcedureItem(name='parallel_routine_dispatch', source=source) routine = source['dispatch_routine'] - is_intent = False + is_intent = True + #build path_to_openacc.pkl: + path = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/cpphinp.intfb.h" + dic = {} + dic["cpphinp"] = path + with open(os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl", "wb") as f: + pickle.dump(dic, f) + horizontal = [ "KLON", "YDCPG_OPTS%KLON", "YDGEOMETRY%YRDIM%NPROMA", "KPROMA", "YDDIM%NPROMA", "NPROMA" ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -269,28 +278,6 @@ def test_parallel_routine_dispatch_get_data(here, frontend): get_data = item.trafo_data['create_parallel']['map_routine']['map_region']['get_data'] test_get_data = {} -# test_get_data["OpenMP"] = """ -#IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 0, ZHOOK_HANDLE_FIELD_API) -#ZRDG_CVGQ => GET_HOST_DATA_RDWR(YL_ZRDG_CVGQ) -#ZRDG_MU0 => GET_HOST_DATA_RDWR(YL_ZRDG_MU0) -#ZRDG_MU0LU => GET_HOST_DATA_RDWR(YL_ZRDG_MU0LU) -#ZRDG_MU0M => GET_HOST_DATA_RDWR(YL_ZRDG_MU0M) -#ZRDG_MU0N => GET_HOST_DATA_RDWR(YL_ZRDG_MU0N) -#Z_YDCPG_DYN0_CTY_EVEL => GET_HOST_DATA_RDONLY(YDCPG_DYN0%CTY%F_EVEL) -#Z_YDCPG_PHY0_XYB_RDELP => GET_HOST_DATA_RDONLY(YDCPG_PHY0%XYB%F_RDELP) -#Z_YDVARS_CVGQ_DL => GET_HOST_DATA_RDONLY(YDVARS%CVGQ%FDL) -#Z_YDVARS_CVGQ_DM => GET_HOST_DATA_RDONLY(YDVARS%CVGQ%FDM) -#Z_YDVARS_CVGQ_T0 => GET_HOST_DATA_RDONLY(YDVARS%CVGQ%FT0) -#Z_YDVARS_GEOMETRY_GELAM_T0 => GET_HOST_DATA_RDONLY(YDVARS%GEOMETRY%GELAM%FT0) -#Z_YDVARS_GEOMETRY_GEMU_T0 => GET_HOST_DATA_RDONLY(YDVARS%GEOMETRY%GEMU%FT0) -#Z_YDVARS_Q_DL => GET_HOST_DATA_RDONLY(YDVARS%Q%FDL) -#Z_YDVARS_Q_DM => GET_HOST_DATA_RDONLY(YDVARS%Q%FDM) -#Z_YDVARS_Q_T0 => GET_HOST_DATA_RDONLY(YDVARS%Q%FT0) -#Z_YDVARS_U_T0 => GET_HOST_DATA_RDONLY(YDVARS%U%FT0) -#Z_YDVARS_V_T0 => GET_HOST_DATA_RDONLY(YDVARS%V%FT0) -#Z_YDMF_PHYS_SURF_GSD_VF_PZ0F => GET_HOST_DATA_RDONLY(YDMF_PHYS_SURF%GSD_VF%F_Z0F) -#IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 1, ZHOOK_HANDLE_FIELD_API) -#""" test_get_data["OpenMP"] = """ IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 0, ZHOOK_HANDLE_FIELD_API) ZRDG_CVGQ => GET_HOST_DATA_RDWR(YL_ZRDG_CVGQ) @@ -298,47 +285,48 @@ def test_parallel_routine_dispatch_get_data(here, frontend): ZRDG_MU0LU => GET_HOST_DATA_RDWR(YL_ZRDG_MU0LU) ZRDG_MU0M => GET_HOST_DATA_RDWR(YL_ZRDG_MU0M) ZRDG_MU0N => GET_HOST_DATA_RDWR(YL_ZRDG_MU0N) -Z_YDCPG_DYN0_CTY_EVEL => GET_HOST_DATA_RDWR(YDCPG_DYN0%CTY%F_EVEL) -Z_YDCPG_PHY0_XYB_RDELP => GET_HOST_DATA_RDWR(YDCPG_PHY0%XYB%F_RDELP) -Z_YDVARS_CVGQ_DL => GET_HOST_DATA_RDWR(YDVARS%CVGQ%FDL) -Z_YDVARS_CVGQ_DM => GET_HOST_DATA_RDWR(YDVARS%CVGQ%FDM) -Z_YDVARS_CVGQ_T0 => GET_HOST_DATA_RDWR(YDVARS%CVGQ%FT0) -Z_YDVARS_GEOMETRY_GELAM_T0 => GET_HOST_DATA_RDWR(YDVARS%GEOMETRY%GELAM%FT0) -Z_YDVARS_GEOMETRY_GEMU_T0 => GET_HOST_DATA_RDWR(YDVARS%GEOMETRY%GEMU%FT0) -Z_YDVARS_Q_DL => GET_HOST_DATA_RDWR(YDVARS%Q%FDL) -Z_YDVARS_Q_DM => GET_HOST_DATA_RDWR(YDVARS%Q%FDM) -Z_YDVARS_Q_T0 => GET_HOST_DATA_RDWR(YDVARS%Q%FT0) -Z_YDVARS_U_T0 => GET_HOST_DATA_RDWR(YDVARS%U%FT0) -Z_YDVARS_V_T0 => GET_HOST_DATA_RDWR(YDVARS%V%FT0) +Z_YDCPG_DYN0_CTY_EVEL => GET_HOST_DATA_RDONLY(YDCPG_DYN0%CTY%F_EVEL) +Z_YDCPG_PHY0_XYB_RDELP => GET_HOST_DATA_RDONLY(YDCPG_PHY0%XYB%F_RDELP) +Z_YDVARS_CVGQ_DL => GET_HOST_DATA_RDONLY(YDVARS%CVGQ%FDL) +Z_YDVARS_CVGQ_DM => GET_HOST_DATA_RDONLY(YDVARS%CVGQ%FDM) +Z_YDVARS_CVGQ_T0 => GET_HOST_DATA_RDONLY(YDVARS%CVGQ%FT0) +Z_YDVARS_GEOMETRY_GELAM_T0 => GET_HOST_DATA_RDONLY(YDVARS%GEOMETRY%GELAM%FT0) +Z_YDVARS_GEOMETRY_GEMU_T0 => GET_HOST_DATA_RDONLY(YDVARS%GEOMETRY%GEMU%FT0) +Z_YDVARS_Q_DL => GET_HOST_DATA_RDONLY(YDVARS%Q%FDL) +Z_YDVARS_Q_DM => GET_HOST_DATA_RDONLY(YDVARS%Q%FDM) +Z_YDVARS_Q_T0 => GET_HOST_DATA_RDONLY(YDVARS%Q%FT0) +Z_YDVARS_U_T0 => GET_HOST_DATA_RDONLY(YDVARS%U%FT0) +Z_YDVARS_V_T0 => GET_HOST_DATA_RDONLY(YDVARS%V%FT0) Z_YDMF_PHYS_SURF_GSD_VF_PZ0F => GET_HOST_DATA_RDWR(YDMF_PHYS_SURF%GSD_VF%F_Z0F) -TOTO => GET_HOST_DATA_RDWR(YL_TOTO) +TOTO => GET_HOST_DATA_RDONLY(YL_TOTO) Z_YDMF_PHYS_OUT_CT => GET_HOST_DATA_RDWR(YDMF_PHYS%OUT%F_CT) IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 1, ZHOOK_HANDLE_FIELD_API) """ - test_get_data["OpenMPSingleColumn"] = test_get_data["OpenMP"] - -# test_get_data["OpenACCSingleColumn"] = """ -#IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 0, ZHOOK_HANDLE_FIELD_API) -#ZRDG_CVGQ => GET_DEVICE_DATA_RDWR(YL_ZRDG_CVGQ) -#ZRDG_MU0 => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0) -#ZRDG_MU0LU => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0LU) -#ZRDG_MU0M => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0M) -#ZRDG_MU0N => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0N) -#Z_YDCPG_DYN0_CTY_EVEL => GET_DEVICE_DATA_RDONLY(YDCPG_DYN0%CTY%F_EVEL) -#Z_YDCPG_PHY0_XYB_RDELP => GET_DEVICE_DATA_RDONLY(YDCPG_PHY0%XYB%F_RDELP) -#Z_YDVARS_CVGQ_DL => GET_DEVICE_DATA_RDONLY(YDVARS%CVGQ%FDL) -#Z_YDVARS_CVGQ_DM => GET_DEVICE_DATA_RDONLY(YDVARS%CVGQ%FDM) -#Z_YDVARS_CVGQ_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%CVGQ%FT0) -#Z_YDVARS_GEOMETRY_GELAM_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%GEOMETRY%GELAM%FT0) -#Z_YDVARS_GEOMETRY_GEMU_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%GEOMETRY%GEMU%FT0) -#Z_YDVARS_Q_DL => GET_DEVICE_DATA_RDONLY(YDVARS%Q%FDL) -#Z_YDVARS_Q_DM => GET_DEVICE_DATA_RDONLY(YDVARS%Q%FDM) -#Z_YDVARS_Q_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%Q%FT0) -#Z_YDVARS_U_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%U%FT0) -#Z_YDVARS_V_T0 => GET_DEVICE_DATA_RDONLY (YDVARS%V%FT0) -#Z_YDMF_PHYS_SURF_GSD_VF_PZ0F => GET_DEVICE_DATA_RDONLY(YDMF_PHYS_SURF%GSD_VF%F_Z0F) |276 REAL(KIND=JPRB) :: ZPFL_FPLSH (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) -#IF(LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 1, ZHOOK_HANDLE_FIELD_API) +# test_get_data["OpenMP"] = """ +#IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 0, ZHOOK_HANDLE_FIELD_API) +#ZRDG_CVGQ => GET_HOST_DATA_RDWR(YL_ZRDG_CVGQ) +#ZRDG_MU0 => GET_HOST_DATA_RDWR(YL_ZRDG_MU0) +#ZRDG_MU0LU => GET_HOST_DATA_RDWR(YL_ZRDG_MU0LU) +#ZRDG_MU0M => GET_HOST_DATA_RDWR(YL_ZRDG_MU0M) +#ZRDG_MU0N => GET_HOST_DATA_RDWR(YL_ZRDG_MU0N) +#Z_YDCPG_DYN0_CTY_EVEL => GET_HOST_DATA_RDWR(YDCPG_DYN0%CTY%F_EVEL) +#Z_YDCPG_PHY0_XYB_RDELP => GET_HOST_DATA_RDWR(YDCPG_PHY0%XYB%F_RDELP) +#Z_YDVARS_CVGQ_DL => GET_HOST_DATA_RDWR(YDVARS%CVGQ%FDL) +#Z_YDVARS_CVGQ_DM => GET_HOST_DATA_RDWR(YDVARS%CVGQ%FDM) +#Z_YDVARS_CVGQ_T0 => GET_HOST_DATA_RDWR(YDVARS%CVGQ%FT0) +#Z_YDVARS_GEOMETRY_GELAM_T0 => GET_HOST_DATA_RDWR(YDVARS%GEOMETRY%GELAM%FT0) +#Z_YDVARS_GEOMETRY_GEMU_T0 => GET_HOST_DATA_RDWR(YDVARS%GEOMETRY%GEMU%FT0) +#Z_YDVARS_Q_DL => GET_HOST_DATA_RDWR(YDVARS%Q%FDL) +#Z_YDVARS_Q_DM => GET_HOST_DATA_RDWR(YDVARS%Q%FDM) +#Z_YDVARS_Q_T0 => GET_HOST_DATA_RDWR(YDVARS%Q%FT0) +#Z_YDVARS_U_T0 => GET_HOST_DATA_RDWR(YDVARS%U%FT0) +#Z_YDVARS_V_T0 => GET_HOST_DATA_RDWR(YDVARS%V%FT0) +#Z_YDMF_PHYS_SURF_GSD_VF_PZ0F => GET_HOST_DATA_RDWR(YDMF_PHYS_SURF%GSD_VF%F_Z0F) +#TOTO => GET_HOST_DATA_RDWR(YL_TOTO) +#Z_YDMF_PHYS_OUT_CT => GET_HOST_DATA_RDWR(YDMF_PHYS%OUT%F_CT) +#IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 1, ZHOOK_HANDLE_FIELD_API) #""" + test_get_data["OpenMPSingleColumn"] = test_get_data["OpenMP"] test_get_data["OpenACCSingleColumn"] = """ IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 0, ZHOOK_HANDLE_FIELD_API) @@ -347,24 +335,49 @@ def test_parallel_routine_dispatch_get_data(here, frontend): ZRDG_MU0LU => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0LU) ZRDG_MU0M => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0M) ZRDG_MU0N => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0N) -Z_YDCPG_DYN0_CTY_EVEL => GET_DEVICE_DATA_RDWR(YDCPG_DYN0%CTY%F_EVEL) -Z_YDCPG_PHY0_XYB_RDELP => GET_DEVICE_DATA_RDWR(YDCPG_PHY0%XYB%F_RDELP) -Z_YDVARS_CVGQ_DL => GET_DEVICE_DATA_RDWR(YDVARS%CVGQ%FDL) -Z_YDVARS_CVGQ_DM => GET_DEVICE_DATA_RDWR(YDVARS%CVGQ%FDM) -Z_YDVARS_CVGQ_T0 => GET_DEVICE_DATA_RDWR(YDVARS%CVGQ%FT0) -Z_YDVARS_GEOMETRY_GELAM_T0 => GET_DEVICE_DATA_RDWR(YDVARS%GEOMETRY%GELAM%FT0) -Z_YDVARS_GEOMETRY_GEMU_T0 => GET_DEVICE_DATA_RDWR(YDVARS%GEOMETRY%GEMU%FT0) -Z_YDVARS_Q_DL => GET_DEVICE_DATA_RDWR(YDVARS%Q%FDL) -Z_YDVARS_Q_DM => GET_DEVICE_DATA_RDWR(YDVARS%Q%FDM) -Z_YDVARS_Q_T0 => GET_DEVICE_DATA_RDWR(YDVARS%Q%FT0) -Z_YDVARS_U_T0 => GET_DEVICE_DATA_RDWR(YDVARS%U%FT0) -Z_YDVARS_V_T0 => GET_DEVICE_DATA_RDWR(YDVARS%V%FT0) -Z_YDMF_PHYS_SURF_GSD_VF_PZ0F => GET_DEVICE_DATA_RDWR(YDMF_PHYS_SURF%GSD_VF%F_Z0F) |276 REAL(KIND=JPRB) :: ZPFL_FPLSH (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) -TOTO => GET_DEVICE_DATA_RDWR(YL_TOTO) +Z_YDCPG_DYN0_CTY_EVEL => GET_DEVICE_DATA_RDONLY(YDCPG_DYN0%CTY%F_EVEL) +Z_YDCPG_PHY0_XYB_RDELP => GET_DEVICE_DATA_RDONLY(YDCPG_PHY0%XYB%F_RDELP) +Z_YDVARS_CVGQ_DL => GET_DEVICE_DATA_RDONLY(YDVARS%CVGQ%FDL) +Z_YDVARS_CVGQ_DM => GET_DEVICE_DATA_RDONLY(YDVARS%CVGQ%FDM) +Z_YDVARS_CVGQ_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%CVGQ%FT0) +Z_YDVARS_GEOMETRY_GELAM_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%GEOMETRY%GELAM%FT0) +Z_YDVARS_GEOMETRY_GEMU_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%GEOMETRY%GEMU%FT0) +Z_YDVARS_Q_DL => GET_DEVICE_DATA_RDONLY(YDVARS%Q%FDL) +Z_YDVARS_Q_DM => GET_DEVICE_DATA_RDONLY(YDVARS%Q%FDM) +Z_YDVARS_Q_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%Q%FT0) +Z_YDVARS_U_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%U%FT0) +Z_YDVARS_V_T0 => GET_DEVICE_DATA_RDONLY(YDVARS%V%FT0) +Z_YDMF_PHYS_SURF_GSD_VF_PZ0F => GET_DEVICE_DATA_RDWR(YDMF_PHYS_SURF%GSD_VF%F_Z0F) +TOTO => GET_DEVICE_DATA_RDONLY(YL_TOTO) Z_YDMF_PHYS_OUT_CT => GET_DEVICE_DATA_RDWR(YDMF_PHYS%OUT%F_CT) IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 1, ZHOOK_HANDLE_FIELD_API) """ +# test_get_data["OpenACCSingleColumn"] = """ +#IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 0, ZHOOK_HANDLE_FIELD_API) +#ZRDG_CVGQ => GET_DEVICE_DATA_RDWR(YL_ZRDG_CVGQ) +#ZRDG_MU0 => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0) +#ZRDG_MU0LU => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0LU) +#ZRDG_MU0M => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0M) +#ZRDG_MU0N => GET_DEVICE_DATA_RDWR(YL_ZRDG_MU0N) +#Z_YDCPG_DYN0_CTY_EVEL => GET_DEVICE_DATA_RDWR(YDCPG_DYN0%CTY%F_EVEL) +#Z_YDCPG_PHY0_XYB_RDELP => GET_DEVICE_DATA_RDWR(YDCPG_PHY0%XYB%F_RDELP) +#Z_YDVARS_CVGQ_DL => GET_DEVICE_DATA_RDWR(YDVARS%CVGQ%FDL) +#Z_YDVARS_CVGQ_DM => GET_DEVICE_DATA_RDWR(YDVARS%CVGQ%FDM) +#Z_YDVARS_CVGQ_T0 => GET_DEVICE_DATA_RDWR(YDVARS%CVGQ%FT0) +#Z_YDVARS_GEOMETRY_GELAM_T0 => GET_DEVICE_DATA_RDWR(YDVARS%GEOMETRY%GELAM%FT0) +#Z_YDVARS_GEOMETRY_GEMU_T0 => GET_DEVICE_DATA_RDWR(YDVARS%GEOMETRY%GEMU%FT0) +#Z_YDVARS_Q_DL => GET_DEVICE_DATA_RDWR(YDVARS%Q%FDL) +#Z_YDVARS_Q_DM => GET_DEVICE_DATA_RDWR(YDVARS%Q%FDM) +#Z_YDVARS_Q_T0 => GET_DEVICE_DATA_RDWR(YDVARS%Q%FT0) +#Z_YDVARS_U_T0 => GET_DEVICE_DATA_RDWR(YDVARS%U%FT0) +#Z_YDVARS_V_T0 => GET_DEVICE_DATA_RDWR(YDVARS%V%FT0) +#Z_YDMF_PHYS_SURF_GSD_VF_PZ0F => GET_DEVICE_DATA_RDWR(YDMF_PHYS_SURF%GSD_VF%F_Z0F) |276 REAL(KIND=JPRB) :: ZPFL_FPLSH (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +#TOTO => GET_DEVICE_DATA_RDWR(YL_TOTO) +#Z_YDMF_PHYS_OUT_CT => GET_DEVICE_DATA_RDWR(YDMF_PHYS%OUT%F_CT) +#IF (LHOOK) CALL DR_HOOK('DISPATCH_ROUTINE_PARALLEL:CPPHINP:GET_DATA', 1, ZHOOK_HANDLE_FIELD_API) +#""" + for target in get_data: for node in get_data[target]: assert fgen(node) in test_get_data[target] @@ -411,7 +424,7 @@ def test_parallel_routine_dispatch_synchost(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -461,7 +474,7 @@ def test_parallel_routine_dispatch_nullify(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -510,7 +523,7 @@ def test_parallel_routine_dispatch_compute_openmp(here, frontend): "KPROMA", "YDDIM%NPROMA", "NPROMA" ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) @@ -575,7 +588,7 @@ def test_parallel_routine_dispatch_compute_openmpscc(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -655,7 +668,7 @@ def test_parallel_routine_dispatch_compute_openaccscc(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -753,7 +766,7 @@ def test_parallel_routine_dispatch_variables(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -787,7 +800,7 @@ def test_parallel_routine_dispatch_imports(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -823,7 +836,7 @@ def test_parallel_routine_dispatch_imports(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -850,7 +863,7 @@ def test_parallel_routine_dispatch_lparallel(here, frontend): ] path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" - path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" + path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, path_map_index, path_map_openacc) transformation.apply(source['dispatch_routine'], item=item) @@ -877,7 +890,7 @@ def test_parallel_routine_dispatch_lparallel(here, frontend): # ] # path_map_index = os.getcwd()+"/transformations/transformations/field_index.pkl" # -# path_map_openacc = os.getcwd()+"/transformations/transformations/path_to_openacc.pkl" +# path_map_openacc = os.getcwd()+"/transformations/tests/sources/projParallelRoutineDispatch/path_map_openacc.pkl" # transformation = ParallelRoutineDispatchTransformation(is_intent, horizontal, # path_map_index, path_map_openacc) # transformation.apply(source['dispatch_routine'], item=item) diff --git a/transformations/transformations/parallel_routine_dispatch.py b/transformations/transformations/parallel_routine_dispatch.py index 2189ab56c..1617cbca0 100644 --- a/transformations/transformations/parallel_routine_dispatch.py +++ b/transformations/transformations/parallel_routine_dispatch.py @@ -21,6 +21,7 @@ parse_expr, single_variable_declaration, dataflow_analysis_attached, + Sourcefile, ) from loki.expression import symbols as sym from loki.ir import ( @@ -61,11 +62,12 @@ def __init__(self, is_intent, horizontal, path_map_derived_field, path_map_opena with open(path_map_derived_field, "rb") as fp: self.map_derived_field = pickle.load(fp) - self.path_map_openacc = path_map_openacc - with open(path_map_openacc, "rb") as fp: - #map_openacc contains path to kernel routine - #in order to read their interface and know variable intent - self.map_openacc = pickle.load(fp) + if self.is_intent: + self.path_map_openacc = path_map_openacc + with open(path_map_openacc, "rb") as fp: + #map_openacc contains path to kernel routine + #in order to read their interface and know variable intent + self.map_openacc = pickle.load(fp) @@ -767,7 +769,7 @@ def create_pt_sync(self, routine, region, target, region_name, is_get_data, map_ # raise NotImplementedError( # "Reading the intent from interface isn't implemented yes" # ) - map_intent = get_access_rw(region, map_routine, map_region) + map_intent = self.get_access_rw(region, map_routine, map_region) for var in region_map_var_sorted: if is_get_data : @@ -777,7 +779,7 @@ def create_pt_sync(self, routine, region, target, region_name, is_get_data, map_ # raise NotImplementedError( # "Reading the intent from interface isn't implemented yes" # ) - intent = map_intent[var.name] + intent = map_intent[var[1].name] else: intent = "RDWR" # for SYNCHOST, always RDWR call = sym.InlineCall( @@ -791,31 +793,30 @@ def create_pt_sync(self, routine, region, target, region_name, is_get_data, map_ return sync_data - def get_access_rw(region, map_routine, map_region): + def get_access_rw(self, region, map_routine, map_region): """ Use interface reading and dataflow analysis to get data access (RDONLY/RDWR). """ #interface intent: - map_call_intent = intfb_intent_analysis(region, map_routine) - + map_call_intent = self.intfb_intent_analysis(region, map_routine) #dataflow intent: - rdonly = region.uses_symbols - rdwr = region.defines_symbols + rdonly = region.uses_symbols + rdwr = region.defines_symbols - region.uses_symbols #switch rdonly/rdwr to in/out: - map_intent = {var.name.name : "in" for var in rdonly} - map_intent = map_intent | {var.name.name : "out" for var in rdwr} + map_intent = {var : "in" for var in rdonly} + map_intent = map_intent | {var : "out" for var in rdwr} #merge dataflow intents and interface intents - for arg_name in map_call_intent: - intent = map_call_intent[arg_name] - if arg_name not in map_intent: - map_intent[arg_name] = intent + for arg in map_call_intent: + intent = map_call_intent[arg] + if arg not in map_intent: + map_intent[arg] = intent else: - map_intent[arg_name] = analyse_intent( - intent, map_intent[arg_name] + map_intent[arg] = self.analyse_intent( + intent, map_intent[arg] ) #switch from in/out to rdwr + change var name @@ -827,28 +828,43 @@ def get_access_rw(region, map_routine, map_region): map_intent_access["in"] = "RDONLY" map_intent_access["out"] = "RDWR" map_intent_access["inout"] = "RDWR" - new_map_intent = {region_map_vars[var_name][1]: map_intent_access[intent] for var_name, value in map_intent.items()} + new_map_intent = {} + for var, value in map_intent.items(): + if var.name in region_map_vars: + new_map_intent[region_map_vars[var.name][1].name] = map_intent_access[value] + #region_map_vars[var.name][1]: map_intent_access[intent] for var, value in map_intent.items()} + return(new_map_intent) - def analyse_intent(intent1, intent2): + def analyse_intent(self, intent1, intent2): """ Rules for updating the intent of a variable already having an intent. """ - if intent1 or intent2 == "out": + if (intent1 or intent2) == "out": return "out" - elif intent1 or intent2 == "inout": + elif (intent1 or intent2) == "inout": return "inout" - elif intent1 and intent2 == "in": + elif (intent1 and intent2) == "in": return "in" - def read_interface(call_name, map_call_interface): + def read_interface(self, call_name, map_call_interface): + + call_name = call_name.lower() + if call_name.upper() not in map_call_interface: + interface_path = self.map_openacc[call_name] + with open(interface_path) as f: + lines = f.readlines() + lines = lines[1:-1]# rm INTERFACE and END INTERFACE from the routine + content_call = "".join(lines) + call_source = Sourcefile.from_source(content_call) + call_ir = call_source[call_name.upper()] + map_call_interface[call_name.upper()] = call_ir - interface_path = self.map_openacc[call_name] # with open(map_call_interface[call_name]) : ##TODO check call_name format and path in... self.map_openacc => diff path if in pack or in test mode, for the moment just do test mode...) Use pathpack, pathview etc should work fine to build the interface_path) # - def intfb_intent_analysis(region, map_routine): + def intfb_intent_analysis(self, region, map_routine): """ Read the interface of the call statement of the region in order to get arguments intent. Return a arg_name : intent @@ -861,28 +877,28 @@ def intfb_intent_analysis(region, map_routine): for call in calls : if call.name.name not in map_call_interface: - map_call_interface[call.name.name] = read_interface(call.name.name, map_call_interface) + self.read_interface(call.name.name, map_call_interface) call_intfb = map_call_interface[call.name.name] - if len(call.arguments) != len(routine.arguments): + if len(call.arguments) != len(call_intfb.arguments): # # same nb of arguments, that may be due to optional args, #or smthg else that wasn't anticipated raise NotImplementedError( "Optional arguments not implemented here" ) #Can't use args name, dummy and actual args may have different names - for arg_idx in len(call.arguments): - arg_name = call.arguments[arg_idx] + for arg_idx in range(len(call.arguments)): + arg = call.arguments[arg_idx] intent = call_intfb.arguments[arg_idx].type.intent - if arg_name not in map_calls_intent: - map_calls_intent[arg_name] = intent + if arg not in map_calls_intent: + map_calls_intent[arg] = intent #map_region_intent[arg_name] = map_intent[call_name][arg_name] else: - map_calls_intent[arg_name] = analyse_intent( - intent, map_calls_intent[arg_name] + map_calls_intent[arg] = self.analyse_intent( + intent, map_calls_intent[arg] ) # comparing intent of the arg in the other calls with the intent of the arg in the call - return(map_region_intent) + return(map_calls_intent)