Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emulab
emulab-devel
Commits
2f2d2371
Commit
2f2d2371
authored
18 years ago
by
Dan Gebhardt
Browse files
Options
Downloads
Patches
Plain Diff
specify blacklisted nodes by filename, '-f filename' option
parent
e2fa53e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pelab/goodnodes.pl
+23
-4
23 additions, 4 deletions
pelab/goodnodes.pl
with
23 additions
and
4 deletions
pelab/goodnodes.pl
+
23
−
4
View file @
2f2d2371
...
...
@@ -33,13 +33,15 @@ my $pprefix = "node-";
#
$|
=
1
;
sub
usage
{
print
"
Usage: $0 [-e pid/eid] <numNodes>
\n
";
print
"
Usage: $0 [-e pid/eid]
[-f blacklistfilename]
<numNodes>
\n
";
return
1
;
}
my
(
$pid
,
$eid
);
my
$blacklistfilename
;
my
%opt
=
();
if
(
!
getopts
("
e:
",
\
%opt
)
)
{
exit
&usage
;
}
getopts
("
e:
f:
",
\
%opt
)
;
if
(
$opt
{
e
})
{
(
$pid
,
$eid
)
=
split
('
/
',
$opt
{
e
});
}
if
(
$opt
{
f
})
{
$blacklistfilename
=
$opt
{
f
};
}
if
(
@ARGV
!=
1
)
{
exit
&usage
;
}
my
$numnodes
=
$ARGV
[
0
];
my
@allnodes
=
();
#nodes to consider, in order of desirablility (?)
...
...
@@ -47,6 +49,7 @@ my %chosenBySite = (); #indexed by siteidx, maps to plabxxx
my
%nodeIds
=
();
#indexed by plabxxx => (siteid, nodeid)
my
$earliesttime
=
time
()
-
$pastHourWindow
*
60
*
60
;
my
%expnodes
=
();
#nodes making up eid/pid
my
%blacknodes
=
();
#nodes not allowed to be chosen (deleted from allnodes)
my
%connMatrix
=
();
# {srcsite}{dstsite} => 1/0 mapping
my
%connRating
=
();
# site => rating value
my
$allnodesIndex
=
0
;
...
...
@@ -63,8 +66,22 @@ foreach my $nodeinfo (@allnodesinfo){
push
@allnodes
,
$fields
[
0
];
#print "$fields[0]\n";
}
close
FILE
;
#
# get list of blacklisted nodes
#
if
(
defined
$blacklistfilename
){
open
FILE
,
"
<
$blacklistfilename
"
or
die
"
Can't open file
";
my
@blacklist
=
<
FILE
>
;
chomp
@blacklist
;
foreach
my
$node
(
@blacklist
){
$blacknodes
{
$node
}
=
1
;
print
"
blacknode:
$node
\n
";
}
close
FILE
;
}
#
# Get DB password and connect.
...
...
@@ -106,7 +123,9 @@ if( defined($pid) && defined($eid) ){
}
#delete nodes from allnodes not found in given experiment
for
(
my
$i
=
0
;
$i
<
scalar
(
@allnodes
);
$i
++
){
if
(
!
defined
$expnodes
{
$allnodes
[
$i
]}
){
if
(
!
defined
$expnodes
{
$allnodes
[
$i
]}
||
defined
$blacknodes
{
$allnodes
[
$i
]})
{
# print "removing $allnodes[$i] from set\n";
splice
(
@allnodes
,
$i
,
1
);
$i
--
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment