Comments (4)
There is renewed interest. In the link above, 2 methods are described: 1) Threadpool, 2) Parallel.For. I tried the Parallel.For because it is easy to add around the MonteCarloSimulation.cs for loop that loops over each photon.
I first tried on a linux 18 core, 2 threads per core machine. Without any code modifications N=1e6 photons took 1/2 hour to run. This machine utilizes the threads on its own and typically I see 8-12 threads being used during a simulation. With the code fix the code took 1.7 hours! Not sure why. I thought possibly the threading management was conflicting with the parallelized code somehow.
So I tried the same on a linux computer with 4 cores, no threads. Without the code fix N=1e6 took about an hour. With the code fix, the code compiles but the many unit tests fail.
The Threadpool requires a larger code modification. I will look into this method and continue searching for other options.
from vts.
Based on your last comment, it sounds like we can close this Item. As you discovered, I think the Task Parallel Library (TPL) probably isn't a great fit for "per-photon" parallelization, which is best suited for parallelizing "large" jobs. Seeking this level of performance from parallelization likely requires some significant work. Have we done any profiling of our code to identify the bottlenecks? Wonder if the biggest item is the RNG? Or the double-precision cosine calculations? Or perhaps the heap- and allocation-happy simulation structure? Lots to think about and explore!
from vts.
Yes, Lisa helping me with this task and we now have a command line option to run in parallel. Here is our current documentation:
https://github.com/VirtualPhotonics/Vts.MonteCarlo/wiki/MCCL-Parallel-Processing
from vts.
Neat! Thanks for sharing the link.
from vts.
Related Issues (20)
- CI/CD - Github Actions to build Vts.sln and run Vts.Library.sln Tests upon PR submission
- Fix the SonarCloud issues in IForwardSover HOT 4
- Add ability to angle SurfaceFiberDetector
- Fix the 5 SonarCloud Bugs
- Fix bugs, security issues and maintenance issues in MCCL and MCPP
- Fix the bug in EllipsoidTissueRegion
- Reconfigure the detectors to use global code for the Binary Serializers HOT 65
- Fix the cognitive complexity issues from the Sonar Cloud analysis HOT 5
- Bug in 2 of the Detectors TransmittedMTOfXAndYAndSubregionHistDetector and ReflectedMTOfXAndYAndSubregionHistDetector HOT 2
- Preparation for the November release
- Vts Code and Scripting changes in preparation for Polyglot notebooks
- Add ability to use layered concentric infinite cylinders with refractive index mismatch HOT 2
- Move the FemModeling and MGRTE into a separate repository HOT 2
- Non-flat layered tissues for MCCL HOT 31
- Replace Moq with NSubstitute
- Add resiliency to CustomBinaryStreamWriterOfT HOT 1
- SDA forward solvers need check on optical properties to make sure solution is valid HOT 4
- .NET Polyglot Notebook and Jupyter Notebook samples HOT 17
- RangeOfT enhancements for simplicity to consumers HOT 8
- Publish static web hosted documentation to Github Pages
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 vts.