Skip to content
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

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

RocioRojas
Copy link

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:

make run TOPOLOGY= filenew.topo

Then check that filenew.topo remain unaltered.

For random generation, check:

make run

Issues/PRs references

Fixes #18169

@github-actions github-actions bot added the Area: tools Area: Supplementary tools label Jun 4, 2022
Copy link
Contributor

@benpicco benpicco left a 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!

@benpicco
Copy link
Contributor

benpicco commented Jun 6, 2022

Ah ok, now I see what's the problem: You want the .svg but with a custom topology, but topogen.sh will always create both the topology file and the .svg.

Then how about moving the 'only create file if it doesn't exist' logic to topogen.sh

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.

@benpicco
Copy link
Contributor

benpicco commented Jun 6, 2022

You can now also get rid of toposvg.sh as it's no longer used.

@RocioRojas
Copy link
Author

It's done. thanks! @benpicco

@benpicco
Copy link
Contributor

benpicco commented Jun 7, 2022

Thank you, please squash!
(You can do git rebase -i HEAD~4, then select fixup for all but the first commit)

@RocioRojas
Copy link
Author

Done! @benpicco

Copy link
Contributor

@benpicco benpicco left a 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!

@benpicco benpicco enabled auto-merge June 7, 2022 23:24
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Jun 7, 2022
@benpicco benpicco merged commit e7ac109 into RIOT-OS:master Jun 8, 2022
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tools/zep_dispatch: Run dispatch with custom topology
3 participants