Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The boss of remote compilation in the whole 93
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 4 Mar 2005 13:58:01 +0000 (13:58 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 4 Mar 2005 13:58:01 +0000 (13:58 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1157 48e7efb5-ca39-0410-a469-dd3cf9ba447f

tools/graspe-master [new file with mode: 0755]

diff --git a/tools/graspe-master b/tools/graspe-master
new file mode 100755 (executable)
index 0000000..34287cf
--- /dev/null
@@ -0,0 +1,79 @@
+#! /bin/bash
+
+MACHINES=${MACHINES:-\
+           graal.ens-lyon.fr   allo-psmn.ens-lyon.fr \
+           valnure.cs.ucsb.edu sperm.cs.ucsb.edu     basalt.cs.ucsb.edu \
+           nala.cs.utk.edu     AIX}
+
+# ACTIONS: What to do there
+# possible values:
+#  - scp:     copy a tarball over
+#  - rsync:   rsync the source (rsync must be installed remotely)
+#
+#  - clean:   erase any previously existing source tree and 
+#             open the new open
+#  - untar:   open the tarball which was just copied
+#  - touch:   touch every file of the source tree to deal with 
+#             clock brokenness. May help, may harm.
+#  - config:  launch configure
+#  - compile: run 'make'
+#  - install: run 'make install'
+#  - check:   run 'make check'
+#
+# default value:
+ACTIONS=${ACTIONS:-scp clean untar config compile check}
+
+REMOTE_PREFIX=${REMOTE_PREFIX:-simgrid}
+
+###
+### End of configuration. You shouldn't change anything below
+###
+
+srcdir=`echo "@srcdir@"|./config.status --file=-:-`
+PACKAGE=`echo "@PACKAGE@"|./config.status --file=-:-`
+VERSION=`echo "@VERSION@"|./config.status --file=-:-`
+
+echo;echo "----[ Recompile the package on remote hosts ]----"
+test -e $srcdir/buildlogs/${PACKAGE}-${VERSION} || mkdir -p ${srcdir}/buildlogs/${PACKAGE}-${VERSION}
+failed=0;
+ for site in ${MACHINES} ; do 
+   machine=`echo $site |sed 's/^\([^%]*\)%.*$/\1/'`;
+   machine2=`echo $site |sed 's/^\([^%]*\)%\(.*\)$/\2/'`;
+   cmd="\"sh -c 'env REMOTE_PREFIX=${REMOTE_PREFIX} ${REMOTE_PREFIX}/src/graspe-slave ${ACTIONS} 2>&1'\"";
+   if echo $site | grep  '%' >/dev/null ; then 
+     echo "----[ Compile on $machine2 (behind $machine) ]----";
+   else 
+     machine=$site;
+     echo "----[ Compile on $machine ]----";
+   fi;
+   
+   ##
+   ## Source diffusion
+   ##
+   
+   if echo ${ACTIONS} | grep -q scp ; then
+     echo "-- Copy the data over"; 
+     [ -e ${srcdir}/${PACKAGE}-${VERSION}.tar.gz ] || make -C ${srcdir} dist
+     scp ${srcdir}/${PACKAGE}-${VERSION}.tar.gz tools/graspe-slave \
+       $machine:${REMOTE_PREFIX}/src;
+   else if echo ${ACTIONS} | grep -q rsync ; then
+     echo "-- Rsync the data over"; 
+     [ -e ${srcdir}/${PACKAGE}-${VERSION} ] || make -C ${srcdir} distdir
+     rsync -t -r ${srcdir}/${PACKAGE}-${VERSION} tools/graspe-slave $machine:${REMOTE_PREFIX}/src/
+   fi fi 
+   
+   ##
+   ## Compilation
+   ##
+   
+   echo "-- Compiling... (the output gets into ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log)"; 
+   if echo $site | grep  '%' >/dev/null ; then 
+     if ssh $machine "env REMOTE_PREFIX=${REMOTE_PREFIX} ssh -A $machine2 $cmd" 2>&1 > ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log;
+     then echo "Sucessful"; else failed=1;echo "Failed (check ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log)"; fi;echo; 
+   else 
+     if ssh $machine "eval $cmd" 2>&1 > ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log ;
+     then echo "Sucessful"; else failed=1;echo "Failed (check ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log)"; fi;echo; 
+   fi;
+done;
+${srcdir}/tools/compile-stats;
+exit $failed