Changes between Initial Version and Version 1 of Documentation/UserGuide/ProfileGprof


Ignore:
Timestamp:
2019-09-30T19:00:52+02:00 (5 years ago)
Author:
luyssaert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/ProfileGprof

    v1 v1  
     1Profiling with gprof on obelix is really easy and it can teach you quite a lot about where ORCHIDEE spends most of it time. Basically one needs to add the compiler option -p -g or -pg. Use the internet to learn about additional settings that can be used to fine tune the outcomes of gprof.  
     2 
     3Because ORCHIDEE makes use of several scripts, these options need to be added at several places:  
     4* ORCHIDEE/config/Makefile add -p -g to the production line mode F_O 
     5* If you want this to become the default also after a make clean and ins_make then also change the compiler options in ORCHIDEE/util/AA_make.def add -p -g to the production line mode F_O for obelix. Then run ins_make (./ins_make) 
     6* ORCHIDEE/model/ORCHIDEE/arc.fcm add -p -g to the prod line 
     7Recompile the model from the config/ORCHIDEE_OL folder. Rerun the model. If all goes well a gmon.out file will be created in the RUN_DIR. So, on obelix you will first have to change the path of the RUN_DIR. Open …/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh and change the RUN_DIR_PATH (example below) 
     8{{{ 
     9#- RUN_DIR_PATH : Temporary working directory (=> TMP) 
     10if [ X${PBS_JOBID} != X ] ; then 
     11  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/home/scratch01/sluys/$PBS_O_LOGNAME.$PBS_JOBID} 
     12else 
     13  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/tmp/tmp$$} 
     14fi 
     15}}} 
     16You can now look at the gmon.out file with gprof. 
     17{{{ 
     18gprof orchide_ol gmon.out > view.txt  
     19}}}