Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
1e9d3053
Commit
1e9d3053
authored
Aug 09, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -t (toponly) mode.
parent
13b09515
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
25 deletions
+35
-25
tbsetup/mapper.in
tbsetup/mapper.in
+35
-25
No files found.
tbsetup/mapper.in
View file @
1e9d3053
...
...
@@ -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:al
t
";
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
(),
...
...
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