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

Running simple mo_column example #574

Open
mathomp4 opened this issue Sep 27, 2019 · 2 comments
Open

Running simple mo_column example #574

mathomp4 opened this issue Sep 27, 2019 · 2 comments

Comments

@mathomp4
Copy link

Now that I can build Claw (see #573), I decided to try out the mo_column code from the documentation using OpenMP transformation.

I can build and run the "before" case:

❯ gfortran -o before_transform mo_column.f90 main.f90

❯ ./before_transform 
   26116116.0    
   195520.172    

But when I try the transformed case:

❯ make cpu
/home/mathomp4/CLAWTest/claw-compiler/install-GCC9/bin/clawfc --target=cpu --directive=openmp -o mo_column_cpu_openmp.f90 mo_column.f90
mo_column.f90:-:- warning: Fine grain OpenMP directive generation is not advised for CPU target.
/home/mathomp4/CLAWTest/claw-compiler/install-GCC9/bin/clawfc -o main_cpu_openmp.f90 main.f90

❯ gfortran -o after_transform mo_column_cpu_openmp.f90 main_cpu_openmp.f90 
main_cpu_openmp.f90:15:55:

  CALL compute_column ( nz , q ( : , : ) , t ( : , : ) )
                                                       1
Error: Missing actual argument for argument ‘nproma’ at (1)

This is trivial to fix (add , nproma) to the call and when you do:

❯ ./after_transform 
   26116116.0    
   195520.172   

I was just wondering: is this expected? Or should Claw insert the nproma for you? (Just want to make sure my Claw is working as expected.)

@clementval
Copy link
Collaborator

@mathomp4 Hi and sorry for the late reply. CLAW should in principle add the corresponding variable as a parameter to the subroutine call. Let me check the example to see if something is missing or out of date.

@clementval
Copy link
Collaborator

clementval commented Nov 6, 2019

@mathomp4 I checked again the example from the documentation and on my side nproma is correctly inserted.
Are you using the latest version of the CLAW Compiler? (2.0.1)

PROGRAM model
 USE mo_column , ONLY: compute_column
 REAL :: q ( 1 : 20 , 1 : 60 )
 REAL :: t ( 1 : 20 , 1 : 60 )
 INTEGER :: nproma
 INTEGER :: nz
 INTEGER :: p

 nproma = 20
 nz = 60
 DO p = 1 , nproma , 1
  q ( p , 1 ) = 0.0
  t ( p , 1 ) = 0.0
 END DO
 CALL compute_column ( nz , q ( : , : ) , t ( : , : ) , nproma = nproma )
 PRINT * , sum ( q )
 PRINT * , sum ( t )
END PROGRAM model

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

2 participants