Open ouankou opened 3 years ago
Last synchronization with ROSE brought a change in the file src/frontend/SageIII/sageInterface/sageBuilder.C
.
When creating a new source file for the outlined function, it was attaching some necessary preprocessing info to the new file. In the latest commits from ROSE, during outlining, it calls a secondary pass to duplicate the original source file, which contains all the OpenMP source code, and then repeats the whole processing from scratch again. This secondary pass will parse the source code, create the AST and lower the AST. The lowering will trigger the secondary pass again. Therefore, it falls to an infinite loop here.
As a temporary fix (commit https://github.com/passlab/rexompiler/commit/f13670d7c703b9d7de5a928ab7b2b7d57936e3e2), we reverted this particular change for now.
The change to src/frontend/SageIII/ompAstConstruction.cpp
come from the ROSE commit https://github.com/rose-compiler/rose/commit/2ecad6f533ab6ce1a01a32c4b02f94a12f913332. It solved the fatal error listed above that happened in the infinite loop, but not the infinite loop itself.
It could be some compatibility issue of our code or a bug from ROSE's commits. More details should be investigated to find a better solution to follow ROSE's workflow.
To test this fix, please check the sample code: https://github.com/passlab/rexomptest/tree/main/REXCompiler/REXReferenceManual/multi_src
Build the latest REX compiler, regenerate the lowered code of target.c
and foo.c
, and then run make
.
It's been a while since we tested the omp lowering thoroughly last time. Due to unknown reasons, it stops working. For example, given AXPY OpenMP GPU offloading code, it will throw the following errors and no source code is generated. https://github.com/passlab/rexomptest/blob/main/REXCompiler/REXReferenceManual/axpy/axpy.c
The last version before our recent synchronization with ROSE works (working commit: https://github.com/passlab/rexompiler/commit/61a515798dd87c977e30a79e772b86eb2b3a4ba8). For the same input, the output is:
It seems that the current version of REX run the second time and encountered the errors (the lines after "func ..."). We need to check the relevant changes within these three months. To avoid similar issues in the future, even though the omp lowering is still being developed and not stable, we should enable some basic tests at least. For now, we can generate lowered code to make sure something can be produced successfully, regardless of whether it's correct or not. In the GitHub CI system, there is no GPU, so the GPU programs can't be executed.