rnatm

Load and structure data describing an atmosphere
git clone git://git.meso-star.fr/rnatm.git
Log | Files | Refs | README | LICENSE

commit c4ae42af3f8fdf65a2d9c92b672540826018bf10
parent f12209b962d9bb22c0ed96ccc5af9f7a4c53aed2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 23 Aug 2022 11:56:45 +0200

Remove useless parameters in octree building

Diffstat:
Msrc/rnatm_octree.c | 25+++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/src/rnatm_octree.c b/src/rnatm_octree.c @@ -659,11 +659,7 @@ error: } static res_T -voxelize_atmosphere - (struct rnatm* atm, - /* Range of spectral bands to handle. Limits are inclusives */ - const size_t bands[2], - struct pool* pool) +voxelize_atmosphere(struct rnatm* atm, struct pool* pool) { /* Batch of spectral items to process in a single voxelization */ struct voxelize_batch_args batch_args = VOXELIZE_BATCH_ARGS_NULL; @@ -689,9 +685,7 @@ voxelize_atmosphere size_t i = 0; res_T res = RES_OK; - ASSERT(atm && bands && pool); - ASSERT(bands[0] <= bands[1]); - ASSERT(bands[1] < sck_get_bands_count(atm->gas.ck)); + ASSERT(atm && pool); darray_size_t_list_init(atm->allocator, &per_thread_tetra_list); darray_radcoef_list_init(atm->allocator, &per_thread_radcoef_list); @@ -892,8 +886,6 @@ static res_T build_octrees (struct rnatm* atm, const struct rnatm_create_args* args, - /* Range of spectral bands to handle. Limits are inclusives */ - const size_t bands[2], struct pool* pool) { struct svx_device* svx = NULL; @@ -902,9 +894,7 @@ build_octrees size_t istruct; size_t naccel_structs; ATOMIC res = RES_OK; - ASSERT(atm && args && bands && pool); - ASSERT(bands[0] <= bands[1]); - ASSERT(bands[1] < sck_get_bands_count(atm->gas.ck)); + ASSERT(atm && args && pool); res = svx_device_create(atm->logger, &atm->svx_allocator, atm->verbose, &svx); if(res != RES_OK) goto error; @@ -922,9 +912,8 @@ build_octrees naccel_structs = darray_accel_struct_size_get(&atm->accel_structs); - /* Build the octrees. Each thread consumes an element of a partition. We - * therefore set the number of threads to the width of a voxel of the - * partition */ + /* Build the octrees. Each thread consumes an element of a partition. So, we + * set the number of threads to the voxel width */ omp_set_num_threads((int)pool_get_voxel_width(pool)); #pragma omp parallel for schedule(static, 1/*chunk size*/) for(istruct = 0; istruct < naccel_structs; ++istruct) { @@ -1038,7 +1027,7 @@ create_octrees(struct rnatm* atm, const struct rnatm_create_args* args) { #pragma omp section { - const res_T res_local = voxelize_atmosphere(atm, bands, pool); + const res_T res_local = voxelize_atmosphere(atm, pool); if(res_local != RES_OK) { log_err(atm, "error when voxelizing the atmopshere -- %s\n", res_to_cstr((res_T)res)); @@ -1049,7 +1038,7 @@ create_octrees(struct rnatm* atm, const struct rnatm_create_args* args) #pragma omp section { - const res_T res_local = build_octrees(atm, args, bands, pool); + const res_T res_local = build_octrees(atm, args, pool); if(res_local != RES_OK) { log_err(atm, "error building octrees -- %s\n", res_to_cstr((res_T)res)); pool_invalidate(pool);