Alpine3D 20241222.625fd38
OMPControl Namespace Reference

Functions

void getArraySliceParams (const size_t &dimx, const size_t &nbworkers, const size_t &idx_wk, size_t &startx_sub, size_t &nx_sub)
 Returns the parameters for splitting an array in several, balanced sub-arrays. This is mostly usefull for parallel calculations, where an array will be split and sent to different workers. More...
 
void getArraySliceParamsOptim (const size_t &nbworkers, const std::vector< SnowStation * > &snow_station, const mio::DEMObject &dem, const mio::Grid2DObject &landuse, std::vector< std::vector< size_t > > &omp_snow_stations_ind)
 

Function Documentation

◆ getArraySliceParams()

void OMPControl::getArraySliceParams ( const size_t &  dimx,
const size_t &  nbworkers,
const size_t &  idx_wk,
size_t &  startx_sub,
size_t &  nx_sub 
)

Returns the parameters for splitting an array in several, balanced sub-arrays. This is mostly usefull for parallel calculations, where an array will be split and sent to different workers.

Parameters
[in]dimxnumber of cells in the desired dimension
[in]nbworkerstotal number of slices
[in]idx_wkcurrent slice index (starting at 0)
[out]startx_subcalculated start index for the current slice
[out]nx_subcalculated number of cells (in the desired dimension) of the current slice

◆ getArraySliceParamsOptim()

void OMPControl::getArraySliceParamsOptim ( const size_t &  nbworkers,
const std::vector< SnowStation * > &  snow_station,
const mio::DEMObject &  dem,
const mio::Grid2DObject &  landuse,
std::vector< std::vector< size_t > > &  omp_snow_stations_ind 
)