Comments (7)
"The computation will also take into account if the sites are correlated or not, reading the GROUND_MOTION_CORRELATION parameter specified in the configuration file."
I think it's better to say "The computation will also take into account if the user wants to compute correlated or uncorrelated ground motion fields, by reading the GROUND_MOTION_CORRELATION parameter specified in the configuration file"
from oq-engine.
Andrea: quick note re. parallelization: with the utils.tasks.distribute() component no extra effort is needed to do that.
You basically just need to pay attention to a parameter as shown in the branch you are currently reviewing (https://github.com/gem/openquake/pull/111)
from oq-engine.
In this case we must pass to the calculator all the sites defined inside the region. Is it possible to use utils.tasks.distribute() to spawn N tasks but passing always the same input parameters?
from oq-engine.
I see, that's a (much) simpler use case (which is a good thing!). I will probably write a separate function (utils.tasks.parallelize() ?) that caters to it.
from oq-engine.
Andrea: when you spawn N tasks passing the same parameters to all of them: how is the calculation by these tasks carried out differently? Do they read additional data from the KVS and vary based on that?
from oq-engine.
The component that we have to call (wrapper through jpype) is org.gem.calc.GroundMotionFieldCalculator. The object is created only once, passing the whole region, an attenuation relationship and an earthquake rupture. What we call N times, and we would like to spawn N tasks for that is the getUncorrelatedGroundMotionField (or getCorrelatedGroundMotionField_JB2009, depending on the configuration file) method. That method takes a random number generator as input, that provides the variability between the N calls.
from oq-engine.
On 04/07/2011 11:11 AM, acerisara wrote:
The component that we have to call (wrapper through jpype) is
org.gem.calc.GroundMotionFieldCalculator.
The object is created only once, passing the whole region, an
attenuation relationship and an earthquake rupture. What we call N
times, and we would like to spawn N tasks for that is the
getUncorrelatedGroundMotionField (or
getCorrelatedGroundMotionField_JB2009, depending on the configuration
file) method.
That method takes a random number generator as input,
Hello Andrea,
I had an interesting conversation with Damiano on this topic and I will
try to summarise it here.
Your statements above are all good as long as we are in a single celeryd
situation since that celeryd will load its jvm shared library via jpype
and all the celery tasks that run on it and share the same
GroundMotionFieldCalculator instance.
Things become more interesting when we have 2+ celery daemons :-) since
each of the latter has its own jvm and GroundMotionFieldCalculator instance.
Furthermore, all calculator instances have their own random number
generator (RNG) that's seeded with the same value.
If celeryd1 runs celery-task-1 and celeryd2 runs celery-task-2 then
things will break since both tasks will be executed with the same random
values (due to 2 calculators using their own random number generators
seeded with the same value).
One solution suggested by Damiano is for each celery task to take the
RNG seed as well as a sequence number
@task
def the_task(rng_seed, task_sequence_number, ..):
and then seed the RNG with (rng_seed * task_sequence_number).
That would preclude overlapping random value sequences in case of tasks
running on 2+ celery daemons but still give us some predictability.
Please let mw know what you think.
Best regards/Mit freundlichen Grüßen
Muharem Hrnjadovic [email protected]
from oq-engine.
Related Issues (20)
- Station data observed values are retained in GMF values in calc datastore.
- Anaconda, Python=3.11.8 Openquake 3.19 Installation Error HOT 1
- Adding new CAV and AI models HOT 3
- multifaultsource sanity check breaks fault section prefix HOT 2
- Should we replace round with numpy.round? HOT 1
- Check invalid branchIDs
- get_convex_hull failing when getting polygons of some mosaic sources
- AAL Statistics output for classical_risk/case_2 not exportable
- NGAEastUSGSGMPE not working outside of unit tests HOT 3
- Fixing warnings in the documentation
- when a required site parameter is not provided, OQ is running full calculation but giving NAN results HOT 2
- Raise error for missing `residents` at the beginning of the calculation
- Stations still appear to be plotted in Avg GMF
- Implementation of post-loss amplification (PLA) HOT 3
- Document `oq show delta_loss`
- Add check in job.ini for scenario calculations
- Investigations for conditioned scenarios (needed for the Aristotle project)
- individual_rlzs is not honored with --hc HOT 1
- Add an early check for mixed sources
- Think about OQ_APPLICATION_MODE
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 oq-engine.