sandbox/amansur/How_to_program_automated_succession_simulation
Thank you Thomas for those files !
How to do it
Creating many folders
To create the folders type in the Terminal :
:~/right_folder$ sh createfolders.sh amansur@cezanne
Note : you have to be in the folder where the file ‘createfolders.sh’ is, in the Terminal directory adress (~/right_folder).
createfolders.sh
#! /bin/bash
=5
COUNTER=1
Updater
echo Creating Foldersfor i in $( seq $COUNTER )
do
mkdir $i
done
echo Created $COUNTER Folders~
Succession of simulations
Put the files you want to compute, with the Makefile in the different folders you just created and put the right value into those files (for example: change the value of Ca, Re, the level, the size of the box, …).
Then launch the ‘succession_simulation.sh’ file by this command :
:~/right_folder$ sh succession_simulation.sh amansur@cezanne
Note : you have to be in the folder where the file ‘createfolders.sh’ is, in the Terminal directory adress (~/right_folder).
succession_simulation.sh
#! /bin/bash
clear=$(date +%s)
StartTime-system-monitor &
gnome
echo $StartTime'Starting Sigma Lineari'
echo =5 #Number of folders
COUNTERfor i in $( seq $COUNTER )
do
="/poisson/temporaires/amansur/Stage_M2/" #Path to your folder
dirname=$dirname$i
dirname
cd $dirname
echo $dirname="/input"
inputfile=$dirname$inputfile
file
echo $file
ls.tst
make sigma_lineaire
wait..
cd 5
sleep
done=$(date +%s)
StopTime#echo $StopTime
=$(($StopTime - $StartTime))
TotalTime"$(($TotalTime/3600)) h $(($TotalTime/60)) m $(($TotalTime%60)) s elapsed."
echo =$(date -d @$StartTime)
StartTime=$(date -d @$StopTime) StopTime
if the loop doesn’t work, use that code :
#! /bin/bash
clear=$(date +%s)
StartTime-system-monitor &
gnome
echo $StartTime'Starting Sigma Lineaire'
echo for i in 1 2 3 4 5
do
="/poisson/temporaires/amansur/Stage_M2/" #Path to your folder
dirname=$dirname$i
dirname
cd $dirname
echo $dirname="/input"
inputfile=$dirname$inputfile
file
echo $file
ls.tst
make sigma_lineaire
wait..
cd 5
sleep (pwd)
echo $
done=$(date +%s)
StopTime#echo $StopTime
=$(($StopTime - $StartTime))
TotalTime"$(($TotalTime/3600)) h $(($TotalTime/60)) m $(($TotalTime%60)) s elapsed."
echo =$(date -d @$StartTime)
StartTime=$(date -d @$StopTime) StopTime
How to check a variable during computation
Since the computation is going to take a while, it would be nice to be able to follow at where the simulation is. To do this, you can open a new terminal (Ctrl+Alt+T), go to the right folder and type in the command line of the terminal : “tail -f t.dat”
In the file
In the terminal
> tail -f t.dat