"src/include/functional.hpp" did not exist on "498e71b09822406b1b050c5eb03edebfe04038a6"
Commit 4b9e4e14 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: support for separate work and output directory

The work directory contains the unix sockets and shared memory regions,
while the output directory remains and contains just the logs. Need this
in our cluster where the output directory is on NFS.
parent 2beb20f1
...@@ -5,6 +5,8 @@ QEMU_CMD="$EHSIM_BASE/qemu/x86_64-softmmu/qemu-system-x86_64" ...@@ -5,6 +5,8 @@ QEMU_CMD="$EHSIM_BASE/qemu/x86_64-softmmu/qemu-system-x86_64"
QEMU_IMG="$EHSIM_BASE/qemu/qemu-img" QEMU_IMG="$EHSIM_BASE/qemu/qemu-img"
GEM5_BASE="$EHSIM_BASE/gem5" GEM5_BASE="$EHSIM_BASE/gem5"
NS3_BASE="$EHSIM_BASE/ns-3" NS3_BASE="$EHSIM_BASE/ns-3"
OUTDIR_BASE="$EHSIM_BASE/experiments/out"
WORKDIR_BASE="$OUTDIR_BASE"
if [ -f local-config.sh ] ; then if [ -f local-config.sh ] ; then
source local-config.sh source local-config.sh
...@@ -40,9 +42,10 @@ GEM5_KERNEL=$EHSIM_BASE/images/vmlinux ...@@ -40,9 +42,10 @@ GEM5_KERNEL=$EHSIM_BASE/images/vmlinux
# Args: # Args:
# - experiment name # - experiment name
init_out() { init_out() {
export OUTDIR=./out/$1/$2 export OUTDIR=$OUTDIR_BASE/$1/$2
rm -rf $OUTDIR export WORKDIR=$WORKDIR_BASE/$1/$2
mkdir -p $OUTDIR rm -rf $OUTDIR $WORKDIR
mkdir -p $OUTDIR $WORKDIR
date > $OUTDIR/starttime date > $OUTDIR/starttime
} }
...@@ -53,9 +56,9 @@ init_out() { ...@@ -53,9 +56,9 @@ init_out() {
# - [optional primary image name: default ubuntu1804-base] # - [optional primary image name: default ubuntu1804-base]
# - [optional: additinoal qemu arguments] # - [optional: additinoal qemu arguments]
run_qemu() { run_qemu() {
img_a="$OUTDIR/qemu.hd.a.$1" img_a="$WORKDIR/qemu.hd.a.$1"
img_b="$OUTDIR/qemu.hd.b.$1" img_b="$WORKDIR/qemu.hd.b.$1"
pcisock="$OUTDIR/pci.$2" pcisock="$WORKDIR/pci.$2"
rm -f $img_a $img_b rm -f $img_a $img_b
echo Creating disk for qemu $1 echo Creating disk for qemu $1
if [ -z "$4" ]; then if [ -z "$4" ]; then
...@@ -92,9 +95,9 @@ run_qemu() { ...@@ -92,9 +95,9 @@ run_qemu() {
# - [optional primary image name: default ubuntu1804-base] # - [optional primary image name: default ubuntu1804-base]
run_gem5() { run_gem5() {
echo Starting gem5 $1 echo Starting gem5 $1
pcisock="$OUTDIR/pci.$2" pcisock="$WORKDIR/pci.$2"
shm="$OUTDIR/shm.$2" shm="$WORKDIR/shm.$2"
cpdir="$OUTDIR/../checkpoint/checkpoints.$5" cpdir="$WORKDIR/../checkpoint/checkpoints.$5"
mkdir -p $cpdir mkdir -p $cpdir
if [ -z "$7" ]; then if [ -z "$7" ]; then
...@@ -128,7 +131,7 @@ run_gem5() { ...@@ -128,7 +131,7 @@ run_gem5() {
run_corundum_verilator() { run_corundum_verilator() {
echo Starting corundum_verilator $1 echo Starting corundum_verilator $1
$EHSIM_BASE/corundum/corundum_verilator \ $EHSIM_BASE/corundum/corundum_verilator \
$OUTDIR/pci.$1 $OUTDIR/eth.$1 $OUTDIR/shm.$1 \ $WORKDIR/pci.$1 $WORKDIR/eth.$1 $WORKDIR/shm.$1 \
&>$OUTDIR/corundum_verilator.$1.log & &>$OUTDIR/corundum_verilator.$1.log &
pid=$! pid=$!
ALL_PIDS="$ALL_PIDS $pid" ALL_PIDS="$ALL_PIDS $pid"
...@@ -140,7 +143,7 @@ run_corundum_verilator() { ...@@ -140,7 +143,7 @@ run_corundum_verilator() {
run_corundum_bm() { run_corundum_bm() {
echo Starting corundum_bm $1 echo Starting corundum_bm $1
$EHSIM_BASE/corundum_bm/corundum_bm \ $EHSIM_BASE/corundum_bm/corundum_bm \
$OUTDIR/pci.$1 $OUTDIR/eth.$1 $OUTDIR/shm.$1 \ $WORKDIR/pci.$1 $WORKDIR/eth.$1 $WORKDIR/shm.$1 \
&>$OUTDIR/corundum_bm.$1.log & &>$OUTDIR/corundum_bm.$1.log &
pid=$! pid=$!
ALL_PIDS="$ALL_PIDS $pid" ALL_PIDS="$ALL_PIDS $pid"
...@@ -152,7 +155,7 @@ run_corundum_bm() { ...@@ -152,7 +155,7 @@ run_corundum_bm() {
run_i40e_bm() { run_i40e_bm() {
echo Starting i40e $1 echo Starting i40e $1
$EHSIM_BASE/i40e_bm/i40e_bm \ $EHSIM_BASE/i40e_bm/i40e_bm \
$OUTDIR/pci.$1 $OUTDIR/eth.$1 $OUTDIR/shm.$1 \ $WORKDIR/pci.$1 $WORKDIR/eth.$1 $WORKDIR/shm.$1 \
&>$OUTDIR/i40e_bm.$1.log & &>$OUTDIR/i40e_bm.$1.log &
pid=$! pid=$!
ALL_PIDS="$ALL_PIDS $pid" ALL_PIDS="$ALL_PIDS $pid"
...@@ -173,7 +176,7 @@ run_wire() { ...@@ -173,7 +176,7 @@ run_wire() {
fi fi
$EHSIM_BASE/net_wire/net_wire \ $EHSIM_BASE/net_wire/net_wire \
$OUTDIR/eth.$2 $OUTDIR/eth.$3 $pcap &>$OUTDIR/wire.$1.log & $WORKDIR/eth.$2 $WORKDIR/eth.$3 $pcap &>$OUTDIR/wire.$1.log &
pid=$! pid=$!
ALL_PIDS="$ALL_PIDS $pid" ALL_PIDS="$ALL_PIDS $pid"
return $pid return $pid
...@@ -185,7 +188,7 @@ run_wire() { ...@@ -185,7 +188,7 @@ run_wire() {
run_ns3_bridge() { run_ns3_bridge() {
ports="" ports=""
for p in $2; do for p in $2; do
epath="`readlink -f $OUTDIR/eth.$p`" epath="`readlink -f $WORKDIR/eth.$p`"
ports="$ports --CosimPort=$epath" ports="$ports --CosimPort=$epath"
done done
$NS3_BASE/cosim-run.sh cosim cosim-bridge-example \ $NS3_BASE/cosim-run.sh cosim cosim-bridge-example \
...@@ -203,11 +206,11 @@ run_ns3_bridge() { ...@@ -203,11 +206,11 @@ run_ns3_bridge() {
run_ns3_dumbbell() { run_ns3_dumbbell() {
ports="" ports=""
for p in $2; do for p in $2; do
epath="`readlink -f $OUTDIR/eth.$p`" epath="`readlink -f $WORKDIR/eth.$p`"
ports="$ports --CosimPortLeft=$epath" ports="$ports --CosimPortLeft=$epath"
done done
for p in $3; do for p in $3; do
epath="`readlink -f $OUTDIR/eth.$p`" epath="`readlink -f $WORKDIR/eth.$p`"
ports="$ports --CosimPortRight=$epath" ports="$ports --CosimPortRight=$epath"
done done
...@@ -226,11 +229,11 @@ run_ns3_dumbbell() { ...@@ -226,11 +229,11 @@ run_ns3_dumbbell() {
run_ns3_sequencer() { run_ns3_sequencer() {
ports="" ports=""
for p in $2; do for p in $2; do
epath="`readlink -f $OUTDIR/eth.$p`" epath="`readlink -f $WORKDIR/eth.$p`"
ports="$ports --ClientPort=$epath" ports="$ports --ClientPort=$epath"
done done
for p in $3; do for p in $3; do
epath="`readlink -f $OUTDIR/eth.$p`" epath="`readlink -f $WORKDIR/eth.$p`"
ports="$ports --ServerPort=$epath" ports="$ports --ServerPort=$epath"
done done
...@@ -251,7 +254,11 @@ cleanup() { ...@@ -251,7 +254,11 @@ cleanup() {
kill -KILL $p &>/dev/null kill -KILL $p &>/dev/null
done done
rm -f $OUTDIR/{qemu.hd.*,shm.*,pci.*,eth.*} if [ "$OUTDIR" != "$WORKDIR" ]; then
rm -rf $WORKDIR
else
rm -f $WORKDIR/{qemu.hd.*,shm.*,pci.*,eth.*}
fi
date >>$OUTDIR/endtime date >>$OUTDIR/endtime
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment