Changeset 1521


Ignore:
Timestamp:
08/03/09 16:03:28 (16 years ago)
Author:
Mathieu Morlighem
Message:

extended nightly run to any platform

Location:
issm/trunk/cron
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/cron/nightlyrun.sh

    r1455 r1521  
    33#It then processes the results and sends an email to the Ice developpers.
    44
    5 #Recover package for which we run nightly.
    6 package=$1;
    7 echo $package
     5#get configs
     6if [ `hostname -s` == "wilkes" ]; then
     7        source wilkes_config
     8fi
     9if [ `hostname -s` == "ice1" ]; then
     10        source ice1_config
     11fi
    812
    9 #Some functions
    10 function today_date {
    11 suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`
    12 echo $suffix;
    13 }
    14 
    15 #Figure out today's date
    16 export today=`today_date`;
     13#create nightly run variables
     14export today=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`;
    1715export host_name=`hostname`;
    1816
    1917#create ISSM variables
    20 export ISSM_DIR="/u/wilkes-r1b/morlighe/svn/issm/trunk/cron/trunk"
    21 export ISSM_ARCH=linux-gnu-amd64
    22 source $ISSM_DIR/etc/environment.sh
    23 export ISSM_RELEASE="issm";
     18export ISSM_DIR
     19export ISSM_ARCH
     20export ISSM_RELEASE
    2421
    25 #Erase previous code
     22#Erase previous code and Fetch the new one
    2623rm -rf trunk
    27 
    28 #Fetch svn code
    2924svn checkout http://s383-rhat/issm/svn/issm/trunk
    3025
    31 #Go to the issm directory
     26#install ISSM
    3227cd $ISSM_DIR
    33 
    34 #install ISSM
    3528
    3629#1: modify some variables
    3730cd etc
    38         cat environment_variables.sh | sed -e "s/C:\/MATLAB\/R2009a\//\/usr\/local\/pkgs\/matlab-7.6\//g" > environment_variables.sh.bak
     31        #modify MATLAB_PATH ( /usr/...   ->   \/usr\/...)
     32        echo $MATLAB_PATH | sed 's/\//\\\//g' > MATLAB_PATH2
     33        MATLAB_PATH2=`cat MATLAB_PATH2`
     34        rm MATLAB_PATH2
     35
     36        #modify MATLAB_DIR in environment_variables.sh
     37        cat environment_variables.sh | sed -e "s/C:\/MATLAB\/R2009a\//$MATLAB_PATH2/g" > environment_variables.sh.bak
    3938        mv environment_variables.sh.bak environment_variables.sh
     39
     40        #modify EXECUTION_PATH ( /usr/...   ->   \/usr\/...)
     41        echo $EXECUTION_PATH | sed 's/\//\\\//g' | sed 's/-/\\-/g' > EXECUTION_PATH2
     42        EXECUTION_PATH2=`cat EXECUTION_PATH2`
     43        rm EXECUTION_PATH2
     44        echo $ISSM_DIR\/bin | sed 's/\//\\\//g' | sed 's/-/\\-/g' > CLUSTER_PATH
     45        CLUSTER_PATH=`cat CLUSTER_PATH`
     46        rm CLUSTER_PATH
     47
     48        #modify EXECUTION_PATH in cluster.rc
     49        cat cluster.rc | sed -e "s-cluster_codepath.*-cluster_codepath\=$CLUSTER_PATH-" | sed -e "s-cluster_executionpath.*-cluster_executionpath\=$EXECUTION_PATH2-" > cluster.bak
     50        mv cluster.bak cluster.rc
    4051cd ..
    4152source $ISSM_DIR/etc/environment.sh
     
    4354#2: install some required external packages
    4455cd externalpackages
    45 cd mpich2
    46         cp configs/wilkes/* .
    47         ./install.sh
     56        cd mpich2
     57        cp configs/$EP_CONFIG/* .
     58        ./install.sh $NUMCPUS
    4859cd ../petsc
    49         cp configs/wilkes/* .
    50         ./install.sh
     60        cp configs/$EP_CONFIG/* .
     61        ./install.sh $NUMCPUS
    5162cd ../metis
    52         cp config/linux/* .
    53         ./install.sh
     63        cp configs/$EP_CONFIG/* .
     64        ./install.sh $NUMCPUS
    5465cd ../triangle
    55         cp config/lin64/* .
    56         ./install.sh
     66        cp configs/$EP_CONFIG/* .
     67        ./install.sh $NUMCPUS
    5768cd $ISSM_DIR
    5869
     
    6677sh config/wilkes/linux64.sh
    6778
    68 #4: compile ISSM
    69 make -j 8
    70 make install
    71 
    72 #5: change issm.rc
    73 cd etc
    74 cat cluster.rc | sed -e "s/cluster_codepath=\/u\/astrid1\/larour\/issm\/trunk\/bin/cluster_codepath=\/u\/wilkes-r1b\/morlighe\/svn\/issm\/trunk\/cron\/trunk\/bin/g" | sed -e "s/cluster_executionpath=\/u\/wilkes-r1b\/larour\/Testing\/Execution/cluster_executionpath=\/u\/wilkes-r1b\/morlighe\/ExecutionNightlyRun/g"> cluster.bak
    75 mv cluster.bak cluster.rc
    76 cd ..
     79#4: compile and install ISSM
     80if [ -z $NUMCPUS ];
     81then
     82        make
     83        make install
     84else
     85        make  -j $NUMCPUS
     86        make  -j $NUMCPUS install
     87fi
    7788
    7889#Launch matlab and the nightly run script
    79 if [[ package == "" ]]
    80 then
    81         matlab -nojvm -nosplash  > ./nightlylong.log << EOF
     90matlab -nojvm -nosplash  > ./nightlylong.log << EOF
    8291startup
    83 nightlyrun;
     92nightlyrun($PACKAGES);
    8493EOF
    85 else
    86         matlab -nojvm -nosplash  > ./nightlylong.log << EOF
    87 startup
    88 nightlyrun($1);
    89 EOF
    90 fi
    9194
    9295#removed unused lines to deal with a smaller file
  • issm/trunk/cron/report.sh

    r1435 r1521  
    129129
    130130                # go through the lines of $package.log
    131                 COUNTER=1
     131                COUNTER=0
    132132                MAX=`wc -l $package.log | awk '{printf("%s",$1);}'`
    133133                while [  $COUNTER -lt $MAX ]; do
Note: See TracChangeset for help on using the changeset viewer.