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

[Fortran]: The generated file for outlined function is empty #135

Open
yanyh15 opened this issue Dec 19, 2022 · 1 comment
Open

[Fortran]: The generated file for outlined function is empty #135

yanyh15 opened this issue Dec 19, 2022 · 1 comment

Comments

@yanyh15
Copy link
Member

yanyh15 commented Dec 19, 2022

To reproduce this bug, using the following input file and command:

Input code: hello_omp_parallel.f90:

PROGRAM Parallel_Hello_World

!$OMP PARALLEL

        PRINT *, "Hello from process "

!$OMP END PARALLEL

END

Command to compile:

./bin/rose-compiler -rose:OpenMP:lowering /home/yyan7/compiler/hello_omp_parallel.f90

The command produces two files: rose_hello_omp_parallel.f90 and rex_lib_hello_omp_parallel.f90:

For rose_hello_omp_parallel.f90 (needs to be fixed as well):

#include "rex_kmp.h" 
PROGRAM Parallel_Hello_World
INTEGER :: status = 0
external :: OUT__1__4128__Parallel_Hello_World__7__
CALL __kmpc_fork_call(0,0,OUT__1__4128__Parallel_Hello_World__7__,0)
END PROGRAM 

rex_lib_hello_omp_parallel.f90 is empty

@yanyh15
Copy link
Member Author

yanyh15 commented Jan 5, 2023

This is likely the setting of file_info->unsetOutputInCodeGeneration () flag in https://github.com/passlab/rexompiler/blob/main/src/frontend/SageIII/sageInterface/sageBuilder.C#L4296 of function buildNondefiningFunctionDeclaration_T which is called by SageBuilder::buildFunctionRefExp that is used in omp_lowering.

The flag setting impact the return of the call UnparseLanguageIndependentConstructs::statementFromFile that is used by unparsing to decide whether to unparse an statement to a file or not.

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

1 participant