Commit 1e9d3053 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add -t (toponly) mode.

parent 13b09515
......@@ -51,13 +51,14 @@ sub usage ()
print STDERR " -l - Use rspec v2 instead of the text file format\n";
exit($WRAPPER_FAILED);
}
my $optlist = "dvunfprqczxm:ko:al";
my $optlist = "dvunfprqczxm:ko:alt";
my $verbose = 0;
my $debug = 0;
my $fixmode = 0;
my $updating = 0;
my $impotent = 0;
my $precheck = 0;
my $toponly = 0;
my $prepass = 0;
my $alloconly = 0;
my $outfile;
......@@ -147,6 +148,10 @@ if (defined($options{"d"})) {
if (defined($options{"u"})) {
$updating = 1;
}
if (defined($options{"t"})) {
$toponly = 1;
$quiet = 1;
}
if (defined($options{"n"})) {
$impotent = 1;
}
......@@ -170,7 +175,8 @@ if (defined($options{"r"})) {
fatal("Cannot use regression mode on main DB");
}
$regression = 1;
$clear = 1;
$clear = 1
if (!defined($options{"t"}));
$fixmode = 1;
TBDebugTimeStampsOn();
$usecurrent = 1
......@@ -248,7 +254,8 @@ exit(0);
sub MapperWrapper()
{
chat("Starting the new and improved mapper wrapper.\n");
chat("Starting the new and improved mapper wrapper.\n")
if (!$toponly);
# Need to do this cause libvtop will add them again.
# Must be done before nodes are released.
......@@ -261,12 +268,13 @@ sub MapperWrapper()
fatal("Could not create vtop structure for $experiment");
}
TBDebugTimeStamp("Create libvtop ended");
TBDebugTimeStamp("vtopgen started");
$vtop->CreateVtop() == 0
or fatal("Could not create vtop for $experiment");
TBDebugTimeStamp("vtopgen finished");
if (!$impotent && ($updating || $clear)) {
if (!$impotent && !$toponly && ($updating || $clear)) {
if ($clear) {
chat("Freeing reserved nodes ...\n");
system("export NORELOAD=1; $NFREE -x -a $pid $eid") == 0
......@@ -403,7 +411,7 @@ sub AssignLoop()
$currentrun++;
}
GatherAssignStats($pid, $eid, %{ $vtop->exptstats() })
if (! ($impotent || $alloconly));
if (! ($impotent || $alloconly || $regression || $toponly));
TBDebugTimeStamp("mapper loop finished");
return 0;
}
......@@ -424,6 +432,28 @@ sub RunAssign($$)
}
my $assignexitcode = 0;
#
# Now generate a vtop file and dump it to a file.
#
if (! open(VTOPFILE, "> $vtopfile")) {
tberror("Could not open $vtopfile: $!\n");
return -1;
}
my $reslibvtop;
if ($userspec == 1) {
$reslibvtop = $vtop->PrintRspec(*VTOPFILE);
}
else {
$reslibvtop = $vtop->PrintTop(*VTOPFILE);
}
if ($reslibvtop != 0) {
tberror("Could not print vtop file for $experiment\n");
return -1;
}
close(VTOPFILE);
return 0
if ($toponly);
# Debugging hack for regression mode. Avoid really long assign runs.
if ($regression && $noassign) {
if (! -e "assign.log") {
......@@ -501,26 +531,6 @@ sub RunAssign($$)
}
TBDebugTimeStamp("ptopgen finished");
#
# Now generate a vtop file and dump it to a file.
#
if (! open(VTOPFILE, "> $vtopfile")) {
tberror("Could not open $vtopfile: $!\n");
return -1;
}
my $reslibvtop;
if ($userspec == 1) {
$reslibvtop = $vtop->PrintRspec(*VTOPFILE);
}
else {
$reslibvtop = $vtop->PrintTop(*VTOPFILE);
}
if ($reslibvtop != 0) {
tberror("Could not print vtop file for $experiment\n");
return -1;
}
close(VTOPFILE);
if (! ($impotent || $regression || $alloconly)) {
if ($experiment->Update({"maximum_nodes" => $vtop->maximum_nodes(),
"minimum_nodes" => $vtop->minimum_nodes(),
......
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