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 *src to NULL, depending on which type is given in component_type.

When splitting up a sky model into chunks, often pass around a source_t struct 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_t struct

  • component_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, use iter to stick the correct parts of either POINT or GAUSSIAN components from cropped_src into temp_cropped_src

Given the larger sky model cropped_src and the index iter, use pointer arithmatic to update the POINT/GAUSSIAN component related attributes in temp_cropped_src to point to the correct chunk of cropped_src. Choose which component type using component_type. Also need num_time_steps to correctly index the az/za coords as az/za change per time.

Parameters
  • *temp_cropped_src[inout] Pointer to a source_t struct to contain the ‘chunked’ sky model

  • *cropped_src[in] Pointer to a source_t struct that contains the full sky model

  • component_type[in] Either POINT or GAUSSIAN

  • *iter[in] Pointer to integer to correctly index the information in cropped_src and point to in temp_cropped_src

  • num_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_src into num_chunks smaller sky models each of size chunking_size, fill the chunked sky model temp_cropped_src at index chunk_ind with the correct number of POINT and GAUSSIAN component settings.

Here we are splitting the sky model cropped_src into num_chunks smaller sky models, each containing a number (comps_per_chunk) of components. This function returns a single ‘chunked’ sky model in temp_cropped_src, which when iterating through the total number of POINT and GAUSSIAN components in chunks of size comps_per_chunk, corresponds to the chunked model at index chunk_ind.

Parameters
  • *temp_cropped_src[inout] Pointer to a source_t struct to contain the ‘chunked’ sky model

  • *cropped_src[in] Pointer to a source_t struct that contains the full sky model

  • chunk_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_t containing 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, use shape_iter to stick the correct parts of SHAPELET components cropped_src into temp_cropped_src

Given the larger sky model cropped_src and the index shape_iter, use pointer arithmatic to update the SHAPELET component related attributes in temp_cropped_src to point to the correct chunk of cropped_src. Also need num_time_steps to correctly index the az/za coords as az/za change per time

Parameters
  • *temp_cropped_src[inout] Pointer to a source_t struct to contain the ‘chunked’ sky model

  • *cropped_src[in] Pointer to a source_t struct that contains the full sky model

  • *shape_iter[in] Pointer to integer to correctly index the information in cropped_src and point to in temp_cropped_src

  • num_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_src into num_chunks smaller sky models each of size chunking_size, fill the chunked sky model temp_cropped_src at index chunk_ind with 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 size comps_per_chunk, corresponds to the chunked model at index chunk_ind.

Parameters
  • *temp_cropped_src[inout] Pointer to a source_t struct to contain the ‘chunked’ sky model

  • *cropped_src[in] Pointer to a source_t struct that contains the full sky model

  • chunk_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_t containing 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_src and splits it into bitesize pieces to fit on the GPU. Returns the models inside a source_catalogue_t struct, with the models stored in source_catalogue_t->sources.

This is basically a wrapper around fill_chunk_src_with_pointgauss and fill_chunk_src_with_shapelets

Parameters
  • *cropped_src[in] Pointer to a source_t struct that contains the full

  • *woden_settings[in] A populated woden_settings_t containing the simulation settings, including the chunking size

Returns

source_catalogue_t A struct containing the chunked sky models that can be fed into calculate_visibilities::calculate_visibilities.