Commit 9332ee77 authored by Leigh B Stoller's avatar Leigh B Stoller

Add option to use existing assign.log as the solution file.

parent e514a46f
......@@ -71,7 +71,7 @@ sub usage ()
print STDERR " -A - Tell ptopgen all nodes are free; only with -n\n";
exit($WRAPPER_FAILED);
}
my $optlist = "dvunfprqczxm:ko:altzZACF";
my $optlist = "dvunfprqczxm:ko:altzZACFNL:";
my $verbose = 0;
my $debug = 0;
my $fixmode = 0;
......@@ -89,6 +89,7 @@ my $regression = 0;
my $noassign = 0; # Only with regression mode, use previous solution.
my $noregfree = 0; # Only with regression mode, leave physical state at end.
my $usecurrent = 0; # Only with regression mode, use current solution.
my $assignfile;
my $quiet = 0;
my $clear = 0;
my $warnings = 0;
......@@ -186,6 +187,12 @@ if (defined($options{"t"})) {
if (defined($options{"n"})) {
$impotent = 1;
}
if (defined($options{"N"})) {
$noassign = 1;
}
if (defined($options{"L"})) {
$assignfile = $options{"L"};
}
if (defined($options{"f"})) {
$fixmode = 1;
}
......@@ -527,6 +534,7 @@ sub RunAssign($$)
$vtopfile .= ".xml";
}
my $assignexitcode = 0;
my $assignlog = "assign.log";
#
# Now generate a vtop file and dump it to a file.
......@@ -565,9 +573,12 @@ sub RunAssign($$)
goto skipassign
if ($vtop->nodecount() == $vtop->genicount());
# Debugging hack for regression mode. Avoid really long assign runs.
if ($regression && $noassign) {
if (! -e "assign.log") {
# Debugging hack.
if ($regression || $noassign || $assignfile) {
$assignlog = $assignfile
if ($assignfile);
if (! -e $assignlog) {
chat("No existing assign results file!\n");
return -1;
}
......@@ -716,7 +727,7 @@ sub RunAssign($$)
# the parent.
#
POSIX::setsid();
exec("nice $WRAPPER2 $cmd $args > assign.log 2>&1");
exec("nice $WRAPPER2 $cmd $args > $assignlog 2>&1");
die("Could not start assign!\n");
}
TBDebugTimeStamp("assign finished");
......@@ -730,8 +741,8 @@ sub RunAssign($$)
}
# Check for possible full filesystem ...
if (-z "assign.log") {
tbnotice("assign.log is zero length! Stopping ...\n");
if (-z $assignlog) {
tbnotice("$assignlog is zero length! Stopping ...\n");
return -1;
}
......@@ -741,13 +752,13 @@ sub RunAssign($$)
# purposes We do not call it .log though, since we do not want it
# copied out to the user directory every swapin. See Experiment.pm
#
system("/bin/cp -fp assign.log ${prefix}.assign");
system("/bin/cp -fp assign.log ${pid}-${eid}.assign") if ($debug);
system("/bin/cp -fp $assignlog ${prefix}.assign");
system("/bin/cp -fp $assignlog ${pid}-${eid}.assign") if ($debug);
if ($assignexitcode) {
print "Assign exited with $assignexitcode\n" if ($debug);
system("/bin/cat assign.log");
system("/bin/cat $assignlog");
#
# assign returns two positive error codes (that we care about).
# The distinction between them is somewhat murky. An exitval of
......@@ -768,7 +779,7 @@ sub RunAssign($$)
}
skiprun:
chat("Reading assign results.\n");
if (!open(ASSIGNFP, "assign.log")) {
if (!open(ASSIGNFP, $assignlog)) {
print("Could not open assign logfile! $!\n");
return -1;
}
......
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