NEW Sharing area
User documentation
Admin documentation
Development resources
Download
Private area

#!/bin/bash # to customize with your own installation path TRIPOLI_HOME=... ... ... # convert EOL from windows to unix FICH=`basename $1` mv -f $FICH $FICH.orig tr -d '\r' < $FICH.orig > $FICH # to check if graf is asked. In this case, uses Xvfb and xdotool to get .ps and continue calculation. # need packages Xvfb, xdotool, x11-xkb-utils. Xvfb and xdotool to be in PATH GRAF=`grep GRAF * | wc -l` PROG=$TRIPOLI_HOME/CODE/bin/$TRIPOLI_ARCH/static_tripoli4 if [ ! "$GRAF" == "0" ]; then for i in `seq 1 10`; do if [ ! -e /tmp/.X$i-lock ]; then NDISPLAY=$i; break; fi done Xvfb :$NDISPLAY & PID_XVFB=$! echo $PID_XVFB >> PID echo "export DISPLAY=:"$NDISPLAY".0" export DISPLAY=:$NDISPLAY".0" fi $PROG -d $FICH -s $SOPTION -c $COPTION -o $FICH.listing > $FICH.out & PID_TRIPOLI=$! # allows Promethee to kill Tripoli when needed echo $PID_TRIPOLI >> PID if [ ! "$GRAF" == "0" ]; then PRINTED_GRAF=`grep "checking association" $FICH.listing` PRINTED_ERROR=`grep "error" $FICH.out``grep "entry not found" $FICH.out` while [ "$PRINTED_GRAF" == "" ] && [ "$PRINTED_ERROR" == "" ] do sleep 3 echo "Return" xdotool key Return # virtually press "Return" key to continue on GRAF loop PRINTED_GRAF=`grep "checking association" $FICH.listing` PRINTED_ERROR=`grep "error" $FICH.out``grep "entry not found" $FICH.out` done kill -2 $PID_XVFB rm -f /tmp/.X$NDISPLAY-lock fi wait $PID_TRIPOLI # restore initial input file mv -f $FICH.orig $FICH rm -f PID PRINTED_ERROR=`grep "error" $FICH.out``grep "entry not found" $FICH.out` if [ ! "$PRINTED_ERROR" == "" ]; then echo "Calculation failed. exiting." #echo " simulation time -1" >> $FICH.listing # turn around no longer needed in 1.1 exit 0 fi