edgecloudsim/scripts/sample_app1/run_scenarios.sh
Cagatay Sonmez d4545f009f major modifications for v2.0 release
Release notes

1- Cloud server processing was simplified in the initial version, it is handled via cloudsim components now.

2- Cloud server manager, edge server manager, mobile device manager and vm allocation policy are used as abstract class in factory pattern to allow developers to use different business logic without modifying EdgeCloudSim source code.

3- The task and place types are no longer defined as enumeration. They are used as integer value in order to manipulate more place type without modifying enum variable.

4- Two sample applications (one of them is simple and the other one extended application) are added along with the corresponding matlab files to plot statistics.

5- Cloud server properties are added to the simulation settings file

6- New log items are added to simulation result files

7- Code refactoring is applied including the modification of comments
2018-09-10 14:22:27 +03:00

60 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Missing arguments! Please provide number of parallel processes and number of iterations."
echo "Usage: '$0 4 10'"
exit 1
fi
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo "$1 is not an integer! Please provide number of parallel processes."
echo "Usage: '$0 4 10'"
exit 1
fi
if ! [[ $2 =~ $re ]] ; then
echo "$1 is not an integer! Please provide number of iterations."
echo "Usage: '$0 4 10'"
exit 1
fi
script_root_path="$(dirname "$(readlink -f "$0")")"
root_out_folder=${script_root_path}/output
num_of_processes=$1
iterationNumber=$2
process_counter=0
date=$(date '+%d-%m-%Y_%H-%M')
simulation_out_folder=${root_out_folder}/${date}
mkdir -p $simulation_out_folder
simulations=$(cat ${script_root_path}/simulation.list)
rm -rf ${script_root_path}/tmp_runner*
for sim_args in $simulations
do
scenario_name=$(echo $sim_args | cut -d ';' -f1)
edge_devices_file=$(echo $sim_args | cut -d ';' -f2)
applications_file=$(echo $sim_args | cut -d ';' -f3)
for (( i=1; i<=$iterationNumber; i++ ))
do
process_id=$(($process_counter % $num_of_processes))
process_counter=$(($process_counter + 1))
echo "${script_root_path}/runner.sh $simulation_out_folder $scenario_name $edge_devices_file $applications_file ${i}" >> "${simulation_out_folder}/tmp_runner${process_id}.sh"
done
done
#num_of_cores=$(grep -c ^processor /proc/cpuinfo)
for (( i=0; i<$num_of_processes; i++ ))
do
chmod +x ${simulation_out_folder}/tmp_runner${i}.sh
${simulation_out_folder}/tmp_runner${i}.sh &
# pid=$!
# cpu=$(($i % $num_of_cores))
# taskset -cp $cpu,$cpu $pid
done