| 1 | Profiling 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 | |
| 3 | Because 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 |
| 7 | Recompile 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) |
| 10 | if [ X${PBS_JOBID} != X ] ; then |
| 11 | typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/home/scratch01/sluys/$PBS_O_LOGNAME.$PBS_JOBID} |
| 12 | else |
| 13 | typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/tmp/tmp$$} |
| 14 | fi |
| 15 | }}} |
| 16 | You can now look at the gmon.out file with gprof. |
| 17 | {{{ |
| 18 | gprof orchide_ol gmon.out > view.txt |
| 19 | }}} |