Changes between Version 4 and Version 5 of Documentation/UserGuide/SegmentationFault
- Timestamp:
- 2020-02-28T16:41:03+01:00 (4 years ago)
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 = 2 Author: D. Solyga[[BR]] 3 Last revision: J. Ghattas 2020/02/28 2 4 3 5 4 == Compilation for checking array dimension==6 == Segmentation errors == 5 7 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.8 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 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. 7 9 8 open the make file AA_make.gdef in the utility folder 9 {{{ 10 emacs ../util/AA_make.gdef 11 }}} 10 See here how to compile in debug mode: wiki:Documentation/UserGuide/CompileMethods 12 11 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 == 13 If 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. 17 14 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 }}} 15 Note 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. 22 16 23 remove the previous make file 24 {{{ 25 /modeles/ORCHIDEE_OL/make clean 26 }}} 17 See here how to compile in debug mode: wiki:Documentation/UserGuide/CompileMethods 27 18 28 install the new make file with the 'check bounds' option29 {{{30 ./../../util/ins_make31 }}}32 33 and compile34 {{{35 /../modeles/ORCHIDEE_OL/make36 }}}37