Put CPU affinity control in nr_ulsim.
This commit is contained in:
committed by
Romain Beurdouche
parent
d6ee29a193
commit
c07bfe6db5
@@ -249,7 +249,9 @@ int main(int argc, char *argv[])
|
|||||||
InitSinLUT();
|
InitSinLUT();
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "--:O:a:b:c:d:ef:g:h:i:jk:m:n:p:q:r:s:t:u:v:w:y:z:A:C:F:G:H:I:M:N:PR:S:T:U:L:ZW:E:X:")) != -1) {
|
bool setAffinity=false;
|
||||||
|
char gNBthreads[128]="n";
|
||||||
|
while ((c = getopt(argc, argv, "--:O:a:b:c:d:ef:g:h:i:jk:m:n:p:q:r:s:t:u:v:w:y:z:A:C:F:G:H:I:M:N:PR:S:T:U:L:ZW:E:X:Y:")) != -1) {
|
||||||
/* ignore long options starting with '--', option '-O' and their arguments that are handled by configmodule */
|
/* ignore long options starting with '--', option '-O' and their arguments that are handled by configmodule */
|
||||||
/* with this opstring getopt returns 1 for non-option arguments, refer to 'man 3 getopt' */
|
/* with this opstring getopt returns 1 for non-option arguments, refer to 'man 3 getopt' */
|
||||||
if (c == 1 || c == '-' || c == 'O')
|
if (c == 1 || c == '-' || c == 'O')
|
||||||
@@ -494,6 +496,13 @@ int main(int argc, char *argv[])
|
|||||||
AssertFatal(filename_csv != NULL, "strdup() error: errno %d\n", errno);
|
AssertFatal(filename_csv != NULL, "strdup() error: errno %d\n", errno);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'Y':
|
||||||
|
threadCnt = sizeof(gNBthreads)-1;
|
||||||
|
strncpy(gNBthreads, optarg, threadCnt);
|
||||||
|
gNBthreads[threadCnt]=0;
|
||||||
|
setAffinity=true;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'Z':
|
case 'Z':
|
||||||
transform_precoding = transformPrecoder_enabled;
|
transform_precoding = transformPrecoder_enabled;
|
||||||
num_dmrs_cdm_grps_no_data = 2;
|
num_dmrs_cdm_grps_no_data = 2;
|
||||||
@@ -592,7 +601,11 @@ int main(int argc, char *argv[])
|
|||||||
gNB->RU_list[0] = calloc(1, sizeof(**gNB->RU_list));
|
gNB->RU_list[0] = calloc(1, sizeof(**gNB->RU_list));
|
||||||
gNB->RU_list[0]->rfdevice.openair0_cfg = openair0_cfg;
|
gNB->RU_list[0]->rfdevice.openair0_cfg = openair0_cfg;
|
||||||
|
|
||||||
initFloatingCoresTpool(threadCnt, &gNB->threadPool, false, "gNB-tpool");
|
if (setAffinity == false)
|
||||||
|
initFloatingCoresTpool(threadCnt, &gNB->threadPool, false, "gNB-tpool");
|
||||||
|
else
|
||||||
|
initNamedTpool(gNBthreads, &gNB->threadPool, true, "gNB-tpool");
|
||||||
|
|
||||||
initNotifiedFIFO(&gNB->respDecode);
|
initNotifiedFIFO(&gNB->respDecode);
|
||||||
|
|
||||||
initNotifiedFIFO(&gNB->respPuschSymb);
|
initNotifiedFIFO(&gNB->respPuschSymb);
|
||||||
|
|||||||
Reference in New Issue
Block a user