Changes between Version 7 and Version 8 of Documentation/UserGuide/flags
- Timestamp:
- 2019-05-02T14:14:13+02:00 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/UserGuide/flags
v7 v8 3 3 You are running ORCHIDEE, just like every other day, when it stops for no apparent reason. You don't have output files from the simulation, and the run.card lists "Fatal". What can you do? 4 4 5 == Compile ORCHIDEE and XIOS in debug mode == 5 6 In order to pin down exactly what the problem is, you can recompile ORCHIDEE with debug flags. These flags enable extra checks on code execution to identify unwanted behavior. 6 7 … … 9 10 To turn on all these checks, we change the compiler flags. Adding these checks can make your code run 10 times slower, so after turning on these flags, the first step is often to find the conditions that reproduce your crash in the shortest time possible (reducing the number of processors, reducing the spatial domain or using restart files to start the simulation the day before the crash). 10 11 11 With the new [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/CompileMethods FCM], adding debug flags is fairly straightforward.12 With [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/CompileMethods makeorchidee_fcm], adding debug flags is fairly straightforward. 12 13 13 14 {{{ 14 15 cd modipsl/config/ORCHIDEE_OL 15 vi AA_make => change -prod into -debug everywhere you see it (three locations ?)16 vi AA_make => change -prod into -debug everywhere you see it (three locations) 16 17 ../../util/ins_make 17 gmake clean && gmake ! "gmake clean" only needs to be done if you have previously compiled with the "prod" line18 gmake 18 19 }}} 19 20 20 21 While the lines are scrolling by, you can look for things like, "-DBZ_DEBUG -g -fno-inline" and "-fpe0 -O0 -g -traceback -fp-stack-check -ftrapuv -check bounds -check all -check noarg_temp_created" to reassure yourself that the debug flags are being used. 21 22 22 Note that this will NOT compile IOIPSL in debug mode. Sometimes it is useful to have IOIPSL in debug mode as well. This can be done by modifying lines in modipsl:util/AA_make.gdef. 23 24 If you compile at obelix, earlier versions of XIOS/trunk than revision 1659 do not compile in mode debug due to an error in arch-ifort_LSCE.fcm. Change following: 25 {{{ 26 cd ../modeles/XIOS 27 vi arch/arch-ifort_LSCE.fcm 28 %DEBUG_CFLAGS -DBZ_DEBUG -g -fno-inline -ggdb --debug 29 %DEBUG_FFLAGS -g -ggdb -debug all -traceback 30 ./make_xios --arch ifort_LSCE --debug 31 }}} 32 33 == Compile IOIPSL with debug options == 34 Note that above changes will not compile IOIPSL in debug mode. Sometimes it is useful to have IOIPSL in debug mode as well. This can be done by modifying lines in modipsl/util/AA_make.gdef. 23 35 24 36 For example, the following lines are for the obelix machine at LSCE, using the Intel fortran compiler. The first line (with a single #) is the one used, while the second line (with multiple #s) is ignored. … … 43 55 With the above, you should be able to get XIOS, IOIPSL, and ORCHIDEE to all compile with the same flags. I noticed this was necessary to catch a memory error one time: the error was in ORCHIDEE, but it was showing up as a crash in XIOS, until I compiled everything with full debug flags...then it pointed straight to the line number in ORCHIDEE that was writing out of bounds. 44 56 45 For XIOS,46 47 {{{48 cd ../modeles/XIOS49 vi ../arch/arch-ifort_LSCE.fcm50 %DEBUG_CFLAGS -DBZ_DEBUG -g -fno-inline -ggdb --debug51 %DEBUG_FFLAGS -g -ggdb -debug all -traceback52 ./make_xios --arch ifort_LSCE --debug53 }}}54 55 57 = Other useful tips for debugging = 56 58