DISPATCH
Modules List
Here is a list of all documented modules with brief descriptions:
[detail level 12]
 Namr_io_modModule handling convenient AMR I/O. We wish to have a file format that makes it easy to read when restarting jobs, and which makes it easy to read with Python. We can rely on the existing mechanism to write patch metadata in the form of file run/snapno/rank_rankno_patches.nml with namelist data for each patch. This may be replaced later with a file written with mpi_buffer_mod
 Naux_modModule with which one can register any number of pointers to real or integer arrays, and then output the contents of the links later
 Nbits_mod
 Nboundaries_modBoundary conditions for centered variables, which have the physical boundary in-between mesh points lo and li, or/and in-between mesh points ui and uo
 Nbuffered_io_mod
 Nconnect_modModule holding anonymous pointers back to extras features
 Nconstants
 Ncounters_modHelp keep track of when all patches have passed some counter, by decrementing a counter, from start to 0. Typical use:
 Ndata_hub_modA communications hub between patches. Three methods are used: download_same, download_higher and download_lower
 Ndata_io_modInterface from gpatch_mod to a choice of binary data I/O methods, controlled by the iomethod text string – optionally (but deprecated) by iodo_legacy or iodo_direct
 Ndirect_io_mod
 Ndispatch
 Ndispatcher0_modDispatcher method that relies on all threads maintaining a "ready queue", with tasks ready for updating. Each thread picks the task at the head of the queue, and checks all nbors for tasks that are ready, putting them back in the queue
 Ndispatcher2_modA simple task dispatcher, which handles a list of tasks that may be started as background OpenMP tasks. A task can be in any of 4 states:
 Ndispatcher3_modExecute a task list. Since only the master thread is calling check_mpi(), we need to make sure that it handles all send/recv, hence send_priv=.false. and recv_priv=.false., and we can use the simplest receive mechanism (recv_active =.true.), with no buffering needed (queue_unpack=.false.). These values are imposed after the input namelists are read, to make sure the choices are correct
 Ndispatcher4_modExecute a task list. Since only the master thread is calling check_mpi(), we need to make sure that it handles all send/recv, hence send_priv=.false. and recv_priv=.false., and we can use the simplest receive mechanism (recv_active =.true.), with no buffering needed (queue_unpack=.false.). These values are imposed after the input namelists are read, to make sure the choices are correct
 Ndispatcher5_modDispatcher method that relies on all threads maintaining a "ready queue", with tasks ready for updating. Each thread picks the task at the head of the queue, and checks all nbors for tasks that are ready, putting them back in the queue
 Ndispatcher6_modDispatcher method that relies on all threads maintaining a "ready queue", with tasks ready for updating. Each thread picks the task at the head of the queue, and checks all nbors for tasks that are ready, putting them back in the queue. The method is similar to method5, except the state of each task is given by the value of task_tstate, rather than by status bits in task_tstatus, and locks are used to protect on the one hand the ready queue, and on the other hand each individual task
 Ndispatcher_modDo not use a dispatcher, but call task_listexecute, which relies on threads handling a ready queue
 Ndll_modDoubly linked list (DLL), carrying anything, as simply as possible
 Ndownload_modDownload_link: takes care of downloads to linktask same: called for patches on the same level differ: called for patches on different levels
 Neos_modEquation of state module for any sort of tables, provided by a reader
 Nextras_modTemplate version of a module intended for adding extra features, at a level between the basic task and patch layer, and the layer of solvers
 Nf90nml
 Nforce_modSimple forcing module for tests
 Nforces_modThis is a bare minimum interface to the new extras module, showing how to interface with a pre-existing force_modselected() function
 Nglobal_modData type for computing global average, while using only nearest node nbor communication
 Ngpatch_modThe gpath_t layer now essentially only handles restarts
 Ngravity_modAdd gravity to any solver
 Nguard_zones_modOptimized restrict operations, intended for guard zones (not conservative)
 Nh5_modModule interface to the HDF5 library
 Nhash_table_modHash table module for the use inside DISPATCH
 Nhd_modRAMSES Godunov solvers
 Nimage
 Nindex_modThis index file has slot indices for all solver, all initially equal to zero It is the responsibility of the solver to set all values it needs to use. NOTE: The only reference to indices in tasks should be via taskidx, never to a temporary instance of index_t
 Ninitial_modSimple initical condition module for tests
 Nio_mod
 Nio_unit_mod
 Nlagrange_modModule for Lagrange interpolation
 Nlink_modModule with list handling for generic class task_t objects
 Nlist_modModule with list handling for generic class task_t objects
 Nload_balance_modKeep track of neighbor ranks and their loads, by sending and receiving short messages, storing the info in a linked list
 Nmath_modFundamental constants in CGS and SI units
 Nmesh_modTemplate module for mesh
 Nmhd_modRAMSES Godunov solvers, use of guard zones; specifically in HLLD
 Nmpi_comm_modSimple module for sending / receiving packages to / from other ranks
 Nmpi_coords_mod
 Nmpi_file_modModule for handling blocking and non-blocking MPI parallel I/O to a single file
 Nmpi_global_modSimple MPI global array data type
 Nmpi_io_modModule for handling blocking and non-blocking MPI parallel I/O to a single file. The module is initialized by specifying the chunk size (which can be 1- or 3-dimensional). A chunk could be just a patch, or a single chunk of data per rank
 Nmpi_mesg_mod
 Nmpi_mod
 Nnbor_list_modData type to keep and maintain information on MPI processes. The process data type maintains a list of nbor MPI ranks, which is used to send and recv
 Nnewton_modAdd Newton cooling to any solver
 Nnon_ideal_modNon-ideal MHD module
 Nomp_lock_modThe lock module uses nested locks, to allow versatile use of locks, where a procedure may want to make sure to lock a data type, even though it may (or may not) already have been locked by another procedure in the calling hierarchy
 Nomp_timer_modSupport tic/toc timing, as in MATLAB, and accurate wallclock() function. The timing is generally much more accurate if this module is compiled with OMP active
 Nparallel_io_modUse MPI parallel I/O to write everything to a single file. No critical regions should be needed here; all thread protection is done inside mpi_file_mod and mpi_io_mod
 Nparticle_list_modParticle list, extending a doubly-linked list. Each particle maintains arrays with previous positions, velocities, and times, which are brought along if/when it changes owner patch or rank. The memory footprint of a particle is 12 words for position, 12 words for velocity, and 8 words for time, all together 32 words = 128 bytes (plus a few words for id and weight). This could be reduced to half, by keeping only two previous positions and velocities in the data type
 Nparticle_modParticle data type, extends a dll_node data type, so it can become part of a particle_list_t data type
 Nparticle_solver_modKick-Drift-Kick (KDK) N-body solver
 Npatch_modTemplate module for patches, which adds pointers to memory and mesh, and number of dimensions and variables. The number of dimensions is hardwired to 3, since we can just choose the actual dimensions to get 2-D and 1-D
 Npdf_io_modModule to periodically output a density probability density function (PDF). The procedure assumes that 'out_time' is larger than the largest time step
 Npoisson_modMethods for solving the Poisson equation; partially derived from routines developed by Troels Haugbølle for the course Computational Astrophysics
 Nprocess_modData type to keep and maintain information on MPI processes
 Nrandom_mod
 Nread_snapshot_modIC module for reading in legacy Stagger snapshots into existing patches
 Nrefine_modThis module handles checking max change between neighboring points. Each instance of it needs an index to the variable, whether to take the log, and a value for the max allowed change. It might be applied to log density, log pressure, log opacity, velocity amplitude, magnetic field amplitude, etc
 Nremesh_modThis module handles remeshing, eg from lower resolution to higher resolution, with special attention to maximizing speed, by identifying cases where cells are aligned (static meshes). FIXME: initially assumed to always be the case
 Nrt_integral_modGiven a direction Omega, which may align mainly with the x-. y-, or z-axis, solve the integral form of the RT on short characteristics, extending across only three layers perpendicular to the main direction
 Nrt_modModule to set up angles and bins for an RT patch with only absorption. This means that the only extra memory with time slot that is needed is one slot for the net radiation heating, Q_bin_angle
 Nrt_nbors_modModule to add nbor lists for RT sub-tasks, and modify the parent MHD tasks
 Nrt_solver_modThis data type is used only to present a common name for all RT solvers
 Nscalar_mod
 Nscaling_modDefine code units, in terms of (here) CGS units
 Nscene_modThis module is a placeholder for scene information, solving the problem of making a piece of information available btw any two points in the code, without having to worry about module dependency. Since this module does not depend on anything else, we can put shared information here
 Nselfgravity_modAdd selfgravity to any solver
 Nshared_modThis module is a placeholder for shared information, solving the problem of making a piece of information available btw any two points in the code, without having to worry about module dependency. Since this module does not depend on anything else, we can put shared information here
 Nsink_patch_modA sink particle is represented as primarily a particle task, whose position is updated with a particle solver. The patch is usually much smaller than an MHD patch, and its values are downloaded from contributing MHD patches
 Nsolver_modThis module contains all experiment specific information necessary to solve the heat diffusion problem in DISPATCH
 Nstagger_16
 Nstagger_20
 Nstagger_24
 Nstagger_28
 Nstagger_32
 Nstagger_36
 Nstagger_mod6th order stagger operators, with self-test procedure
 Nstagger_utils
 Ntask_list_modTask list data type, with methods for startup and updates. Message handling is inherited from the task_mesg_t data type. At this level, task handling is aware of experiment_t data types, and all data types it has inheritet from
 Ntask_mesg_modMessage handling for task lists. Some of the methods are only used by dispatcher0_t, so should perhaps be moved over to that file
 Ntask_modTemplate module for tasks
 Ntime_slices_modCompute time derivative from a sequence of time slices, using Lagrange interpolation
 Ntimer_modEach thread uses a private timer data type, with arrays for start time and total time for each registered procedure. At begin, it stores the start time, and at end it increments the call counter and sums the time used into the total counter
 Ntimestep_mod
 Ntrace_mod
 Ntrace_particles_modTrace particle module. Two classes of trace particles will be supported (this is not yet fully implemented):
 Nunits_modFundamental constants in CGS and SI units
 Nvalidate_modGeneric validation module. The general idea is to be able to compare two runs at critical points in the sequence of evaluation, by having the first run write to files, which the 2nd job reads from, and then compare the contents
 Nvector_mod
 Nvector_ops