--
--
http://groups.google.com/group/cloudy-dev
---
You received this message because you are subscribed to the Google Groups "cloudy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudy-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/707b0948-22b7-b893-c97b-c1c5bc6941ed%40gmail.com.
Hi Robin,
Wouldn't it simpler to store 'cumulative_factor' instead? That would make having the main flux array be an array of two arrays redundant -- we might as well be computing the cumulative flux etc on the fly.
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxcEfkXAYwaHUFB_HLarmh6GApnv-u34eeCA0YXTURLftA%40mail.gmail.com.
I take that back. That would require saving the radiation flux for each iteration separately.
-m
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/91adbe10-3c81-73a0-82ab-58b051dadcb3%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudy-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/34997061-7209-9e2c-08cb-cde49764e9c3%40nublado.org.
Hi,
Attached please find the patch that Peter described. It promotes to double all rfield arrays involved in the code excerpt I showed in the first e-mail, and accounts for casts, and arithmetic with floats.
The test suite passes clean. Plots of relative and absolute differences in execution time for all sims against the pristine head of the trunk are attached. Differences appear to have a slight bend toward longer execution times with the patch, but there a lot of sims that actually ran faster. Grains simulations do not seem to suffer systematically from these changes. Review of the attached data file may convince you of that.
Please let me know if the patch looks OK to commit.
Thanks,
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAOxTjFRT4Y1o51A%3D6CxtRMQ9FXH%3Dyw6LoeccgZP9nHEcmBB5UQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/868298aa-dee9-bf0a-43e8-d6c75e25fdc5%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxd3VrPxuGev8pL%2BSUyBe8s8V50h-xYKyrr%2BDLU%3Dn%3Dk%3Dmg%40mail.gmail.com.
Hi Robin,
The shorter execution times surprised me as well.
I'm not sure what the best way to test your first two conjectures is, but here are a few observations from the two runs. I've looked only at sims that had differences greater than 10 sec for these.
Of the sims that ran longer with the patch, none took more
iterations to converge, and only one or two required one
additional zone (out of 300 or so). These appear to be consistent
with needing longer time to run because they involve twice as much
data, but not by much: after all, only a few vectors were
modified.
Of those that ran faster, the outlier is auto/blr_n13_p18_Z20.in by a speed-up of 30 sec (out of ~960). Both sims took the same number of iterations (6), but the patched code required fewer zones to converge: 725 vs 739. This seems consistent with your suggestion for improved accuracy leading to faster convergence.
I will profile both examples tomorrow, and I'll let you know if I
find anything interesting.
In terms of your third point, I ran the tests locally on nephos -- I think they're secure. I could rerun them on cloud9, as well, if you think that's advisable. Or I could consider the median of three runs for each of them for the comparison. But I think the profiling might be more instructive.
Thanks for the thoughtful input,
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxd3VrPxuGev8pL%2BSUyBe8s8V50h-xYKyrr%2BDLU%3Dn%3Dk%3Dmg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudy-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/75d09fe6-0bf4-e6fd-648c-b3dca9f11842%40gmail.com.
Hi Robin,
As I mentioned, there is a sim that appears to exhibit the
behavior you described in your first point.
Concerning the second point, I don't think it would be necessary to test things at that level of detail. Although I did not mention it in the previous e-mail, I did check how much time was spent on each of the functions the patch touches on, and for all sims, with and without the patch, those numbers were a very small fraction of the total and/or the patch's impact was minimal. This indicates that the conversion cost should be minimal.
For the record, the compute time (not wallclock time) of the test
suite increased by 144 seconds with the patch.
Thanks,
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxd7nMN%2BDF_a7OSnhEFkmKSzK0p6dAMJQj5WvzZiK7MWWQ%40mail.gmail.com.
Hi Robin,
This is not YAGNI, actually -- I should start working on RT soon.
I've looked into double-precision GPUs -- they exist but they are slower relative to 32-bit processing by about a dex.
https://www.gamersnexus.net/hwreviews/2518-nvidia-gtx-1060-review-and-benchmark-vs-rx-480?showall=1
https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#arithmetic-instructions
Even in 64-bit, that'd give us about ~200 GFLOPs, comparable to a 6-core i7. The flux array operations need not be carried out on the GPU, though.
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxdNGQDz-s1Xi3QvQRS12Q6UbYm-bzZczbz7CU8DLYq_Vg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/8b3ec08b-b851-4fb7-b9cc-f673a7ce1e67%40gmail.com.
Hi Robin,
Thinking more about this, it would be a shame to risk reducing our GPU throughput by a factor of 32 for such little gain.
I went back and implemented your original suggestion for
rescaling the cumulative continua, see attached patch. It
produces the same output as the double precision patch, and the
test suite runs clean with it.
This seems to be the safer path forward.
Let me know what you think.
Thanks,
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/ba23ee0b-c613-1921-439e-a8b4919e0377%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxd89w8KiOdar6tzYM70t-1%3DH6-CEWcdhRYDdH%2BWMhJeyg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAOxTjFQ25GmzsEYww%2BwB_JE%3Dq7%3DaZCishG%2BXKrGKMHNkzSJQ8w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxfvYBa7pW2_pqpeMwPmnF8YTYMc0wY8ZuDcx3fE21KoXw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAOxTjFTJZJ68wX8D5gjzyFX%3D3he%2Bamm2aY83ezRDqWWPUavyWw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxfdzw9%2Bk2P2wtg0eXajYG18M-GBKpGxCSrg1XvYFN%3DvMw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAOxTjFQdbWKy%3DVzpCfmXcSDQsV2DJb%2BcaPH_4tNRyzZN2x7nZQ%40mail.gmail.com.
Hi Robin,
Here's another patch, implementing your suggestion. It defines a
new class, called Spectrum, which has the scale_cumulative code as
a method (accumulate_flux). Vectors of the t_rfield structure are
now Spectrum objects. The class overloads the [] operator to
maintain existing calls to the data structures. Some other
supporting functionality has been added.
Let me know what you think.
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxd89w8KiOdar6tzYM70t-1%3DH6-CEWcdhRYDdH%2BWMhJeyg%40mail.gmail.com.
Clicked send too soon... Attached please find the patch.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxd89w8KiOdar6tzYM70t-1%3DH6-CEWcdhRYDdH%2BWMhJeyg%40mail.gmail.com.
Hi Robin,
I'm not sure that would work.The cumulative factor may also
involve the mass, so that'd have to be factored in. But I don't
think we'd gain anything. We'd just make the code more complex.
Marios
PS: Your code snippet requires a division by n...
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxenWz%3DAp-GMgPH3nyCtMjDbzA07_5jv_WdUQR0UNz6bag%40mail.gmail.com.
I forgot to mention that the test suite passes clean with the patch. Also, for a cooling simulation including the CMB, it produces the same output as "patch #2", sent a few days ago.
Thanks,
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/b9aadeef-8dbd-b22d-85e3-e250dd3f052f%40gmail.com.
Hi Robin,
I see what you mean. I was able to reproduce your equation, and implemented it in the attached patch.
As it stands, the time-averaged flux is computed over the entire spectrum. I could imagine a command that let the user specify a wavelength range over which to compute it. But that'd go beyond the scope of this patch, and should probably be developed and committed after this one is committed.
Thanks,
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxdFHLjZTqTWAG2otCkOnYKfJvOPXbXR78eU0EftM%3DsSqg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/701b9472-c48e-6f38-cbd9-ed12d69ec2ee%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAJBtPxcm61WKDepBRrTNzBvwGHw-npDNJ8SGDMT3DsmhBWu3hA%40mail.gmail.com.
Hello All,
Now that the migration to the new nublado.org is almost complete, I'd like to commit this patch (reattached) to the newdyna branch. Please let me know if you have any comments, concerns, or objections.
Thanks,
Marios
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/34ba783e-e3b3-4af7-b402-75d45fcc4ae8n%40googlegroups.com.
Yes, it was. We have agreed not to commit significant changes to
master.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudy-dev/CAOxTjFSGN94zrEZ%3DQpBm7R9cafNEV7A-7tZC3rioC24iP-F67w%40mail.gmail.com.