Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
ca8babd7
Commit
ca8babd7
authored
Jun 26, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/remove-threadpool-makefile' into integration_2024_w26
parents
aa47716a
b1f7cc90
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
165 additions
and
157 deletions
+165
-157
CMakeLists.txt
CMakeLists.txt
+3
-14
common/utils/CMakeLists.txt
common/utils/CMakeLists.txt
+5
-0
common/utils/LOG/CMakeLists.txt
common/utils/LOG/CMakeLists.txt
+10
-0
common/utils/threadPool/CMakeLists.txt
common/utils/threadPool/CMakeLists.txt
+6
-0
common/utils/threadPool/Makefile
common/utils/threadPool/Makefile
+0
-3
common/utils/threadPool/test/CMakeLists.txt
common/utils/threadPool/test/CMakeLists.txt
+6
-0
common/utils/threadPool/test/test_thread-pool.c
common/utils/threadPool/test/test_thread-pool.c
+133
-0
common/utils/threadPool/thread-pool.c
common/utils/threadPool/thread-pool.c
+0
-129
executables/lte-enb.c
executables/lte-enb.c
+0
-1
executables/lte-softmodem.c
executables/lte-softmodem.c
+1
-1
executables/lte-ue.c
executables/lte-ue.c
+0
-1
executables/lte-uesoftmodem.c
executables/lte-uesoftmodem.c
+1
-1
executables/nr-gnb.c
executables/nr-gnb.c
+0
-1
openair2/UTIL/ALG_DS/CMakeLists.txt
openair2/UTIL/ALG_DS/CMakeLists.txt
+0
-2
openair2/UTIL/ALG_DS/README.md
openair2/UTIL/ALG_DS/README.md
+0
-2
openair2/UTIL/CMakeLists.txt
openair2/UTIL/CMakeLists.txt
+0
-2
No files found.
CMakeLists.txt
View file @
ca8babd7
...
...
@@ -634,20 +634,11 @@ add_library(HASHTABLE
include_directories
(
${
OPENAIR_DIR
}
/common/utils/hashtable
)
add_library
(
UTIL
${
OPENAIR_DIR
}
/common/utils/LOG/log.c
${
OPENAIR_DIR
}
/common/utils/LOG/vcd_signal_dumper.c
${
OPENAIR2_DIR
}
/UTIL/MATH/oml.c
${
OPENAIR2_DIR
}
/UTIL/OPT/probe.c
${
OPENAIR_DIR
}
/common/utils/threadPool/thread-pool.c
${
OPENAIR_DIR
}
/common/utils/utils.c
${
OPENAIR_DIR
}
/common/utils/system.c
${
OPENAIR_DIR
}
/common/utils/time_meas.c
${
OPENAIR_DIR
}
/common/utils/time_stat.c
)
if
(
ENABLE_LTTNG
)
find_package
(
LTTngUST 2.3.8 EXACT REQUIRED
)
target_sources
(
UTIL PRIVATE common/utils/LOG/lttng-tp.c
)
target_link_libraries
(
UTIL PUBLIC lttng-ust
)
else
()
message
(
STATUS
"LTTNG support disabled"
)
endif
()
...
...
@@ -658,7 +649,7 @@ if (cap_FOUND)
target_link_libraries
(
UTIL PRIVATE cap
)
target_compile_definitions
(
UTIL PRIVATE HAVE_LIB_CAP
)
endif
()
target_link_libraries
(
UTIL PUBLIC
${
T_LIB
}
pthread
)
target_link_libraries
(
UTIL PUBLIC
${
T_LIB
}
pthread
LOG thread-pool utils
)
set
(
SECURITY_SRC
${
OPENAIR3_DIR
}
/SECU/secu_defs.c
...
...
@@ -1191,10 +1182,9 @@ set(PHY_MEX_UE
${
OPENAIR1_DIR
}
/PHY/TOOLS/simde_operations.c
${
OPENAIR1_DIR
}
/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c
${
OPENAIR1_DIR
}
/PHY/LTE_ESTIMATION/lte_ue_measurements.c
${
OPENAIR_DIR
}
/common/utils/LOG/log.c
)
add_library
(
PHY_MEX
${
PHY_MEX_UE
}
)
target_link_libraries
(
PHY_MEX PRIVATE asn1_lte_rrc_hdrs
)
target_link_libraries
(
PHY_MEX PRIVATE asn1_lte_rrc_hdrs
UTIL
)
#Layer 2 library
#####################
...
...
@@ -1933,10 +1923,9 @@ set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODU
# add executables for operation
#################################
add_library
(
minimal_lib
${
OPENAIR_DIR
}
/common/utils/LOG/log.c
${
OPENAIR_DIR
}
/common/utils/minimal_stub.c
)
target_link_libraries
(
minimal_lib
pthread dl
${
T_LIB
}
)
target_link_libraries
(
minimal_lib
PUBLIC pthread dl
${
T_LIB
}
LOG
)
add_executable
(
nfapi_test
${
OPENAIR_DIR
}
/openair2/NR_PHY_INTERFACE/nfapi_5g_test.c
...
...
common/utils/CMakeLists.txt
View file @
ca8babd7
...
...
@@ -11,3 +11,8 @@ endif()
add_subdirectory
(
T
)
add_subdirectory
(
nr
)
add_subdirectory
(
LOG
)
add_subdirectory
(
threadPool
)
add_library
(
utils utils.c system.c time_meas.c time_stat.c
)
target_include_directories
(
utils PUBLIC .
)
target_link_libraries
(
utils PRIVATE
${
T_LIB
}
)
common/utils/LOG/CMakeLists.txt
0 → 100644
View file @
ca8babd7
set
(
log_sources log.c
)
if
(
ENABLE_LTTNG
)
set
(
log_sources
${
log_sources
}
lttng-tp.c
)
endif
()
add_library
(
LOG
${
log_sources
}
)
target_include_directories
(
LOG PUBLIC .
)
target_link_libraries
(
LOG PRIVATE
${
T_LIB
}
)
if
(
ENABLE_LTTNG
)
target_link_libraries
(
LOG PUBLIC lttng-ust
)
endif
()
common/utils/threadPool/CMakeLists.txt
0 → 100644
View file @
ca8babd7
if
(
ENABLE_TESTS
)
add_subdirectory
(
test
)
endif
()
add_library
(
thread-pool thread-pool.c
)
target_link_libraries
(
thread-pool PRIVATE utils
)
target_include_directories
(
thread-pool PUBLIC .
)
common/utils/threadPool/Makefile
deleted
100644 → 0
View file @
aa47716a
thread-pool-test
:
thread-pool.c thread-pool.h
gcc
-g
-O3
thread-pool.c
-I
${OPENAIR_DIR}
/nfapi/open-nFAPI/nfapi/public_inc
-I
${OPENAIR_DIR}
/
-I
${OPENAIR_DIR}
/common/utils/
-I
.
-I
${OPENAIR_DIR}
/openair2/COMMON
${OPENAIR_DIR}
/common/utils/system.c
${OPENAIR_DIR}
/common/utils/LOG/log.c
${OPENAIR_DIR}
/common/config/config_userapi.c
${OPENAIR_DIR}
/common/config/config_load_configmodule.c
${OPENAIR_DIR}
/common/config/config_cmdline.c
-lpthread
-ldl
-D
TEST_THREAD_POOL
-DMAX_NUM_CCs
=
1
-I
../LOG
-I
../../utils/T
-o
thread-pool-test
common/utils/threadPool/test/CMakeLists.txt
0 → 100644
View file @
ca8babd7
add_executable
(
test_thread-pool
test_thread-pool.c
)
add_dependencies
(
tests test_thread-pool
)
target_link_libraries
(
test_thread-pool PRIVATE thread-pool pthread LOG minimal_lib
)
add_test
(
NAME test_thread-pool
COMMAND ./test_thread-pool
)
common/utils/threadPool/test/test_thread-pool.c
0 → 100644
View file @
ca8babd7
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <sched.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/sysinfo.h>
#include <threadPool/thread-pool.h>
#include "log.h"
void
displayList
(
notifiedFIFO_t
*
nf
)
{
int
n
=
0
;
notifiedFIFO_elt_t
*
ptr
=
nf
->
outF
;
while
(
ptr
)
{
printf
(
"element: %d, key: %lu
\n
"
,
++
n
,
ptr
->
key
);
ptr
=
ptr
->
next
;
}
printf
(
"End of list: %d elements
\n
"
,
n
);
}
struct
testData
{
int
id
;
int
sleepTime
;
char
txt
[
30
];
};
void
processing
(
void
*
arg
)
{
struct
testData
*
in
=
(
struct
testData
*
)
arg
;
// printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() );
sprintf
(
in
->
txt
,
"Done by %ld, job %d"
,
pthread_self
(),
in
->
id
);
in
->
sleepTime
=
rand
()
%
1000
;
usleep
(
in
->
sleepTime
);
// printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() );
}
int
main
()
{
logInit
();
notifiedFIFO_t
myFifo
;
initNotifiedFIFO
(
&
myFifo
);
pushNotifiedFIFO
(
&
myFifo
,
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
1234
,
NULL
,
NULL
));
for
(
int
i
=
10
;
i
>
1
;
i
--
)
{
pushNotifiedFIFO
(
&
myFifo
,
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
1000
+
i
,
NULL
,
NULL
));
}
displayList
(
&
myFifo
);
notifiedFIFO_elt_t
*
tmp
=
pullNotifiedFIFO
(
&
myFifo
);
printf
(
"pulled: %lu
\n
"
,
tmp
->
key
);
displayList
(
&
myFifo
);
tmp
=
pullNotifiedFIFO
(
&
myFifo
);
printf
(
"pulled: %lu
\n
"
,
tmp
->
key
);
displayList
(
&
myFifo
);
pushNotifiedFIFO
(
&
myFifo
,
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
12345678
,
NULL
,
NULL
));
displayList
(
&
myFifo
);
do
{
tmp
=
pollNotifiedFIFO
(
&
myFifo
);
if
(
tmp
)
{
printf
(
"pulled: %lu
\n
"
,
tmp
->
key
);
displayList
(
&
myFifo
);
}
else
printf
(
"Empty list
\n
"
);
}
while
(
tmp
);
tpool_t
pool
;
char
params
[]
=
"1,2,3,4,5"
;
initTpool
(
params
,
&
pool
,
true
);
notifiedFIFO_t
worker_back
;
initNotifiedFIFO
(
&
worker_back
);
//sleep(1);
int
cumulProcessTime
=
0
;
struct
timespec
st
,
end
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
st
);
int
nb_jobs
=
4
;
for
(
int
i
=
0
;
i
<
1000
;
i
++
)
{
int
parall
=
nb_jobs
;
for
(
int
j
=
0
;
j
<
parall
;
j
++
)
{
notifiedFIFO_elt_t
*
work
=
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
i
,
&
worker_back
,
processing
);
struct
testData
*
x
=
(
struct
testData
*
)
NotifiedFifoData
(
work
);
x
->
id
=
i
;
pushTpool
(
&
pool
,
work
);
}
int
sleepmax
=
0
;
while
(
parall
)
{
tmp
=
pullTpool
(
&
worker_back
,
&
pool
);
if
(
tmp
)
{
parall
--
;
struct
testData
*
dd
=
NotifiedFifoData
(
tmp
);
if
(
dd
->
sleepTime
>
sleepmax
)
sleepmax
=
dd
->
sleepTime
;
delNotifiedFIFO_elt
(
tmp
);
}
}
cumulProcessTime
+=
sleepmax
;
}
clock_gettime
(
CLOCK_MONOTONIC
,
&
end
);
long
long
dur
=
(
end
.
tv_sec
-
st
.
tv_sec
)
*
1000
*
1000
+
(
end
.
tv_nsec
-
st
.
tv_nsec
)
/
1000
;
printf
(
"In µs, Total time per group of %d job:%lld, work time per job %d, overhead per job %lld
\n
"
,
nb_jobs
,
dur
/
1000
,
cumulProcessTime
/
1000
,
(
dur
-
cumulProcessTime
)
/
(
1000
*
nb_jobs
));
return
0
;
}
common/utils/threadPool/thread-pool.c
View file @
ca8babd7
...
...
@@ -33,17 +33,6 @@
#include <sys/sysinfo.h>
#include <threadPool/thread-pool.h>
void
displayList
(
notifiedFIFO_t
*
nf
)
{
int
n
=
0
;
notifiedFIFO_elt_t
*
ptr
=
nf
->
outF
;
while
(
ptr
)
{
printf
(
"element: %d, key: %lu
\n
"
,
++
n
,
ptr
->
key
);
ptr
=
ptr
->
next
;
}
printf
(
"End of list: %d elements
\n
"
,
n
);
}
static
inline
notifiedFIFO_elt_t
*
pullNotifiedFifoRemember
(
notifiedFIFO_t
*
nf
,
struct
one_thread
*
thr
)
{
mutexlock
(
nf
->
lockF
);
...
...
@@ -176,121 +165,3 @@ void initFloatingCoresTpool(int nbThreads,tpool_t *pool, bool performanceMeas, c
threads
[
sizeof
(
threads
)
-
1
]
=
0
;
initNamedTpool
(
threads
,
pool
,
performanceMeas
,
name
);
}
#ifdef TEST_THREAD_POOL
int
oai_exit
=
0
;
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
,
const
int
assert
)
{
if
(
assert
)
{
abort
();
}
else
{
exit
(
EXIT_SUCCESS
);
}
}
struct
testData
{
int
id
;
int
sleepTime
;
char
txt
[
30
];
};
void
processing
(
void
*
arg
)
{
struct
testData
*
in
=
(
struct
testData
*
)
arg
;
//printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() );
sprintf
(
in
->
txt
,
"Done by %ld, job %d"
,
pthread_self
(),
in
->
id
);
in
->
sleepTime
=
rand
()
%
1000
;
usleep
(
in
->
sleepTime
);
//printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() );
}
int
main
()
{
notifiedFIFO_t
myFifo
;
initNotifiedFIFO
(
&
myFifo
);
pushNotifiedFIFO
(
&
myFifo
,
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
1234
,
NULL
,
NULL
));
for
(
int
i
=
10
;
i
>
1
;
i
--
)
{
pushNotifiedFIFO
(
&
myFifo
,
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
1000
+
i
,
NULL
,
NULL
));
}
displayList
(
&
myFifo
);
notifiedFIFO_elt_t
*
tmp
=
pullNotifiedFIFO
(
&
myFifo
);
printf
(
"pulled: %lu
\n
"
,
tmp
->
key
);
displayList
(
&
myFifo
);
tmp
=
pullNotifiedFIFO
(
&
myFifo
);
printf
(
"pulled: %lu
\n
"
,
tmp
->
key
);
displayList
(
&
myFifo
);
pushNotifiedFIFO
(
&
myFifo
,
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
12345678
,
NULL
,
NULL
));
displayList
(
&
myFifo
);
do
{
tmp
=
pollNotifiedFIFO
(
&
myFifo
);
if
(
tmp
)
{
printf
(
"pulled: %lu
\n
"
,
tmp
->
key
);
displayList
(
&
myFifo
);
}
else
printf
(
"Empty list
\n
"
);
}
while
(
tmp
);
tpool_t
pool
;
char
params
[]
=
"1,2,3,4,5"
;
initTpool
(
params
,
&
pool
,
true
);
notifiedFIFO_t
worker_back
;
initNotifiedFIFO
(
&
worker_back
);
sleep
(
1
);
int
cumulProcessTime
=
0
,
cumulTime
=
0
;
struct
timespec
st
,
end
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
st
);
int
nb_jobs
=
4
;
for
(
int
i
=
0
;
i
<
1000
;
i
++
)
{
int
parall
=
nb_jobs
;
for
(
int
j
=
0
;
j
<
parall
;
j
++
)
{
notifiedFIFO_elt_t
*
work
=
newNotifiedFIFO_elt
(
sizeof
(
struct
testData
),
i
,
&
worker_back
,
processing
);
struct
testData
*
x
=
(
struct
testData
*
)
NotifiedFifoData
(
work
);
x
->
id
=
i
;
pushTpool
(
&
pool
,
work
);
}
int
sleepmax
=
0
;
while
(
parall
)
{
tmp
=
pullTpool
(
&
worker_back
,
&
pool
);
if
(
tmp
)
{
parall
--
;
struct
testData
*
dd
=
NotifiedFifoData
(
tmp
);
if
(
dd
->
sleepTime
>
sleepmax
)
sleepmax
=
dd
->
sleepTime
;
delNotifiedFIFO_elt
(
tmp
);
}
}
cumulProcessTime
+=
sleepmax
;
}
clock_gettime
(
CLOCK_MONOTONIC
,
&
end
);
long
long
dur
=
(
end
.
tv_sec
-
st
.
tv_sec
)
*
1000
*
1000
+
(
end
.
tv_nsec
-
st
.
tv_nsec
)
/
1000
;
printf
(
"In µs, Total time per group of %d job:%lld, work time per job %d, overhead per job %lld
\n
"
,
nb_jobs
,
dur
/
1000
,
cumulProcessTime
/
1000
,
(
dur
-
cumulProcessTime
)
/
(
1000
*
nb_jobs
));
/*
for (int i=0; i <1000 ; i++) {
notifiedFIFO_elt_t *work=newNotifiedFIFO_elt(sizeof(struct testData), i, &worker_back, processing);
struct testData *x=(struct testData *)NotifiedFifoData(work);
x->id=i;
pushTpool(&pool, work);
}
do {
tmp=pullTpool(&worker_back,&pool);
if (tmp) {
struct testData *dd=NotifiedFifoData(tmp);
printf("Result: %s\n",dd->txt);
delNotifiedFIFO_elt(tmp);
} else
printf("Empty list \n");
abortTpoolJob(&pool,510);
} while(tmp);
*/
return
0
;
}
#endif
executables/lte-enb.c
View file @
ca8babd7
...
...
@@ -79,7 +79,6 @@
#include "common/utils/LOG/log.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "UTIL/MATH/oml.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "enb_config.h"
...
...
executables/lte-softmodem.c
View file @
ca8babd7
...
...
@@ -69,7 +69,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "common/utils/LOG/log.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "
UTIL/MATH/oml
.h"
#include "
SIMULATION/TOOLS/sim
.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "enb_config.h"
...
...
executables/lte-ue.c
View file @
ca8babd7
...
...
@@ -56,7 +56,6 @@
#include "nfapi/oai_integration/vendor_ext.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "UTIL/MATH/oml.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "lte-softmodem.h"
...
...
executables/lte-uesoftmodem.c
View file @
ca8babd7
...
...
@@ -66,7 +66,7 @@
#include "nfapi/oai_integration/vendor_ext.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "
UTIL/MATH/oml
.h"
#include "
SIMULATION/TOOLS/sim
.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
...
...
executables/nr-gnb.c
View file @
ca8babd7
...
...
@@ -71,7 +71,6 @@
#include "common/utils/LOG/log.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "UTIL/MATH/oml.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "gnb_paramdef.h"
...
...
openair2/UTIL/ALG_DS/CMakeLists.txt
deleted
100644 → 0
View file @
aa47716a
add_subdirectory
(
DS
)
openair2/UTIL/ALG_DS/README.md
deleted
100644 → 0
View file @
aa47716a
Algorithms and Data Structures in C for common usage
openair2/UTIL/CMakeLists.txt
View file @
ca8babd7
add_subdirectory
(
ALG_DS
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment