-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools/zep_dispatch: run dispatch with custom topology #18170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
Ah ok, now I see what's the problem: You want the Then how about moving the 'only create file if it doesn't exist' logic to diff --git a/dist/tools/zep_dispatch/topogen.sh b/dist/tools/zep_dispatch/topogen.sh
index db19059282..6b2e6f2b92 100755
--- a/dist/tools/zep_dispatch/topogen.sh
+++ b/dist/tools/zep_dispatch/topogen.sh
@@ -22,9 +22,10 @@ RANGE=30 # base node radio range
VARIANCE=15 # random offset to radio range
NUM=10 # number of nodes
-echo "writing to $FILE"
-
-./bin/topogen -w $WIDTH -h $HEIGHT -r $RANGE -v $VARIANCE -n $NUM > "$FILE"
+if [ ! -f "$FILE" ]; then
+ echo "writing to $FILE"
+ ./bin/topogen -w $WIDTH -h $HEIGHT -r $RANGE -v $VARIANCE -n $NUM > "$FILE"
+fi
if ! command -v gnuplot > /dev/null; then
printf "${CWARN}%s${CRESET}\n" "gnuplot not installed" and drop the Makefile changes. |
You can now also get rid of |
It's done. thanks! @benpicco |
Thank you, please squash! |
Done! @benpicco |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR!
Contribution description
With this patch, any custom topology will remain unaltered after run command execution. This also allows random topology generation.
Testing procedure
Create a new custom file topology [filenew.topo] in the folder /tools/zep_dispatch. Then, run:
Then check that filenew.topo remain unaltered.
For random generation, check:
Issues/PRs references
Fixes #18169