hi every body
this is my first thread in this forum, i hope find a solution for my problem
i have to write a script bt i still have some error and i don't know how to correct them
[mayoura@mayoura final]$ for i in `seq 500 505`; do ./generateur_tache $i tache$i.txt; nprocs=$i; copt$i=`cat tache$i.txt | ./copt.awk` ; ./generateur_machine $(( $i * 5 / 100 )) $copt$i machine perf ; clpt$i=`./lpt $i $(( $i * 5 / 100 ))` ; ./gensched -t tache$i.txt -m machine$i -p perf$i -b 0 -g D -h D -o progdyn$i ; cmax$i=`cat progdyn$i | ./cmax.awk`; echo ` $clpt$i - $copt$i`" "` $cmax$i - $copt$i` ; done
bash: copt500=74.778: commande inconnue...
bash: clpt500=la: commande inconnue...
Invalid performance file
cat: progdyn500: Aucun fichier ou dossier de ce type
bash: cmax500=0: commande inconnue...
Usually when I have some issues not understanding why my great one liner didn't work, I put it in a script - one process per line, so I can add echoes or use set -x...
What do you expect the following scripts to do ./generateur_tache ./copt.awk /generateur_machine ./gensched ./cmax.awk
Also could you format your script in a readable fashion (ie rewrite as a script rather than a command line hack.
First thing about your code, try to make it more readable, at least when posting here and also, try to "translate" the error messages to english, with error messages in other languages, only people that knows your language will be able to help you! =o)
I think the problem with your script, check the comment I put on it, below:
for i in `seq 500 505`
do
./generateur_tache ${i} tache${i}.txt
nprocs=${i}
copt${i}=`cat tache$i.txt | ./copt.awk` # What you are trying to do here? Is it a typo? A variable name with a variable? it is not possible, as I know it... And why you need it?
./generateur_machine $(( ${i} * 5 / 100 )) ${copt}${i} machine perf
clpt$i=`./lpt $i $(( $i * 5 / 100 ))`
./gensched -t tache${i}.txt -m machine${i} -p perf${i} -b 0 -g D -h D -o progdyn${i}
cmax${i}=`cat progdyn${i} | ./cmax.awk`
echo `${clpt}${i} - ${copt}${i}`" "` ${cmax}${i} - ${copt}${i}`
done
thank you for replying
so for the first code it will generate a file in wich i line
copt is a variable calculated from this file (the sum of the line divided by an other variable) this copt will be used in generateur-machine
in bref it's a scheduling problem to resolve , copt is the optimal makespan if u know about it
sorry for my poor english
and thank u again
Hi, have you checked the comments I added in your code:
copt${i}=`cat tache$i.txt | ./copt.awk` # What you are trying to do here? Is it a typo? A variable name with a variable? it is not possible, as I know it... And why you need it?
yes i have all reay checked it and i answered , in fact i need this variable to use it in next command
as i have said the first code will generate a file with $i line (supposed as tasks to schedule each id of task with it's duration inside) the second file will take the variable copt (which is the optimal completition time calculated in copt.awk) and will generate a file containing the machines to do this tasks the number of machine is calculated from 5% of $i and the indisponibility are calculated from copt , then two scheduling algorithm will be tested , the first one in lpt(longest processing time) the completition time will be extracted from the terminal which is clpt and the second one from gensched which is a dynamic programming from which will be extracted cmax and then will be shown on the terminal the difference between copt, cmax and clpt