Commit 5fcaf29f authored by mir's avatar mir

TASK_MANAGER_CODING flag removed

parent 75c652d4
......@@ -595,7 +595,7 @@ void completed_task_ans(task_ans_t* task)
//
void join_task_ans(task_ans_t* arr, size_t len)
{
//assert(len > 0);
assert(len < INT_MAX);
assert(arr != NULL);
// We are believing Fedor
......
#ifndef TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_CODING
#define TASK_MANAGER_RU
#define TASK_MANAGER_UE_DECODING
......
......@@ -64,9 +64,7 @@ typedef struct {
unsigned int G;
// Redundancy version index
uint8_t rv;
#ifdef TASK_MANAGER_CODING
task_ans_t* ans;
#endif
} encoder_implemparams_t;
typedef int32_t(LDPC_initfunc_t)(void);
......
......@@ -259,9 +259,8 @@ static void ldpc8blocks(void *p)
r_offset += E;
}
#ifdef TASK_MANAGER_CODING
// Task running in // completed
completed_task_ans(impp->ans);
#endif
}
int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
......@@ -388,50 +387,23 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
r_offset += impp.E;
}
} else {
notifiedFIFO_t nf = {0};
initNotifiedFIFO(&nf);
int nbJobs = 0;
#ifdef TASK_MANAGER_CODING
size_t const sz = (impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1));
encoder_implemparams_t arr[sz];
task_ans_t ans[sz];
memset(ans, 0, sz * sizeof(task_ans_t));
#endif
for (int j = 0; j < (impp.n_segments / 8 + ((impp.n_segments & 7) == 0 ? 0 : 1)); j++) {
#ifdef TASK_MANAGER_CODING
assert(nbJobs < sz);
encoder_implemparams_t* perJobImpp = &arr[nbJobs];
#else
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(impp), j, &nf, ldpc8blocks);
encoder_implemparams_t *perJobImpp = (encoder_implemparams_t *)NotifiedFifoData(req);
#endif
size_t const n_seg = (impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1));
encoder_implemparams_t arr[n_seg];
task_ans_t ans[n_seg];
memset(ans, 0, n_seg * sizeof(task_ans_t));
for (int j = 0; j < n_seg; j++) {
encoder_implemparams_t* perJobImpp = &arr[j];
*perJobImpp = impp;
perJobImpp->macro_num = j;
perJobImpp->ans = &ans[j];
#ifdef TASK_MANAGER_CODING
perJobImpp->ans = &ans[nbJobs];
task_t t = {.args = perJobImpp, .func = ldpc8blocks};
task_t t = {.func = ldpc8blocks, .args = perJobImpp};
async_task_manager(&gNB->man, t);
#else
pushTpool(&gNB->threadPool, req);
#endif
nbJobs++;
}
#ifdef TASK_MANAGER_CODING
if(nbJobs > 0) {
join_task_ans(ans, nbJobs);
}
#else
while (nbJobs) {
notifiedFIFO_elt_t *req = pullNotifiedFIFO(&nf);
if (req == NULL)
break; // Tpool has been stopped
delNotifiedFIFO_elt(req);
nbJobs--;
}
#endif
join_task_ans(ans, n_seg);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
return 0;
......
......@@ -729,7 +729,7 @@ typedef struct PHY_VARS_gNB_s {
void *scopeData;
/// structure for analyzing high-level RT measurements
rt_L1_profiling_t rt_L1_profiling;
#if defined(TASK_MANAGER_CODING) || defined(TASK_MANAGER_RU) || defined(TASK_MANAGER_SIM)
#if defined(TASK_MANAGER_RU) || defined(TASK_MANAGER_SIM)
task_manager_t man;
task_manager_t man_rx_tx_ru;
#endif
......
......@@ -856,7 +856,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
task_ans_t ans[16] = {0};
thread_info_tm_t t_info = {.buf = (uint8_t*)arr, .len = 0, .ans = ans};
int64_t const t0 = time_now_ns();
//int64_t const t0 = time_now_ns();
int totalDecode = 0;
for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) {
NR_gNB_ULSCH_t *ulsch = &gNB->ulsch[ULSCH_id];
......
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