Commit 80ea0393 authored by Sakthivel Velumani's avatar Sakthivel Velumani

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)
parent f55a4dd8
......@@ -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);
......
......@@ -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
......@@ -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;
}
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment