Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
9332ee77
Commit
9332ee77
authored
May 02, 2013
by
Leigh B Stoller
Browse files
Add option to use existing assign.log as the solution file.
parent
e514a46f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/mapper.in
View file @
9332ee77
...
...
@@ -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:altzZACF
NL:
";
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment