Changes between Version 4 and Version 5 of Documentation/UserGuide/SegmentationFault


Ignore:
Timestamp:
2020-02-28T16:41:03+01:00 (4 years ago)
Author:
jgipsl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/SegmentationFault

    v4 v5  
    1 = How to find a segmentation error = 
     1= How to find a segmentation error or a floating invalid error = 
     2Author: D. Solyga[[BR]] 
     3Last revision: J. Ghattas 2020/02/28 
    24 
    35 
    4 == Compilation for checking array dimension == 
     6== Segmentation errors == 
    57 
    6 Segmentation errors indicate issues with the memory which are often caused by ill-defined array dimensions. The dimension of your arrays can be checked by changing the settings of the compiler. Note that compiling will take longer but that running the code will take a lot longer! Run the code on a single point test-case to avoid wasting computing resources. 
     8Segmentation errors indicate issues with the memory which are often caused by ill-defined array dimensions. The dimension of your arrays can be checked by changing the settings of the compiler. Note that running the code will take a lot longer! Run the code on a single point test-case to avoid wasting computing resources. Segmentation faults can be trapped directly by the compiler. Check carefully the error messages written by the compiler.  
    79 
    8 open the make file AA_make.gdef in the utility folder 
    9 {{{ 
    10 emacs ../util/AA_make.gdef 
    11 }}} 
     10See here how to compile in debug mode: wiki:Documentation/UserGuide/CompileMethods 
    1211 
    13 adjust the settings of the compiler by adding 'check bounds'. The example is for a compilation on obelix 
    14 {{{ 
    15 #-Q- lxiv8    F_O = -O -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) 
    16 }}} 
     12== Floating invalid == 
     13If during run time, you got an error saying '''floating invalid...''', compiling with debug options might give more information while running the model again. Hopefully, when you run the model again, you'll get the line number where the model crashed.  
    1714 
    18 The compilation could also be set to check for dependencies by adding 'traceback'. The example is for a compilation on obelix 
    19 {{{ 
    20 #-Q- lxiv8    F_O = -O -check bounds -traceback $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) 
    21 }}} 
     15Note that the line number given by the compiler corresponds to the preprocessed file. For ORCHIDEE, these files are found in modipsl/modeles/ORCHIDEE/build/ppsrc/. Check these files to know which is the corresponding line.  
    2216 
    23 remove the previous make file 
    24 {{{ 
    25   /modeles/ORCHIDEE_OL/make clean 
    26 }}} 
     17See here how to compile in debug mode: wiki:Documentation/UserGuide/CompileMethods 
    2718 
    28 install the new make file with the 'check bounds' option 
    29 {{{ 
    30 ./../../util/ins_make 
    31 }}} 
    32  
    33 and compile 
    34 {{{ 
    35   /../modeles/ORCHIDEE_OL/make 
    36 }}} 
    37