-
Notifications
You must be signed in to change notification settings - Fork 7
Graph network based tutorial addition #189
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
base: master
Are you sure you want to change the base?
Conversation
Robadob
left a comment
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.
This is quite a thorough example of graph API, not sure if it would be better placed a well documented example model (we've been mulling restructuring the examples somehow) or on it's own tutorial page (e.g. advanced-tutorial/tutorial2 etc).
A few notes on what I expect will be feedback when reviewed by the whole team.
python
This is a pure C++ tutorial, all recent tutorials/guides have been either Python first or C++ & Python, as it's assumed that's where most the audience now is (albeit the limitations of Python).
We'd probably port all the code to Python once finished, so it can be duplicated like the above tutorial.
timenow
You're using raw C++ time and file IO, to enable you to do some manual logging. My feeling is we probably want to build that into the FLAMEGPU API if it's important enough of a use-case to be in a tutorial.
We do have a logging API, which you're using, is there a limitation within it that you're working around?
environment properties
It's interesting your use of environment properties, to configure the visualisation rather than the model itself. That's not something I think we've considered (I personally rarely use input state files).
This begins with an initialisation routine that will only run in the first modelling timestep. This is here rather than in an initialisation function as it requires access to the graph data which is only available in device functions
device/agent init has long been something I've wanted to add (FLAMEGPU/FLAMEGPU2#329)
|
Hi Rob, Thanks for this - I'll come back about these points in a few days as I'm away just now. To address the point about something that taxes the GPU more I've been working on a much larger network (~560 nodes, ~100 links) and getting some errors such as:
It runs for a while then crashes, but it's not repeatable how soon it crashes. The numbers it shows do not correspond to the graph size, it seems it randomly loses some of the vertices and then fails. It happens whether or not there are any train agents simulated or drawn. I recompiled with rc3 today but the error remains. It got worse when I used I've reproduced it on two different computers with different GPUs. GPU memory was only about 35% used, and GPU utilisation 30%. I will likely need your help to get to the bottom of this as part of completing the tutorial. |
|
If you can email me the larger network, I'll try and find time to debug it in the next week. |
|
Finally got through the GitHub outage. You can find the PR here: FLAMEGPU/FLAMEGPU2#1350 You should be able to test it locally by reconfiguring CMake with If CMake isn't happy with changing branch, you may need to try it in a clean build directory and pass that upfront with the rest of the config args. |
|
Using |
…n vertex_id and vertex_index
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
I've made some updates to the Graph Tutorial - currently I've left it on the same page as the Circles Tutorial, but it could easily be moved to a separate Advanced Tutorial page of something like that. Python - yes, this needs doing and the tab structure is there so it can be easily inserted. But I'm not a Python expert, so I'll need some help on this. timenow - I've realised some of this was duplicating functions already present as part of the logging. I was writing the start and end time to screen but have removed that code now. I was going to remove the timenow code completely but giving unique filenames to the log files is very useful to prevent accidental overwrites and to easily identify the files. So I've left that part in. Environment properties - yes, this and other models I've developed make extensive use of reading configurations from XML config files. In this tutorial it's just configuring the visualisation and that's quite simple. Not relevant to this tutorial, but if you want to use the XML config file to set up aspects of the agents or messaging that's harder as the config file information is not available until reading the file is triggered by |
Possibly something to discuss with Paul. I previously drafted a means of mutating the spatial messaging configuration via the HostAPI that a PhD student was after. However, I believe Paul wasn't keen on this functionality as it could be misused in a manner harmful to performance. There's definitely room for a compromise solution somewhere. |

Updated existing index.rst tutorial file to add a new tutorial for a graph based network example.
Currently this focuses in methods but doesn't tax the GPU very much at all. Maybe something needs adding to show the capabilities with more agents (e.g. dynamically generate a larger network - currently not thought out how to do this).
Although this is a draft pull request some feedback would be useful at this stage.