Comments (8)
-
Sounds worth a go. I think this could be possible without changing the high-level API. Not that I am against changing the API, just that any performance gains that complicate the API might not be worth it.
-
I guess I was going for the "It is typical for such functions to also return the modified array for convenience" guidance at https://docs.julialang.org/en/v1/manual/style-guide/#bang-convention-1, but this is loose guidance and I forgot to change the other shortcut returns. It is probably more intuitive to return
nothing
here as you suggest.
I just gave you write access to the repo so feel free to work on a branch, obviously PR things for review before merging to master though.
from molly.jl.
In this case I'll just go with Tuple{Int, Int}[]
for everything and if we need more we can change it in the future.
from molly.jl.
Some more ideas would be to cache neighbors and accelerations. This could potentially have a bigger impact than the above.
- Store neighbors in the
Simulation
object. This would could help reducing allocations by using a pre-allocated cache for neighbors in the simulation object. - Store a cache for accelerations in the
Simulation
object
from molly.jl.
Yes, sounds worth a go.
I used to have the neighbours as part of the Simulation
object, I might not have been doing it in the right way to re-use memory though.
from molly.jl.
@jgreener64 Regarding neighbors is it safe to assume that all NeighbourFinder
return a Tuple{Int, Int}[]
?
I was not sure if the cache should be the same for all NeighbourFinder
s (and in the respective structs) or in the Simulation
object directly and the same for everyone.
from molly.jl.
Tuple{Int, Int}[]
was what I went for as a simple scheme for recording pairs, though I've only implemented the distance neighbour finder so far so I don't know what works best in general.
For now I think we can assume that all NeighbourFinder
s return a Tuple{Int, Int}[]
if that's helpful to you, though I don't have very strong feelings on it and am open to better schemes. Currently the requirements seem to be that you can index into it to get something containing i
and j
. A variety of structures would work with this so one option is to have it as another type parameter, depending on whether this allows you to cache effectively.
from molly.jl.
I noticed that even when I optimize a single acceleration function call to be faster than the one in NBodySimulator
, the full simulation is still 2x slower. I think that adapting for the DiffEq time-stepping could give significant performance gains.
The main idea would be to replace simulate!
with an appropriate solve
call. This would mean that things such as finding neighbors and thermostats will be implemented as DiscreteCallback
s.
I think that the construction of the DiffEq problem can also be handled in ParticleAccelerations.
from molly.jl.
Yeah that would be good.
from molly.jl.
Related Issues (20)
- Molly needs a logo! HOT 4
- testing failure with CellListMap v0.8.3 HOT 4
- Incompatibility of types -> bug HOT 2
- Symbol missing error when running documentation code HOT 1
- Molly Feature Parity List HOT 1
- System constructor cannot be found? HOT 3
- Automatic conversion to terminal N-terminal hydrogens HOT 4
- Precompilation error due to zygote.jl HOT 4
- Unit conversion for general interactions HOT 5
- key "HB1" not found in forcefield HOT 1
- Links in Docs are broken HOT 2
- Boltzmann Constant in LAMMPS 'real' units does not work HOT 5
- AtomsBase not properly implemented HOT 4
- GPU error with custom pairwise interactions HOT 5
- Inconsistent Units Crash Simulation HOT 5
- apply_coupling! method is not found for custom coupling function HOT 2
- Example for new MC membrane barostat HOT 12
- Dead link in force.jl HOT 1
- Broken links in docs HOT 2
- `Mie` interaction gives `InexactError` due to the `convert` in constructor HOT 1
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 molly.jl.