Changes between Version 7 and Version 8 of Documentation/UserGuide/flags


Ignore:
Timestamp:
2019-05-02T14:14:13+02:00 (6 years ago)
Author:
jgipsl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/flags

    v7 v8  
    33You 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? 
    44 
     5== Compile ORCHIDEE and XIOS in debug mode == 
    56In 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. 
    67 
     
    910To 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). 
    1011 
    11 With the new [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/CompileMethods FCM], adding debug flags is fairly straightforward.   
     12With [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/CompileMethods makeorchidee_fcm], adding debug flags is fairly straightforward.   
    1213 
    1314{{{ 
    1415cd modipsl/config/ORCHIDEE_OL 
    15 vi AA_make                       => change -prod into -debug everywhere you see it (three locations?) 
     16vi AA_make                       => change -prod into -debug everywhere you see it (three locations) 
    1617../../util/ins_make 
    17 gmake clean && gmake             ! "gmake clean" only needs to be done if you have previously compiled with the "prod" line 
     18gmake 
    1819}}} 
    1920 
    2021While 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. 
    2122 
    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 
     24If 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{{{ 
     26cd ../modeles/XIOS 
     27vi 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 == 
     34Note 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. 
    2335 
    2436For 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. 
     
    4355With 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. 
    4456 
    45 For XIOS, 
    46  
    47 {{{ 
    48 cd ../modeles/XIOS 
    49 vi ../arch/arch-ifort_LSCE.fcm 
    50 %DEBUG_CFLAGS   -DBZ_DEBUG -g -fno-inline -ggdb --debug 
    51 %DEBUG_FFLAGS   -g -ggdb -debug all -traceback 
    52   ./make_xios --arch ifort_LSCE --debug 
    53 }}} 
    54  
    5557= Other useful tips for debugging = 
    5658