Index: /issm/trunk/cron/configs/linux64_local
===================================================================
--- /issm/trunk/cron/configs/linux64_local	(revision 2186)
+++ /issm/trunk/cron/configs/linux64_local	(revision 2186)
@@ -0,0 +1,79 @@
+#
+########### Configuration file for a local nightly run on Linux ############
+
+#1: ISSM general configuration
+#-----------------------------
+
+#ISSM main directory (full pathto ISSM trunk)
+ISSM_DIR=$ISSM_DIR
+
+#ISSM Architecture
+ISSM_ARCH=$ISSM_ARCH
+
+#Operating System
+OS="linux64"
+
+#MATLAB path
+MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
+
+#2: ISSM Installation
+#--------------------
+
+#ISSM installation. If SKIPINSTALLATION="no" the existing version of the 
+#code will be erased. The new version will be checked out and fully 
+#installed. If SKIPINSTALLATION="yes", the following options won't be
+#used. Go to section 3
+
+SKIPINSTALLATION="yes"
+
+#SVN repository
+REPOSITORY="http://s383-rhat/issm/svn/issm/trunk"
+
+#execution path used for parallel runs
+EXECUTION_PATH=""
+
+#External packages installation. If SKIPPACKAGESCOMPILATION="no" the
+#packages mentionned in EXTERNALPACKAGES will be fully installed which
+#requires a long time. If SKIPPACKAGESCOMPILATION="yes", the external 
+#packages directory will be removed and the directories 
+#EXTERNALPACKAGESDIR and DEVPACKAGESDIR will be copied.
+
+SKIPPACKAGESCOMPILATION="yes"
+EXTERNALPACKAGESDIR=""
+DEVPACKAGESDIR=""
+
+#List of external pakages to be installed
+EXTERNALPACKAGES=""
+
+#3: ISSM Compilation
+#-------------------
+
+#ISSM compilation. If SKIPCOMPILATION="no" ISSM will be reconfigured
+#and compiled.
+SKIPCOMPILATION="yes"
+
+#4: Mail notification
+#--------------------
+
+#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
+#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
+SKIPMAIL="yes"
+
+#Sender email address
+EMAIL_ADRESS=mathieu.morlighem@jpl.nasa.gov
+
+#5: Nightly run options
+#----------------------
+
+#number of cpus used in ISSM installation and compilation (one is usually
+#safer as some packages are very sensitive to parallel compilation)
+NUMCPUS_INSTALL=1
+
+#number of cpus used in the nightly runs.
+NUMCPUS_RUN=4
+
+#Nightly run options. The matlab routine nightlyrun.m will be called
+#as follows: nightlyrun($NROPTIONS). The options must be understandable
+#by Matlab and nightlyrun.m
+
+NROPTIONS="'parallel',0"
Index: /issm/trunk/cron/nightlyrun.sh
===================================================================
--- /issm/trunk/cron/nightlyrun.sh	(revision 2185)
+++ /issm/trunk/cron/nightlyrun.sh	(revision 2186)
@@ -107,5 +107,5 @@
 			cd $ep
 			cp configs/$OS/* .
-			./install.sh $NUMCPUS
+			./install.sh $NUMCPUS_INSTALL
 			cd ..
 		done
@@ -135,11 +135,11 @@
 	then
 		cd $ISSM_DIR/src/c
-		./intel-compile.sh >> ../../c-compilation.log 2>&1
+		./intel-compile.sh
 		cd $ISSM_DIR/src/mex
-		make install >> ../../mex-compilation.log 2>&1
+		make install
 		cd $ISSM_DIR
 	else
-		make -j $NUMCPUS >> ../../cmex-compilation.log 2>&1
-		make -j $NUMCPUS install >> ../../cmex-compilation.log 2>&1
+		make -j $NUMCPUS_INSTALL
+		make -j $NUMCPUS_INSTALL install
 	fi
 fi
@@ -162,5 +162,5 @@
 #Launch matlab and the nightly run script
 cd $ISSM_DIR/cron/
-./run.sh $NROPTIONS
+./run.sh $1
 ELAPSED_RUN=$(timer $INSTALL_TIME)
 ELAPSED_TOTAL=$(timer $START_TIME)
@@ -176,15 +176,17 @@
 exit
 		
-#send mail
-source cron/mailinglist
-for i in `echo $MAILINGLIST`; do
-
-	if [ "$OS" = "winxp32" ]
-	then
-		email -html -f "ISSM Nightly run $EMAIL_ADRESS" -s "Nightly runs of $ISSM_RELEASE , operating system: $OS. " $i < report.html 
-	else 
-		if [ "$OS" = "linux64" ]
+#send mail if requested
+if [ "$SKIPMAIL" != "yes" ]
+then
+	source cron/mailinglist
+	for i in `echo $MAILINGLIST`; do
+
+		if [ "$OS" = "winxp32" ]
 		then
-			cat - report.html <<HERE | /usr/lib/sendmail  -oi -t
+			email -html -f "ISSM Nightly run $EMAIL_ADRESS" -s "Nightly runs of $ISSM_RELEASE , operating system: $OS. " $i < report.html 
+		else 
+			if [ "$OS" = "linux64" ]
+			then
+				cat - report.html <<HERE | /usr/lib/sendmail  -oi -t
 From: "ISSM Nightly run" <$EMAIL_ADRESS>
 To: $i
@@ -194,5 +196,5 @@
 HERE
 		else
-			cat - report.html <<HERE | /usr/sbin/sendmail  -oi -t
+cat - report.html <<HERE | /usr/sbin/sendmail  -oi -t
 From: "ISSM Nightly run" <$EMAIL_ADRESS>
 To: $i
@@ -201,6 +203,6 @@
 Content-Type: text/html
 HERE
+			fi
 		fi
-	fi
-
-done
+	done
+fi
Index: /issm/trunk/cron/report.sh
===================================================================
--- /issm/trunk/cron/report.sh	(revision 2185)
+++ /issm/trunk/cron/report.sh	(revision 2186)
@@ -125,5 +125,5 @@
 
 #report content
-if [ $IS_INSTALL -eq 1 ];
+if [ $IS_RUN -eq 1 ];
 then
 	cat << END > content.html
Index: /issm/trunk/cron/run.sh
===================================================================
--- /issm/trunk/cron/run.sh	(revision 2185)
+++ /issm/trunk/cron/run.sh	(revision 2186)
@@ -1,13 +1,23 @@
 #!/bin/bash
 
-numprocs=8;
+#get configs
+if [ $# -ne 1 ];
+then
+	#no config file specified: exit
+	echo "no config file specified. Exiting..."
+	exit 1
+fi
+source $1;
 
 #create softlink to startup
-rm startup.m
 cd $ISSM_DIR/test/Verification/NightlyRun/
+if [ -e startup.m ]
+then
+	rm startup.m
+fi
 ln -s $ISSM_DIR/startup.m .
 
 #Launch all tests on different cpus
-for (( i=1;i<=$numprocs;i++ ))
+for (( i=1;i<=$NUMCPUS_RUN;i++ ))
 do
 	#Launch matlab and the nightly run script
@@ -17,7 +27,7 @@
 	$(if [ "$1" = ""  ]
 	then
-		echo "nightlyrun('rank',$i,'numprocs',$numprocs);"
+		echo "nightlyrun;"
 	else
-		echo "nightlyrun($1,'rank',$i,'numprocs',$numprocs);"
+		echo "nightlyrun($NROPTIONS,'rank',$i,'numproc',$NUMCPUS_RUN);"
 	fi
 		)
@@ -26,5 +36,5 @@
 		directory=strsplit(pwd,'/');
 		message=getReport(me)
-		fid=fopen([ISSM_DIR '/test/Verification/NightlyRun/matlaberror.log'], 'wt');
+		fid=fopen([ISSM_DIR '/test/Verification/NightlyRun/matlaberror.log'], 'at');
 		fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
 		fprintf(fid,'%s',message);
@@ -43,5 +53,5 @@
 #concatenate all reports
 mv matlab_log1.log  matlab_log.log
-for (( i=2;i<=$numprocs;i++ ))
+for (( i=2;i<=$NUMCPUS_RUN;i++ ))
 do
 	cat matlab_log.log matlab_log$i.log > matlab_log.log.bak
