chunk_sky_model¶
Functions to take a WODEN sky model and break it up (chunk) into a number of smaller sky models, to distribute the processing across the GPU.
Functions
-
void null_components(source_t *src, e_component_type component_type)¶
Sets all values associated with either the POINT, GAUSSIAN, or SHAPELET components in
source_t *srcto NULL, depending on which type is given incomponent_type.When splitting up a sky model into chunks, often pass around a
source_tstruct to do the splitting up, so good to have a function that ensures certain fields are set to NULL and avoid copying incorrect parts of a model- Parameters
*src – [in] Pointer to a
source_tstructcomponent_type – [in] Can be either POINT, GAUSSIAN, or SHAPELET
-
void increment_pointgauss(source_t *temp_cropped_src, source_t *cropped_src, e_component_type component_type, int *iter, int num_time_steps)¶
When chunking the sky model in
cropped_src, useiterto stick the correct parts of either POINT or GAUSSIAN components fromcropped_srcintotemp_cropped_srcGiven the larger sky model
cropped_srcand the indexiter, use pointer arithmatic to update the POINT/GAUSSIAN component related attributes intemp_cropped_srcto point to the correct chunk ofcropped_src. Choose which component type usingcomponent_type. Also neednum_time_stepsto correctly index the az/za coords as az/za change per time.- Parameters
*temp_cropped_src – [inout] Pointer to a
source_tstruct to contain the ‘chunked’ sky model*cropped_src – [in] Pointer to a
source_tstruct that contains the full sky modelcomponent_type – [in] Either POINT or GAUSSIAN
*iter – [in] Pointer to integer to correctly index the information in
cropped_srcand point to intemp_cropped_srcnum_time_steps – [in] Number of time steps in the simulation
-
void fill_chunk_src_with_pointgauss(source_t *temp_cropped_src, source_t *cropped_src, int chunk_ind, int comps_per_chunk, woden_settings_t *woden_settings)¶
When splitting the sky model
cropped_srcintonum_chunkssmaller sky models each of sizechunking_size, fill the chunked sky modeltemp_cropped_srcat indexchunk_indwith the correct number of POINT and GAUSSIAN component settings.Here we are splitting the sky model
cropped_srcintonum_chunkssmaller sky models, each containing a number (comps_per_chunk) of components. This function returns a single ‘chunked’ sky model intemp_cropped_src, which when iterating through the total number of POINT and GAUSSIAN components in chunks of sizecomps_per_chunk, corresponds to the chunked model at indexchunk_ind.- Parameters
*temp_cropped_src – [inout] Pointer to a
source_tstruct to contain the ‘chunked’ sky model*cropped_src – [in] Pointer to a
source_tstruct that contains the full sky modelchunk_ind – [in] The index of the chunked sky model to be returned
comps_per_chunk – [in] Number of components to put in each chunk
*woden_settings – [in] A populated
woden_settings_tcontaining the simulation setting
-
void increment_shapelet(source_t *temp_cropped_src, source_t *cropped_src, int *shape_iter, int num_time_steps)¶
When chunking the sky model in
cropped_src, useshape_iterto stick the correct parts of SHAPELET componentscropped_srcintotemp_cropped_srcGiven the larger sky model
cropped_srcand the indexshape_iter, use pointer arithmatic to update the SHAPELET component related attributes intemp_cropped_srcto point to the correct chunk ofcropped_src. Also neednum_time_stepsto correctly index the az/za coords as az/za change per time- Parameters
*temp_cropped_src – [inout] Pointer to a
source_tstruct to contain the ‘chunked’ sky model*cropped_src – [in] Pointer to a
source_tstruct that contains the full sky model*shape_iter – [in] Pointer to integer to correctly index the information in
cropped_srcand point to intemp_cropped_srcnum_time_steps – [in] Number of time steps in the simulation
-
void fill_chunk_src_with_shapelets(source_t *temp_cropped_src, source_t *cropped_src, int chunk_ind, int coeffs_per_chunk, woden_settings_t *woden_settings)¶
When splitting the sky model
cropped_srcintonum_chunkssmaller sky models each of sizechunking_size, fill the chunked sky modeltemp_cropped_srcat indexchunk_indwith the correct number of SHAPELET component settings.When splitting the sky model up, we split SHAPELET components separately to POINT and GAUSSIANs as the besis functions take up more GPU memory - this can butt heads with primary beam calculations that also take up memory for POINT and GAUSSIANs. This function returns a single ‘chunked’ sky model in
temp_cropped_src, which when iterating through the total number of SHAPELET basis functions in chunks of sizecomps_per_chunk, corresponds to the chunked model at indexchunk_ind.- Parameters
*temp_cropped_src – [inout] Pointer to a
source_tstruct to contain the ‘chunked’ sky model*cropped_src – [in] Pointer to a
source_tstruct that contains the full sky modelchunk_ind – [in] The index of the chunked sky model to be returned
coeffs_per_chunk – [in] Number of basis function params to put in each chunk
*woden_settings – [in] A populated
woden_settings_tcontaining the simulation setting
-
source_catalogue_t *create_chunked_sky_models(source_t *cropped_src, woden_settings_t *woden_settings)¶
Takes the sky model in
cropped_srcand splits it into bitesize pieces to fit on the GPU. Returns the models inside asource_catalogue_tstruct, with the models stored insource_catalogue_t->sources.This is basically a wrapper around
fill_chunk_src_with_pointgaussandfill_chunk_src_with_shapelets- Parameters
*cropped_src – [in] Pointer to a
source_tstruct that contains the full*woden_settings – [in] A populated
woden_settings_tcontaining the simulation settings, including the chunking size
- Returns
source_catalogue_tA struct containing the chunked sky models that can be fed intocalculate_visibilities::calculate_visibilities.