Added no of thread to config file

The thread count would me minimum of (no of cores in the machine) or (parameter mentioned in config file)
This commit is contained in:
Sakthivel Velumani
2020-11-24 15:07:07 +01:00
parent f55a4dd8e0
commit 80ea03931c
4 changed files with 11 additions and 4 deletions
+5 -4
View File
@@ -870,12 +870,13 @@ void init_gNB_proc(int inst) {
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
int numCPU = sysconf(_SC_NPROCESSORS_ONLN);
int threadCnt = min(numCPU, get_uldeocde_thread_count());
char ul_pool[80];
sprintf(ul_pool,"%d",1);
sprintf(ul_pool,"-1");
int s_offset = 0;
for (int icpu=2; icpu<numCPU; icpu++) {
sprintf(ul_pool+1+s_offset,",%d",icpu);
s_offset += 2;
for (int icpu=2; icpu<threadCnt; icpu++) {
sprintf(ul_pool+2+s_offset,",-1");
s_offset += 3;
}
initTpool(ul_pool, gNB->threadPool, false);
initNotifiedFIFO(gNB->respDecode);
+4
View File
@@ -39,4 +39,8 @@ static inline WORKER_CONF_t get_thread_worker_conf(void) {
return thread_struct.worker_conf;
}
static inline uint8_t get_uldeocde_thread_count(void) {
return thread_struct.numULProcThreads;
}
#endif
+1
View File
@@ -891,6 +891,7 @@ typedef enum {
typedef struct THREAD_STRUCT_s {
PARALLEL_CONF_t parallel_conf;
WORKER_CONF_t worker_conf;
uint8_t numULProcThreads;
} THREAD_STRUCT;
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
@@ -260,6 +260,7 @@ THREAD_STRUCT = (
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
numULProcThreads = 8;
}
);