% INITIALIZE() { -- argument 1: name of the experiment % echo "" % echo "$1" -- set rates to their default values % ALPHA="RATE (48.0)" % BETA="RATE (0.01)" % DELTA1="RATE (0.00035)" % DELTA2="RATE (0.0007)" % LAMBDA1="RATE (0.01667)" % LAMBDA2="RATE (0.16)" % MU1="RATE (0.033)" % MU2="RATE (2.0)" % NU="RATE (12.0)" % PHI="RATE (0.00334)" % XI="RATE (0.3)" -- set parameters to their default values % INIT_PHASE=1 -- % PROG_SIZE=40 -- % PROG_SIZE=10 % PROG_SIZE=4 -- % USER_SIZE=10 -- % USER_SIZE=8 % USER_SIZE=4 % } ------------------------------------------------------------------------------- % GENERATE() { -- argument 1: file base name (3, 4, 56, 78, 910) -- argument 2: BETA (symbolic or numeric) -- argument 3: DELTA2 (symbolic or numeric) -- argument 4: MU2 (symbolic or numeric) -- argument 5: INIT_PHASE (numeric) -- argument 6: PROG_SIZE (numeric) -- argument 7: USER_SIZE (numeric) -- argument 8: probe that remains visible (Z_AVAIL, Z_PROG_QUEUE, Z_USER_QUEUE) % DEFAULT_PROCESS_FILE="mainframe.lnt" "$1a.bcg" = generation of MAIN [C, FAIL, GET_PROG_JOB, GET_USER_JOB, PROG_JOB, PROG_JOB_READY, REPAIR, USER_JOB, USER_JOB_READY, Z_AVAIL, Z_PROG_QUEUE, Z_USER_QUEUE] ("$ALPHA", "$2", "$DELTA1", "$3", "$LAMBDA1", "$LAMBDA2", "$MU1", "$4", "$NU", "$PHI", "$XI", "$5", "$6", "$7"); % case "$8" in % "Z_AVAIL" ) -- only probe Z_AVAIL remains visible "$1b.bcg" = cut "Z_.*_QUEUE.*" in single rename "\(Z_.*\)" -> "\1 !RATE (1.0)" in "$1a.bcg"; % ;; % "Z_PROG_QUEUE" ) -- only probe Z_PROG_QUEUE remains visible "$1b.bcg" = cut "Z_AVAIL", "Z_USER_QUEUE.*" in single rename "\(Z_.*\)" -> "\1 !RATE (1.0)" in "$1a.bcg"; % ;; % "Z_USER_QUEUE" ) -- only probe Z_USER_QUEUE remains visible "$1b.bcg" = cut "Z_AVAIL", "Z_PROG_QUEUE.*" in single rename "\(Z_.*\)" -> "\1 !RATE (1.0)" in "$1a.bcg"; % ;; % esac % SVL_RECORD_FOR_SWEEP "$1a.bcg" "$1b.bcg" % } ------------------------------------------------------------------------------- % INSTANTIATE() { -- argument 1: file base name (3, 4, 56, 78, 910) -- argument 2: "none", "BETA", "MU2", or "BETA-DELTA2" -- - "none" -> INSTANTIATE() called from EXPERIMENT_910() -- - "BETA" -> INSTANTIATE() called from EXPERIMENT_78() -- - "MU2" -> INSTANTIATE() called from EXPERIMENT_3() or _4() -- - "BETA-DELTA2" -> INSTANTIATE() called from EXPERIMENT_56() -- argument 3 (optional): see below -- argument 4 (optional): see below % case "$2" in % "none" ) % cp "$1b.bcg" "$1c.bcg" % ;; % "BETA" ) -- argument 3: rate value for BETA "$1c.bcg" = single rename "BETA" -> "RATE ($3)" in "$1b.bcg"; % ;; % "MU2" ) -- argument 3: rate value for MU2 "$1c.bcg" = single rename "MU2" -> "RATE ($3)" in "$1b.bcg"; % ;; % "BETA-DELTA2" ) -- argument 3: rate value for BETA -- argument 4: rate value for DELTA2 "$1c.bcg" = single rename "BETA" -> "RATE ($3)", "DELTA2" -> "RATE ($4)" in "$1b.bcg"; % ;; % * ) % ;; % esac "$1d.bcg" = strong stochastic reduction of single rename " !RATE (\([0-9.]*\))$" -> "; rate \1" in "$1c.bcg"; % SVL_RECORD_FOR_SWEEP "$1c.bcg" "$1d.bcg" % } ------------------------------------------------------------------------------- % CHECK_12() { -- check that all probes are self-loops and do not change the semantics % svl check.svl % } ------------------------------------------------------------------------------- % EXPERIMENT_3() { % INITIALIZE "Figure 3 (steady-state)" -- local modification of $PROG_SIZE % PROG_SIZE=40 % GENERATE "3" "$BETA" "$DELTA2" "MU2" "$INIT_PHASE" "$PROG_SIZE" "$USER_SIZE" "Z_PROG_QUEUE" -- only MU2 is kept symbolical, and only probe Z_PROG_QUEUE remains visible -- set the throughput file % FILE="fig3.thr" % rm -f "$FILE" % SVL_RECORD_FOR_CLEAN $FILE -- select the appropriate columns of the throughput file % printf '# "MU2" ' > $FILE % N=1 % while [ $N -le $PROG_SIZE ] % do % printf "\"Z_PROG_QUEUE !$N\" " >> $FILE % N=`expr $N + 1` % done % printf "\n" >> $FILE % for R in 1 2 3 4 5 6 7 8 9 10 % do % INSTANTIATE "3" "MU2" "$R.0" % bcg_steady -thr -append $FILE "3d.bcg" "MU2=$R" % done -- turn $FILE into a Gnuplot nonuniform matrix % sed -i -e '1s/^#/ /' -e '1s/"Z_PROG_QUEUE !\([0-9]*\)"/ \1/g' $FILE -- call Gnuplot to generate fig3.png % gnuplot Gnuplot/fig3.plot % SVL_RECORD_FOR_CLEAN "fig3.png" % } ------------------------------------------------------------------------------- % EXPERIMENT_4() { % INITIALIZE "Figure 4 (steady-state)" -- local modification of $PROG_SIZE and $USER_SIZE % PROG_SIZE=10 % USER_SIZE=10 % GENERATE "4" "$BETA" "$DELTA2" "MU2" "$INIT_PHASE" "$PROG_SIZE" "$USER_SIZE" "Z_USER_QUEUE" -- only MU2 is kept symbolical, and only probe Z_USER_QUEUE remains visible -- set the throughput file % FILE="fig4.thr" % rm -f "$FILE" % SVL_RECORD_FOR_CLEAN $FILE -- select the appropriate columns of the throughput file % printf '# "MU2" ' > $FILE % N=1 % while [ $N -le $USER_SIZE ] % do % printf "\"Z_USER_QUEUE !$N\" " >> $FILE % N=`expr $N + 1` % done % printf "\n" >> $FILE % for R in 1 2 3 4 5 6 7 8 9 10 % do % INSTANTIATE "4" "MU2" "$R.0" % bcg_steady -thr -append $FILE "4d.bcg" "MU2=$R" % done -- turn $FILE into a Gnuplot nonuniform matrix % sed -i -e '1s/^#/ /' -e '1s/"Z_USER_QUEUE !\([0-9]*\)"/ \1/g' $FILE -- call Gnuplot to generate fig4.png % gnuplot Gnuplot/fig4.plot % SVL_RECORD_FOR_CLEAN "fig4.png" % } ------------------------------------------------------------------------------- % EXPERIMENT_56() { % INITIALIZE "Figures 5 and 6 (steady-state analysis)" % GENERATE "56" "BETA" "DELTA2" "$MU2" "$INIT_PHASE" "$PROG_SIZE" "$USER_SIZE" "Z_AVAIL" -- only BETA and DELTA2 are kept symbolical, and only probe Z_AVAIL remains visible % for DELTA2 in 0.0007 0.0014 0.0028 0.0056 % do -- set the throughput file % FILE="fig56_`echo "$DELTA2" | sed -e 's/0[.]//'`.thr" % rm -f $FILE % SVL_RECORD_FOR_CLEAN $FILE -- select the appropriate columns of the throughput file % echo '# "BETA" "Z_AVAIL" "GET_USER_JOB"' > $FILE % for BETA in 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 % do % INSTANTIATE "56" "BETA-DELTA2" "$BETA" "$DELTA2" % bcg_steady -thr -append $FILE "56d.bcg" "BETA=$BETA" % done % done -- call Gnuplot to generate fig5.png and fig6.png % gnuplot Gnuplot/fig5.plot % gnuplot Gnuplot/fig6.plot % SVL_RECORD_FOR_CLEAN "fig5.png" "fig6.png" % } ------------------------------------------------------------------------------- % EXPERIMENT_78() { % INITIALIZE "Figures 7 and 8 (transient analysis)" % GENERATE "78" "BETA" "$DELTA2" "$MU2" "$INIT_PHASE" "$PROG_SIZE" "$USER_SIZE" "Z_AVAIL" -- only BETA is kept symbolical, and only probe Z_AVAIL remains visible % for BETA in 0.010 0.025 0.050 % do % INSTANTIATE "78" "BETA" "$BETA" -- set the throughput file % FILE="fig78_`echo "$BETA" | sed -e 's/0[.]//'`.thr" % rm -f $FILE % SVL_RECORD_FOR_CLEAN $FILE -- select the appropriate columns of the throughput file % echo '# "time" "Z_AVAIL" "GET_USER_JOB"' > $FILE % bcg_transient -thr -append $FILE "78d.bcg" 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 % done -- call Gnuplot to generate fig7.png and fig8.png % gnuplot Gnuplot/fig7.plot % gnuplot Gnuplot/fig8.plot % SVL_RECORD_FOR_CLEAN "fig7.png" "fig8.png" % } ------------------------------------------------------------------------------- % EXPERIMENT_910() { % INITIALIZE "Figures 9 and 10 (transient analysis)" % for INIT_PHASE in 1 2 3 % do % GENERATE "910" "$BETA" "$DELTA2" "$MU2" "$INIT_PHASE" "$PROG_SIZE" "$USER_SIZE" "Z_AVAIL" -- no rate parameter is kept symbolical, and only probe Z_AVAIL remains visible % INSTANTIATE "910" "none" -- set the throughput file % FILE="fig910_$INIT_PHASE.thr" % rm -f "$FILE" % SVL_RECORD_FOR_CLEAN $FILE -- select the appropriate columns of the throughput file % echo '# "time" "Z_AVAIL" "GET_USER_JOB"' > $FILE % bcg_transient -thr -append $FILE "910d.bcg" 1 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 % done -- call Gnuplot to generate fig9.png and fig10.png % gnuplot Gnuplot/fig9.plot % gnuplot Gnuplot/fig10.plot % SVL_RECORD_FOR_CLEAN "fig9.png" "fig10.png" % } ------------------------------------------------------------------------------- % case "$1" in % 1 | 2 | 12 ) % CHECK_12 ;; % 3 ) % EXPERIMENT_3 ;; % 4 ) % EXPERIMENT_4 ;; % 5 | 6 | 56 ) % EXPERIMENT_56 ;; % 7 | 8 | 78 ) % EXPERIMENT_78 ;; % 9 | 10 | 910 ) % EXPERIMENT_910 ;; % * ) % CHECK_12 % EXPERIMENT_3 % EXPERIMENT_4 % EXPERIMENT_56 % EXPERIMENT_78 % EXPERIMENT_910 % esac -------------------------------------------------------------------------------