[1154] | 1 | # $Id$ |
---|
[693] | 2 | ##################################################################### |
---|
[1301] | 3 | # Author : Claude Talandier for NEMO team |
---|
| 4 | # Contact : nemo_st@locean-ipsl.upmc.fr |
---|
[693] | 5 | # |
---|
[1301] | 6 | # VARS TO SET: 6 + 1 (optional) |
---|
[693] | 7 | # - NAM_V : name of the current test |
---|
| 8 | # - LISTE_CONF : configurations name (ORCA2_LIM, GYRE ...) |
---|
[808] | 9 | # - JOBS_2LAUN : jobs to launch (nojob, all, long, short or gtime) |
---|
[693] | 10 | # - BUILD_MAKE : run type (mon, mpi ... ) |
---|
| 11 | # - MAK_TIME : to perform a CPU time measure making a one year run |
---|
| 12 | # use key word 'timing' or 'notiming' |
---|
[808] | 13 | # - MAK_MEMO : to perform a memory check |
---|
| 14 | # use key word 'memo' or 'nomemo' |
---|
[693] | 15 | # - REF_TAGV : (optional) reference tag name. If specified, |
---|
| 16 | # current results will be compare to the results |
---|
| 17 | # of this tag (for a given configuration and run type) |
---|
| 18 | # |
---|
| 19 | # WORK: Allows to launch all the validation process, i.e. |
---|
[1321] | 20 | # I. to build dependencies use: > gmake -s dep |
---|
| 21 | # II. to launch compilation,simulation,final report use: > gmake |
---|
[693] | 22 | # |
---|
| 23 | ##################################################################### |
---|
| 24 | SHELL = /bin/ksh |
---|
| 25 | ##################################################################### |
---|
| 26 | ##### Begin Users modifications |
---|
| 27 | ##################################################################### |
---|
| 28 | #- |
---|
| 29 | #- Name of the test |
---|
[1301] | 30 | NAM_V = MY_EXP1 |
---|
[693] | 31 | #- |
---|
| 32 | #- Configurations list which must be tested |
---|
[1464] | 33 | LISTE_CONF = GYRE GYRE_LOBSTER ORCA2_LIM ORCA2_LIM3 ORCA2_LIM_PISCES ORCA2_OFF_PISCES |
---|
[693] | 34 | #- |
---|
[808] | 35 | #- Jobs to launch use keyword: nojob, all, long, short or gtime |
---|
| 36 | JOBS_2LAUN = all |
---|
| 37 | #- |
---|
[693] | 38 | #- Compilation list type to perform, mon (mono) &/or mpi &/or omp (Open-MP) |
---|
[1412] | 39 | BUILD_MAKE = mon mpi |
---|
[693] | 40 | #- |
---|
[1412] | 41 | #- Do we use the new io interface (iom_put)? With the io_server? On how many procs? |
---|
| 42 | USE_IOMPUT = false |
---|
| 43 | USE_IOSERVER = false |
---|
| 44 | NB_PROCS_IOSERVER = 1 |
---|
| 45 | #- |
---|
[693] | 46 | #- Proceed to a timing, use key word 'timing' or 'notiming' |
---|
| 47 | MAK_TIME = notiming |
---|
| 48 | #- |
---|
[808] | 49 | #- Proceed to a memory check, use key word 'memo' or 'nomemo' |
---|
[958] | 50 | MAK_MEMO = memo |
---|
[808] | 51 | #- |
---|
[693] | 52 | #- Reference Tag version |
---|
[958] | 53 | REF_TAGV = nemo_v2_3 |
---|
[693] | 54 | #- |
---|
| 55 | ##################################################################### |
---|
| 56 | ##### End Users modifications |
---|
| 57 | ##################################################################### |
---|
| 58 | |
---|
| 59 | ## |
---|
| 60 | all: $(LISTE_CONF) |
---|
| 61 | @echo ' ' |
---|
| 62 | @echo ' ----->>>>>>>>> Compilation process ended for configuration(s) :' $(LISTE_CONF) |
---|
| 63 | @echo ' ' |
---|
| 64 | |
---|
| 65 | #- Make good links & launch the compilation process |
---|
[1301] | 66 | $(LISTE_CONF): |
---|
[693] | 67 | @echo |
---|
| 68 | @echo "CONFIGURATION :" $@ |
---|
[1365] | 69 | @( cd 2TEST ; MYREP_LIST=`( ls *.[Ffh]90 )` ; cd ../../$@/MY_SRC ; rm -rf *.[Ffh]90 ; \ |
---|
| 70 | if [ -n "$$MYREP_LIST" ] ; then ln -sf ../../NVTK/2TEST/*.[Ffh]90 . ; fi ; ) |
---|
[693] | 71 | @echo "test=" $(NAM_V) > ../$@/specifs.txt |
---|
| 72 | @echo "runs=" $(BUILD_MAKE) >> ../$@/specifs.txt |
---|
| 73 | @echo "time=" $(MAK_TIME) >> ../$@/specifs.txt |
---|
[808] | 74 | @echo "memo=" $(MAK_MEMO) >> ../$@/specifs.txt |
---|
[693] | 75 | @echo "tagname=" $(REF_TAGV) >> ../$@/specifs.txt |
---|
[1301] | 76 | @echo `svn info ../../modeles/NEMO | grep URL` >> ../$@/specifs.txt |
---|
| 77 | @echo `svn info ../../modeles/NEMO | grep Revision ` >> ../$@/specifs.txt |
---|
[1365] | 78 | @( cd 2TEST ; LSFILES=`( ls *.[Ffh]90 )` ; if [ -n "$$LSFILES" ] ; \ |
---|
| 79 | then echo $$LSFILES > ../../$@/f2test.txt ; else rm -f ../../$@/f2test.txt ; \ |
---|
| 80 | touch ../../$@/f2test.txt ; fi ; ) |
---|
[693] | 81 | @echo |
---|
[1301] | 82 | @echo ' ----->>>>>>>>> Links from NVTK/2TEST to '$@/MY_SRC 'done' |
---|
[693] | 83 | @echo |
---|
| 84 | @echo ' Build the Makefile for' $@ 'configuration' |
---|
[1301] | 85 | @../../util/ins_make -w $@ |
---|
[693] | 86 | @echo |
---|
| 87 | @echo |
---|
[1412] | 88 | @gmake -C ../$@ RUN='$(BUILD_MAKE)' JOB=$(JOBS_2LAUN) RTG=$(REF_TAGV) MKTE=$(MAK_TIME) MKMO=$(MAK_MEMO) REXP=$(NAM_V) USE_IOMPUT=$(USE_IOMPUT) USE_IOSERVER=$(USE_IOSERVER) NB_PROCS_IOSERVER=$(NB_PROCS_IOSERVER) -j 2 > $@_step.txt |
---|
[1301] | 89 | |
---|
| 90 | #- Rebuild dependencies when new cpp key and/or new module used |
---|
| 91 | dep: clear |
---|
| 92 | for conf in ${LISTE_CONF}; do \ |
---|
| 93 | echo ; \ |
---|
| 94 | echo ; \ |
---|
| 95 | echo ; \ |
---|
| 96 | echo ' ----->>>>>>>>> Rebuild dependencies for the' $$conf 'configuration' ; \ |
---|
| 97 | echo ; \ |
---|
| 98 | echo ' > Build links from 2TEST to '$$conf'/MY_SRC directory :' ; \ |
---|
| 99 | echo ; \ |
---|
[1365] | 100 | cd 2TEST ; \ |
---|
| 101 | MYREP_LIST=`( ls *.[Ffh]90 )` ; \ |
---|
| 102 | cd ../../$$conf/MY_SRC ; rm -rf *.[Ffh]90 ; \ |
---|
[1301] | 103 | if [ -n "$$MYREP_LIST" ] ; \ |
---|
| 104 | then for F in $$MYREP_LIST; do \ |
---|
| 105 | echo " # link from 2TEST to "$$conf"/MY_SRC/$$F" ; \ |
---|
| 106 | ln -sf ../../NVTK/2TEST/$$F . ; \ |
---|
| 107 | done ; fi ; \ |
---|
| 108 | echo ; \ |
---|
| 109 | echo ; \ |
---|
| 110 | echo ' > Rebuild links in the '$$conf'/WORK directory:' ; \ |
---|
| 111 | echo ; \ |
---|
| 112 | cd ../WORK ; \ |
---|
| 113 | rm -rf `ls | fgrep -v -f .patron` ; \ |
---|
| 114 | check=`grep OPA_SRC .config` ; \ |
---|
| 115 | if [ -n "$$check" ] ; then \ |
---|
| 116 | echo " # use OPA_SRC component files" ; \ |
---|
| 117 | ln -sf ../../../modeles/NEMO/OPA_SRC/*.[Ffh]90 . ; \ |
---|
| 118 | ln -sf ../../../modeles/NEMO/OPA_SRC/*/*.[Ffh]90 . ; \ |
---|
| 119 | fi ; \ |
---|
| 120 | check=`grep LIM_SRC_2 .config` ; \ |
---|
| 121 | if [ -n "$$check" ] ; then \ |
---|
| 122 | echo " # use LIM_SRC_2 component files" ; \ |
---|
| 123 | ln -sf ../../../modeles/NEMO/LIM_SRC_2/*.[Ffh]90 . ; \ |
---|
| 124 | fi ; \ |
---|
| 125 | check=`grep LIM_SRC_3 .config` ; \ |
---|
| 126 | if [ -n "$$check" ] ; then \ |
---|
| 127 | echo " # use LIM_SRC_3 component files" ; \ |
---|
| 128 | ln -sf ../../../modeles/NEMO/LIM_SRC_3/*.[Ffh]90 . ; \ |
---|
| 129 | fi ; \ |
---|
| 130 | check=`grep NST_SRC .config` ; \ |
---|
| 131 | if [ -n "$$check" ] ; then \ |
---|
| 132 | echo " # use NST_SRC component files" ; \ |
---|
| 133 | \rm -rf agrif_opa_interp.F90 ; \ |
---|
| 134 | \rm -rf agrif_opa_sponge.F90 ; \ |
---|
| 135 | \rm -rf agrif_opa_update.F90 ; \ |
---|
| 136 | \rm -rf agrif_top_interp.F90 ; \ |
---|
| 137 | \rm -rf agrif_top_sponge.F90 ; \ |
---|
| 138 | \rm -rf agrif_top_update.F90 ; \ |
---|
| 139 | ln -sf ../../../modeles/NEMO/NST_SRC/*.[Ffh]90 . ; \ |
---|
| 140 | fi ; \ |
---|
| 141 | check=`grep C1D_SRC .config` ; \ |
---|
| 142 | if [ -n "$$check" ] ; then \ |
---|
| 143 | echo " # use C1D_SRC component files" ; \ |
---|
| 144 | ln -sf ../../../modeles/NEMO/C1D_SRC/*.[Ffh]90 . ; \ |
---|
| 145 | fi ; \ |
---|
| 146 | check=`grep TOP_SRC .config` ; \ |
---|
| 147 | if [ -n "$$check" ] ; then \ |
---|
| 148 | echo " # use TOP_SRC component files" ; \ |
---|
| 149 | \rm -rf trcstp.F90 ; \ |
---|
| 150 | \rm -rf sms.F90 ; \ |
---|
| 151 | \rm -rf trcini.F90 ; \ |
---|
| 152 | ln -sf ../../../modeles/NEMO/TOP_SRC/*.[Ffh]90 . ; \ |
---|
| 153 | ln -sf ../../../modeles/NEMO/TOP_SRC/*/*.[Ffh]90 . ; \ |
---|
| 154 | fi ; \ |
---|
| 155 | check=`grep OFF_SRC .config` ; \ |
---|
| 156 | if [ -n "$$check" ] ; then \ |
---|
| 157 | echo " # use OFF_SRC component files" ; \ |
---|
| 158 | ln -sf ../../../modeles/NEMO/OFF_SRC/*.[Ffh]90 . ; \ |
---|
| 159 | ln -sf ../../../modeles/NEMO/OFF_SRC/*/*.[Ffh]90 . ; \ |
---|
| 160 | fi ; \ |
---|
| 161 | mn=`awk '{ print $$1 }' .config ` ; \ |
---|
| 162 | myrep=../../../config/$$mn/MY_SRC ; \ |
---|
| 163 | echo " # use MY_SRC component files" ; \ |
---|
| 164 | for i in `ls $$myrep` ; do \ |
---|
| 165 | [ -f $$i ] && \rm -rf $$i ;\ |
---|
| 166 | done ; \ |
---|
[1365] | 167 | cd $$myrep ; \ |
---|
| 168 | myrep_list=`( ls *.[Ffh]90 )` ; \ |
---|
[1475] | 169 | cd ../WORK ; \ |
---|
[1301] | 170 | if [ -n "$$myrep_list" ] ; then \ |
---|
| 171 | for F in $$myrep_list; do \ |
---|
| 172 | ln -sf $$myrep/$$F . ; \ |
---|
| 173 | done ; \ |
---|
| 174 | fi ; \ |
---|
| 175 | cd .. ; ../NVTK/fait_AA_make ; \ |
---|
[1475] | 176 | cd WORK ; \ |
---|
| 177 | ls -1 | fgrep -v -f .patron >tmplist ; \ |
---|
| 178 | cp tmplist SRC_FILE_LIST.temp ; \ |
---|
[1301] | 179 | echo ; \ |
---|
| 180 | echo " #################################" ;\ |
---|
| 181 | echo " Dependencies for" $$conf "ready" ;\ |
---|
| 182 | echo " #################################" ;\ |
---|
| 183 | echo ;\ |
---|
[1475] | 184 | cd ../../NVTK ; \ |
---|
[1301] | 185 | done |
---|
| 186 | @echo |
---|
| 187 | @echo " ##################################################" |
---|
| 188 | @echo " Launch the compilation and job process using gmake" |
---|
| 189 | @echo " ##################################################" |
---|
| 190 | @echo |
---|
| 191 | |
---|
| 192 | clear : |
---|
| 193 | @echo |
---|
| 194 | @echo |
---|
| 195 | @clear |
---|