[yt-dev] Fwd: [Sunrise] Sunrise v4.0 release!

Matthew Turk matthewturk at gmail.com
Wed May 9 11:01:16 PDT 2012

This might be of interest to people here.  Congratulations to Patrik
and the other developers!  This is a very impressive accomplishment.

---------- Forwarded message ----------
From: Patrik Jonsson <sunrise at familjenjonsson.org>
Date: Wed, May 9, 2012 at 1:56 PM
Subject: [Sunrise] Sunrise v4.0 release!
To: sunrisemcrx at googlegroups.com

Hi Sunrise users,

I'm pleased to announce the release of the long-in-the-making Sunrise v4.0!

This new version includes many updates, and a paper describing them is
in the works. (However, it will likely be a while until this paper is
done, for reasons that will become obvious below.) Special thanks
should go to Chris Moody and Greg Snyder, who have done a lot of work
testing the new versions and finding bugs. You can get the version now
by using the tag "v4_00" in the Mercurial repository.

One of the most exciting ones is the support for distributed-memory
machines using MPI. This means that you no longer will have to go
hunting for machines with extremely large memory to run Sunrise on
large simulations. (However, the overhead for running MPI is quite
high, so it is not useful for speeding up small calculations.) See the
"Using MPI" Wiki page (http://code.google.com/p/sunrise/wiki/UsingMPI)
for more information. The MPI functionality works but has not been
extensively tested, so you are likely to run into bugs. Please report
any issues that arise.

A prerequisite for getting the MPI version to work was to redo the way
the adaptive mesh works. The grid is now a pure octree, meaning it
always starts with one root cell that is then recursively subdivided
into octants. Before, the root grid was a cartesian grid of arbitrary
size, but that is no longer supported. (This was necessary to get the
Hilbert ordering of the cells used for domain decomposition working
efficiently.) This new grid is also more efficient than the old

The calculation of infrared emission has also been redone. When
finding the equilibrium dust temperatures/radiation fields, it now
uses the "immediate reemission" method described in Fleck & Cummings
(1971) and Lucy (1999). This exactly preserves the energy balance when
grains absorb/reemit photons, and discretizes only the temperature
field (not the radiation intensity) on the grid when iterating, which
should give better accuracy at a given grid resolution.

Finally, instead of MC sampling the emission distribution in the cells
when making images of dust emission, the direct emission is now
calculated by explicitly integrating the RTE along the line of sight.
This results in nose-free images. The scattered light is still done
with MC, but at the wavelengths where the dust emission dominates, the
albedo is essentially zero anyway so this doesn't make much
difference. The integration is adaptive in the sense that the size of
the cells encountered are monitored, and if the cells are smaller than
the solid angle subtended by the ray, the ray is subdivided (similar
to what Abel & Wandelt 99 did, but for incoming rays as opposed to
outgoing ones).

Furthermore, an explicit monitoring of Monte Carlo error in the
iteration, which adjusts the number of rays to achieve the specified
accuracy, has been included. The previous method of testing
convergence did not guarantee an accurate temperature field, only that
the overall energy balance was within a certain limit. The new method
monitors the error in determining the temperature of each individual
cell. The flipside is that if you ask for a high accuracy, you'd
better be prepared to wait a *long* time. The full force of the
sqrt(N) Monte Carlo convergence rate will hit you.

The polychromatic ray tracing algorithm has been upgraded with an
automatic determination of reference wavelength and forced scattering
positions to avoid large bias factors in situations with high optical
depths. Instead of splitting rays that have been boosted to high
intensities after the fact, it avoids large bias factors in the first
place by forcing several scatterings along the line of propagation.
This lowers the noise caused by the large bias factors and avoids the
guesswork in setting the reference wavelength and forced scattering

There are also many efficiency tweaks that have sped up the
calculation. (However, the most important factor affecting runtime, by
far, is the dust equilibrium accuracy required.)  The code is capable
of processing snapshots from Gadget, Gasoline, Arepo, and, using YT to
export files, from Enzo and ART. If you are interested in the YT
functionality, contact Matt Turk and he can point you in the right
direction. I don't know anything about how the YT export works.

Finally, Sunrise now handles kinematics, meaning that it can take into
account the effect of velocity and Doppler shift of sources and
scatterers. However, for this to work you need a SED library with
logarithmic wavelength spacing (and for it to be useful, quite high
resolution). A high-resolution set of Starburst99 and MAPPINGS files
have been uploaded to the Downloads section of the Sunrise web site.
Note that with such high spectral resolution, maintaining high spatial
resolution comes at the cost of *very* large memory use and output
file size. It's best to cut out a small wavelength range around the
features you are interested in. (And don't even think of calculating
dust emission with that wavelength resolution...)

For those of you who are interested in knowing more about what's
happening inside the galaxy, there are also now options to save the
dust emission SEDs and the dust temperatures to the output file.

All these changes naturally means that parameter keywords have
changed. I'll post another message containing example configurations,
but I encourage you to carefully read through the Wiki pages
describing the keywords to get an idea of the changes. As usual, you
have to take responsibility for verifying that the results make sense,
so don't just take the example files without actually verifying that
things work correctly in your particular situation. The library
requirements have also changed, so review the compilation instructions
and be sure to update your copy of libPJutil from the repo at

The other big update is that I will no longer be working primarily on
Sunrise. Next week, I'm moving to a position as software engineer at
SpaceX in LA, working on simulation software for rockets! :-)  I will
still have my research grant for the next few years, but I'm unlikely
to have much time to work on astrophysics. Chris Hayward, who has
worked a lot with Sunrise, has graciously accepted taking over as the
primary maintainer of the code. However, everyone will have to help
Chris by pitching in with tracking down bugs you find, and with
providing improvements. You are still welcome to email me with
questions, but I should probably not be the first choice as my ping
time is likely to be very long.

I hope that all the effort I've put into Sunrise over the years will
continue to be built on so Sunrise will remain the premier tool in
galaxy SED prediction!

Happy Monte-Carloing,


You received this message because you are subscribed to the Google
Groups "Sunrise" group.
To post to this group, send email to sunrisemcrx at googlegroups.com.
To unsubscribe from this group, send email to
sunrisemcrx+unsubscribe at googlegroups.com.
For more options, visit this group at

More information about the yt-dev mailing list