Comments (6)
Neil is correct that you won't be able to send anything referenced by pointers through an event to another PE, without having someway to handle it.
I think your RNG approach sounds like it's probably the way to go in this case. And I agree with Neil that you'll want multiple RNGs for each LP, with one being dedicated to your usual RNG use, and one for just producing this same sequence of integers on each LP. He's also right that you can use the default ROSS generated seed for one and for the other, use the identical seed on all LPs.
So the basic idea of what you'll want to do in code:
g_tw_nRNG_per_lp++; // default is 1
tw_define_lps(<whatever you usually pass in here>);
for (tw_lpid id = 0; id < g_tw_nlp; id++)
{
// so rng[0] would keep the default ROSS seed
// rng[1] would be the one that is the same on each LP
tw_rand_initial_seed(&g_tw_lp[id]->rng[1], <seed>);
}
And that should be all you need!
from ross.
This alternative worked just fine. Thanks!
from ross.
You are correct, dynamic memory pointers are not dereferenced when they are shared between PEs. You'll have to write your own serializer and deserializers to pack and unpack into a static-memory byte array in the event struct. These have to be made for any dynamic memory in your event structs and said functions will have to be called at every event handler. It's better to entirely avoid dynamic memory in events. @caitlinross might have more insight about this and alternatives.
from ross.
I understand. Assuming that exchanging event messages with a pointer array between LPs in different PEs is not an option, is it possible to enforce that LPs (of the same type) in different PEs produce the same sequence of integers in RNG functions such as tw_rand_integer()?
In case this is possible, I can have the specific LP that returns event messages with pointer array in the same PE as the requester, and my problem would be solved.
from ross.
I think it should be possible to do that. You'll need to utilize multiple RNGs in each LP - as you wouldn't want to force every LP's main RNG to have the same seed.
What I'm imagining is that each LP would have two RNGs, one default one with a ROSS generated seed and one separate RNG with an identical seed as all other LPs used for your workaround. How exactly this would be done is not something I'm very familiar with.
Might consider checking out this page from the wiki on the topic
I'll check with others in the research group tomorrow about this.
from ross.
Happy to hear it!
from ross.
Related Issues (20)
- Build Failing HOT 6
- Can't call ROSS multiple times HOT 2
- Running gvt-7o`clock Algorithm for GVT Computation HOT 2
- Sending - Receiving Messages HOT 4
- Interesting Run Time Results With Mattern`s GVT HOT 2
- Out of event memory fails too quietly HOT 2
- CMake clean up HOT 6
- Memory Allocation HOT 2
- improve testing HOT 5
- CMake Object Library HOT 7
- No file tw-memory.c HOT 2
- Multi threading version HOT 2
- about GVT_force_update HOT 8
- CODES develop integration HOT 2
- RIO event management
- Formalize ROSS API HOT 3
- Out of Free Events Error Handling HOT 3
- Simulation not completing HOT 3
- Issues building any of the stable models HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ross.