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_point_comps(catsource_t *temp_cropped_src)

Sets all values associated with a SHAPELET component in temp_cropped_src to NULL.

When splitting up a sky model into chunks, and we know there are no SHAPELET components, set everything in temp_cropped_src that refers to a SHAPELET source component to a NULL or zero to ensure no SHAPELET sources are simulated

Parameters

*temp_cropped_src[in] Pointer to a catsource_t struct

void null_gauss_comps(catsource_t *temp_cropped_src)

Sets all values associated with a SHAPELET component in temp_cropped_src to NULL.

When splitting up a sky model into chunks, and we know there are no SHAPELET components, set everything in temp_cropped_src that refers to a SHAPELET source component to a NULL or zero to ensure no SHAPELET sources are simulated

Parameters

*temp_cropped_src[in] Pointer to a catsource_t struct

void null_shapelet_comps(catsource_t *temp_cropped_src)

Sets all values associated with a SHAPELET component in temp_cropped_src to NULL.

When splitting up a sky model into chunks, and we know there are no SHAPELET components, set everything in temp_cropped_src that refers to a SHAPELET source component to a NULL or zero to ensure no SHAPELET sources are simulated

Parameters

*temp_cropped_src[in] pointer to a catsource_t struct

void increment_point(catsource_t *temp_cropped_src, catsource_t *cropped_src, int *point_iter, int num_time_steps)

When chunking the sky model in cropped_src, use point_iter to stick the correct parts of POINT components cropped_src into temp_cropped_src

Given the larger sky model cropped_src and the index point_iter, use pointer arithmatic to update the POINT 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 catsource_t struct to contain the ‘chunked’ sky model

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

  • *point_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 increment_gauss(catsource_t *temp_cropped_src, catsource_t *cropped_src, int *gauss_iter, int num_time_steps)

When chunking the sky model in cropped_src, use gauss_iter to stick the correct parts of GAUSS components cropped_src into temp_cropped_src

Given the larger sky model cropped_src and the index gauss_iter, use pointer arithmatic to update the GAUSS 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 catsource_t struct to contain the ‘chunked’ sky model

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

  • *gauss_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 increment_shapelet(catsource_t *temp_cropped_src, catsource_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 catsource_t struct to contain the ‘chunked’ sky model

  • *cropped_src[in] Pointer to a catsource_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_pointgauss(catsource_t *temp_cropped_src, catsource_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 catsource_t struct to contain the ‘chunked’ sky model

  • *cropped_src[in] Pointer to a catsource_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 fill_chunk_src_with_shapelets(catsource_t *temp_cropped_src, catsource_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 catsource_t struct to contain the ‘chunked’ sky model

  • *cropped_src[in] Pointer to a catsource_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(catsource_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->catsources.

This is basically a wrapper around fill_chunk_src_with_pointgauss and fill_chunk_src_with_shapelets

Parameters
  • *cropped_src[in] Pointer to a catsource_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.