Skip to content

Commit

Permalink
star network for experiments
Browse files Browse the repository at this point in the history
terrible topology, but worth having
  • Loading branch information
vygr committed Mar 27, 2016
1 parent 6307dae commit 2179525
Showing 2 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -85,6 +85,10 @@ Fully connected network. Each cpu has links to every other cpu. Careful with
this as you can end up with a very large number of link files and shared mem
regions.

./run_star.sh <num_cpus>

Star connected network. Each cpu has a link to the first cpu.

./run_ring.sh <num_cpus>

Ring connected network. Each cpu has links to the next and previous cpus.
35 changes: 35 additions & 0 deletions run_star.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

#have we got a paramater ?
if [ -z ${1+x} ]
then
num_cpu=64
else
num_cpu=$1
fi

#not greater then 1000
if [ $num_cpu -gt 1000 ]
then
num_cpu=1000
fi

source funcs.sh

links_to_0=""
for ((cpu=$num_cpu-1; cpu>0; cpu--))
do
links=""
c1=$cpu
c2=0

zero_pad $c1
c1=$zp
zero_pad $c2
c2=$zp
add_link $c1 $c2
links_to_0+="$links"

boot_cpu $cpu "$links"
done
boot_cpu $cpu "$links_to_0"

0 comments on commit 2179525

Please sign in to comment.