Regarding the issue of failure in running due to errors during the conversion of `amg.c` into intermediate code
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 36
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Perhaps this is a strange question, and I am not sure if the project author is still actively involved in it, but I thought I would give it a try and inquire. Here's the situation: Firstly, I have successfully built the project using the make command. However, when I attempted to compile and run amg.c separately using different approaches (I am using the Clang compiler), I encountered the following issues:
1. `amg.c` can be successfully compiled into an executable file directly using Clang, and it can run smoothly. The command is as follows:
`clang -fopenmp -o test4 amg.c -I.. -I../utilities -I../IJ_mv -I../seq_mv -I../parcsr_mv -I../parcsr_ls -I../krylov -DTIMER_USE_MPI -DHYPRE_USING_OPENMP -DHYPRE_HOPSCOTCH -DHYPRE_USING_PERSISTENT_COMM -DHYPRE_BIGINT -DHYPRE_TIMING -lmpi -L. -L../parcsr_ls -L../parcsr_mv -L../IJ_mv -L../seq_mv -L../krylov -L../utilities -lparcsr_ls -lparcsr_mv -lseq_mv -lIJ_mv -lkrylov -lHYPRE_utilities -lm`
2. However, when I followed the steps below to convert `amg.c` into an executable file, I encountered different errors during the execution:
①
`clang -S -emit-llvm -o amgtest.ll amgtest.c`
`clang amgtest.ll -fopenmp -DTIMER_USE_MPI -DHYPRE_USING_OPENMP -DHYPRE_HOPSCOTCH -DHYPRE_USING_PERSISTENT_COMM -DHYPRE_BIGINT -DHYPRE_TIMING -lmpi -L. -L../parcsr_ls -L../parcsr_mv -L../IJ_mv -L../seq_mv -L../krylov -L../utilities -lparcsr_ls -lparcsr_mv -lseq_mv -lIJ_mv -lkrylov -lHYPRE_utilities -lm -o test4 -g `
`mpirun -np 4 test4`
Output:

②
`clang -S -emit-llvm -o amgtest.ll amgtest.c`
`llvm-as amgtest.ll -o amgtest.bc`
`llc amgtest.bc -o amgtest.s`
`clang amgtest.s -no-pie -fopenmp -DTIMER_USE_MPI -DHYPRE_USING_OPENMP -DHYPRE_HOPSCOTCH -DHYPRE_USING_PERSISTENT_COMM -DHYPRE_BIGINT -DHYPRE_TIMING -lmpi -L. -L../parcsr_ls -L../parcsr_mv -L../IJ_mv -L../seq_mv -L../krylov -L../utilities -lparcsr_ls -lparcsr_mv -lseq_mv -lIJ_mv -lkrylov -lHYPRE_utilities -lm -o test4 -g`
`mpirun -np 4 test4`
Output:

I identified the function where the error occurred through GDB debugging. After adding some debugging information, I found that the issue was related to the `IJ_A` structure.

I suspect that the error occurred during the conversion of the `amg.c` code into intermediate code due to the complexity of the `IJ_A` structure. This may have resulted in some unexpected errors, leading to the final error. I have ruled out the issue of compiler versions (as I have tried Clang 3.8, Clang 4.0, and Clang 3.0). Could it be a problem with the code itself? Have the authors encountered similar errors before? (Since my current research is in code optimization/profiling, I need to manipulate the intermediate code of `amg.c`). Do you have any suggestions? Thank you very much!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with amg.c and the IJ_A structure, then reproduce the make-built executable and the Clang LLVM pipeline described in the issue. Use GDB at the reported failing function to compare IJ_A across both runs. Done means identifying whether the discrepancy is introduced during compilation or execution and documenting a reproducible cause or required project change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- compilers, hpc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100