Skip to content

Commit

Permalink
improved max batch threads for PGC strips
Browse files Browse the repository at this point in the history
  • Loading branch information
elidwa committed Aug 13, 2024
1 parent 8066d43 commit af48f63
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/geo/RasterObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ uint32_t RasterObject::getMaxBatchThreads(void)
/* Maximum number of batch threads.
* Each batch thread creates multiple raster reading threads.
*/
return 16;
return MAX_BATCH_THREADS;
}

/*----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/RasterObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class RasterObject: public LuaObject
/*--------------------------------------------------------------------
* Constants
*--------------------------------------------------------------------*/

static const int MAX_BATCH_THREADS = 16;
static const char* OBJECT_TYPE;
static const char* LUA_META_NAME;
static const struct luaL_Reg LUA_META_TABLE[];
Expand Down
21 changes: 17 additions & 4 deletions plugins/pgc/plugin/PgcDemStripsRaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,24 @@ void PgcDemStripsRaster::getIndexFile(const OGRGeometry* geo, std::string& file)
uint32_t PgcDemStripsRaster::getMaxBatchThreads(void)
{
/*
* The average number of strips for a point is between 10 to 20.
* There are areas where the number of strips can be over 100.
* Limit the number of batch threads to 1.
* Typically, the average number of strips for a point ranges between 10 to 20,
* but in some areas, the number can exceed 100. To avoid overwhelming the system
* in these high-density areas we limit the number of batch threads to 1
* .
*/
return 1;
uint32_t numThreads = 1;

/*
* If we are filtering by closest time or using POI time, we only process
* the data strip raster and the quality mask raster. In this scenario,
* we allow the default number of threads to maximize performance.
*/
if(parms->filter_closest_time || parms->use_poi_time)
{
numThreads = MAX_BATCH_THREADS;
}

return numThreads;
}

/*----------------------------------------------------------------------------
Expand Down

0 comments on commit af48f63

Please sign in to comment.