geoschem/GCHP

Problem about compilation of GCHP

beiduqiu opened this issue · 11 comments

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.

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.

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?

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.

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

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?

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

@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?

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.

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

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.

Ok, great. I will close out the issue.