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
aed07367
Commit
aed07367
authored
Aug 03, 2007
by
Jonathon Duerig
Browse files
Randomize order of visitation based on source node.
parent
a0a100b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
pelab/bw-bottleneck/gather-dest.pl
View file @
aed07367
...
...
@@ -74,14 +74,32 @@ sub runTest
#-----------------------------------------------------------------------
@randList
=
();
for
(
$i
=
1
;
$i
<=
$nodeCount
;
++
$i
)
{
for
(
$j
=
$i
+
1
;
$j
<=
$nodeCount
;
++
$j
)
push
(
@randList
,
$i
);
}
srand
(
$source
);
for
(
$i
=
1
;
$i
<=
$nodeCount
;
++
$i
)
{
$first
=
int
(
rand
(
$nodeCount
));
$second
=
int
(
rand
(
$nodeCount
));
$temp
=
$randList
[
$first
];
$randList
[
$first
]
=
$randList
[
$second
];
$randList
[
$second
]
=
$temp
;
}
for
(
$i
=
0
;
$i
<
$nodeCount
;
++
$i
)
{
for
(
$j
=
$i
+
1
;
$j
<
$nodeCount
;
++
$j
)
{
if
(
$i
!=
$source
&&
$j
!=
$source
)
$dest1
=
$randList
[
$i
];
$dest2
=
$randList
[
$j
];
if
(
$dest1
!=
$source
&&
$dest2
!=
$source
)
{
runTest
(
$
i
,
$j
);
runTest
(
$
dest1
,
$dest2
);
}
}
}
Write
Preview
Supports
Markdown
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