Commit c14da74c authored by Pramod R Sanaga's avatar Pramod R Sanaga
Browse files

Added an option to input initial conditions from a text file(path given as

the optional last command line argument), instead of
querying the database each time the script is run.
parent c7520dce
...@@ -16,13 +16,14 @@ my $newProjName; ...@@ -16,13 +16,14 @@ my $newProjName;
%bottleNecks = {}; %bottleNecks = {};
my %nodeClasses; my %nodeClasses;
die "Usage: perl sharedBottle.pl proj_name exp_name newProj_name newExp_name" die "Usage: perl sharedBottle.pl proj_name exp_name newProj_name newExp_name initial_conditions.txt(Optional)"
if(@ARGV < 4); if($#ARGV < 3);
$projName = $ARGV[0]; $projName = $ARGV[0];
$expName = $ARGV[1]; $expName = $ARGV[1];
$newProjName = $ARGV[2]; $newProjName = $ARGV[2];
$newExpName = $ARGV[3]; $newExpName = $ARGV[3];
$initialConditionsFilename = $ARGV[4];
$logsDir = "/proj/$projName/exp/$expName/logs/dump"; $logsDir = "/proj/$projName/exp/$expName/logs/dump";
...@@ -31,9 +32,13 @@ $logsDir = "/proj/$projName/exp/$expName/logs/dump"; ...@@ -31,9 +32,13 @@ $logsDir = "/proj/$projName/exp/$expName/logs/dump";
$elabInitScript = "/proj/tbres/duerig/testbed/pelab/init-elabnodes.pl"; $elabInitScript = "/proj/tbres/duerig/testbed/pelab/init-elabnodes.pl";
$initConditionsCommand = $elabInitScript . " -o /tmp/initial-conditions.txt " . $newProjName . " " . $newExpName; $initConditionsCommand = $elabInitScript . " -o /tmp/initial-conditions.txt " . $newProjName . " " . $newExpName;
system($initConditionsCommand); if($#ARGV == 3)
{
system($initConditionsCommand);
$initialConditionsFilename = "/tmp/initial-conditions.txt";
}
open(CONDITIONS, "/tmp/initial-conditions.txt"); open(CONDITIONS, $initialConditionsFilename);
my @initialConditions = (); my @initialConditions = ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment