Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTN compiled stucks at move_alloc #399

Open
dsidoren opened this issue Dec 20, 2022 · 6 comments
Open

FTN compiled stucks at move_alloc #399

dsidoren opened this issue Dec 20, 2022 · 6 comments

Comments

@dsidoren
Copy link
Collaborator

dsidoren commented Dec 20, 2022

call move_alloc(tmparr, this%dims)

@hegish @koldunovn @patrickscholz the ftn 2.7.17 at lumi cannot handle move_alloc. A workaround required urgently!

@patrickscholz
Copy link
Contributor

@dsidoren
Copy link
Collaborator Author

dsidoren commented Dec 20, 2022

Hi Patrick, indeed I changed the code in the similar manner as you suggested. The problem persists and it turns out that I traced it incorrectly. Everything happens two line above:

tmparr(1:size(this%dims)) = this%dims

The code crashes with an error:

[EC_DRHOOK:nid001013:28:1:178507:178507] [20221220:205540:1671562540:8.780] [signal_drhook@ifsaux/support/drhook.c:1988] : [07]: F90_COPY_POLYMORPHIC /opt/cray/pe/cce/14.0.2/cce/x86_64/lib/libf.so.1 0x151e336e9000 0x151e33709e9e # addr2line
[EC_DRHOOK:nid001013:28:1:178507:178507] [20221220:205540:1671562540:8.780] [signal_drhook@ifsaux/support/drhook.c:1988] : [08]: add_dim$io_netcdf_file_module
/pfs/lustrep2/users/sidorenko/RAPS20/flexbuild/bin/../external/cce.lumi/install/lib/libfesom.so 0x151e344aa000 0x151e34a3cafb # a

Cray Compiling Environment (CCE) raises error in _F90_COPY_POLYMORPHIC

Some treatment is required here!

@trackow
Copy link
Contributor

trackow commented Dec 20, 2022

This seems to be related to the fact that the dim_type and var_type contain allocatable types. From a comment in the code, this has apparently been an issue before (albeit with the nvfortran compiler @hegish ) when copying an array where nvfortran lost allocation of those derived types.

This dirty fix with a fixed character length works for me on LUMI, but we should find something better:

diff --git a/src/io_netcdf_file_module.F90 b/src/io_netcdf_file_module.F90
index 9eb6a245..385e0902 100644
--- a/src/io_netcdf_file_module.F90
+++ b/src/io_netcdf_file_module.F90
@@ -5,7 +5,7 @@ module io_netcdf_file_module
   private
 
   type dim_type
-    character(:), allocatable :: name
+    character(1000) :: name
     integer len
     integer ncid
   end type
@@ -15,7 +15,7 @@ module io_netcdf_file_module
   end type
 
   type var_type ! todo: use variable type from io_netcdf_module here
-    character(:), allocatable :: name
+    character(1000) :: name
     integer, allocatable :: dim_indices(:)
     integer datatype

Note that doing this only for the dim_type let's the model fail with another F90_COPY_POLYMORPHIC issue:

[EC_DRHOOK:nid001314:2:1:169921:169921] [20221221:011331:1671578011:8.043] [signal_drhook@ifsaux/support/drhook.c:1988] : [07]: F90_COPY_POLYMORPHIC /opt/cray/pe/cce/14.0.2/cce/x86_64/lib/libf.so.1 0x148603f13000 0x148603f33e9e # addr2line
[EC_DRHOOK:nid001314:2:1:169921:169921] [20221221:011331:1671578011:8.043] [signal_drhook@ifsaux/support/drhook.c:1988] : [08]: add_var_x$io_netcdf_file_module
/pfs/lustrep1/projappl/project_462000048/thorackow/RAPS20_CY47R3_nextGEMS/flexbuild/bin/../external/cce.lumi/install/lib/libfesom.so 0x148604cd5000 0x148604eaa50a # addr2line
[EC_DRHOOK:nid001314:2:1:169921:169921] [20221221:011331:1671578011:8.043] [signal_drhook@ifsaux/support/drhook.c:1988] : [09]: add_var_double$io_netcdf_file_module_

@dsidoren
Copy link
Collaborator Author

Well spotted Thomas! Thanks! I think that limiting the name by 100 shall be sufficient :)

@hegish
Copy link
Collaborator

hegish commented Dec 23, 2022

using a fixed length name will break a lot of thinks, e.g. one would have to use trim everywhere.

@JanStreffing
Copy link
Collaborator

Things are running on lumi, can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants