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

Problem about compilation of GCHP #397

Closed
4 tasks done
beiduqiu opened this issue Mar 20, 2024 · 11 comments
Closed
4 tasks done

Problem about compilation of GCHP #397

beiduqiu opened this issue Mar 20, 2024 · 11 comments
Assignees
Labels
category: Debug Help Request for help debugging GCHP topic: Build Related to makefiles or the build sequence

Comments

@beiduqiu
Copy link

Name and Institution (Required)

Name: Zifan WANG
Institution: WashU

Confirm you have reviewed the following documentation

Description of your issue or question

When I try to recompile the GCHP, I met some problems. After I add some print information in GCHP and recompile it. But the result of the program doesn't change at all. Even if I corrupt the program such as comment some important function and recompile it, it can still compile and run. So I want to ask is there a way to compile the whole program. Currently I am using
image
Thanks in advance for your generous help.

Please provide as much detail as possible. Always include the GCHP version number and any relevant configuration and log files.

@lizziel lizziel added topic: Build Related to makefiles or the build sequence category: Debug Help Request for help debugging GCHP labels Mar 20, 2024
@lizziel lizziel self-assigned this Mar 20, 2024
@lizziel
Copy link
Contributor

lizziel commented Mar 20, 2024

Hi @beiduqiu, the steps you are taking will compile the entire model. If there was a problem compiling and it exited early then your rerun will not include the changes.

Does the timestamp of the gchp executable in your run directory change to reflect the time of new install? If not, then there was likely a problem building. If the build fails but make install is still executed then it will copy the old executable from the build/bin folder. Rerunning would then work, but without your changes.

You can output the build to log and include that in this issue if you would like me to look. When you recompile you can do this command to send the output log, including stderr: make -j 2>&1 | tee build.log.

@beiduqiu
Copy link
Author

beiduqiu commented Mar 23, 2024

This is the time stamp of gchp. It shows I have already successfully build GCHP.
image
And this is the modification I did to the program.
image
I think the change should make the entire program not work at all but it still running correctly. Is there anything in the make file that may have impact on the error?

@lizziel
Copy link
Contributor

lizziel commented Mar 25, 2024

When you build the model there should be output to the screen. Please send it to log using the following command: make -j 2>&1 | tee build.txt. Then drag the file to the GitHub message to post it.

@beiduqiu
Copy link
Author

build.log
This is the build log. And the modification I made is line 2232 of MAPL_Generic.F90. This line output some information in the output log but the modification I added never shows up. Hope you can help me with that.
image

@lizziel
Copy link
Contributor

lizziel commented Mar 25, 2024

Thanks for sharing the file. This line indicates that MAPL_Generic.F90 was compiled again during the rebuild since changes were detected.

[ 70%] Building Fortran object src/MAPL/generic/CMakeFiles/MAPL.generic.dir/MAPL_Generic.F90.o
[ 70%] Linking Fortran static library ../../../lib/libMAPL.generic.a
[ 72%] Built target MAPL.generic

After you do make install, check that your executable timestamp gets updated to the time at which you did make install. You can also diff the executable in your run directory with the executable in your build folder (file build/bin/gchp).

When you rerun you should get the new text at the end of the run log in the timing section. Have you already done this and not seen the new text?

@beiduqiu
Copy link
Author

beiduqiu commented Apr 2, 2024

I am sure the compilation is successful and the executable file is the new version. But the problem is the information I changed never show up. I tried to add multiple information in the program such as in the main program
image
But when I check the output file or changing this line to redirect the stdout to a file, I cannot see the information I want.
image

@lizziel
Copy link
Contributor

lizziel commented Apr 2, 2024

@beiduqiu, this is indeed strange. GEOS-Chem Support Team member @yidant is at WashU and perhaps can sit down with you to figure out what is going on. @yidant, would you be able to help with this?

@beiduqiu
Copy link
Author

beiduqiu commented Apr 2, 2024

I find that when I use bsub script to run the code, I cannot see the difference. But when I try to use
mpirun -np 6 gchp > check9.txt
to run the program, the change works but there are some error information
image. Do you know what caused the problem? Thanks for you help.

@yidant yidant self-assigned this Apr 2, 2024
@lizziel
Copy link
Contributor

lizziel commented Apr 17, 2024

@beiduqiu and @yidant, were you able to resolve this issue?

@beiduqiu
Copy link
Author

The problem is that there is a pre-built version of gchp in the image, and the script will always execute that executable gchp instead of recompiled. When I use an interactive server and use mpi run to execute gchp, the problem is solved. Thanks for all the help.

@lizziel
Copy link
Contributor

lizziel commented Apr 18, 2024

Ok, great. I will close out the issue.

@lizziel lizziel closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Debug Help Request for help debugging GCHP topic: Build Related to makefiles or the build sequence
Projects
None yet
Development

No branches or pull requests

3 participants