[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 09/164: Added forking to perf test
From: |
gnunet |
Subject: |
[gnunet] 09/164: Added forking to perf test |
Date: |
Fri, 30 Jul 2021 15:31:15 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 77ce1b1f4b6cbc2b2e93d87c218d103c71658456
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Sat Apr 3 21:07:12 2021 +0200
Added forking to perf test
---
src/setu/gnunet-service-setu.c | 1 -
src/setu/perf_setu_api.c | 38 ++++++++++++++++++--------------------
2 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index e4f2330bb..59a279f07 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -788,7 +788,6 @@ calculate_perf_rtt() {
*/
float factor;
GNUNET_CONFIGURATION_get_value_float(setu_cfg,"IBF",
"BUCKET_NUMBER_FACTOR", &factor);
- return;
long long num_per_bucket;
GNUNET_CONFIGURATION_get_value_number(setu_cfg,"IBF", "NUMBER_PER_BUCKET",
&num_per_bucket);
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c
index 046e46fe7..14a96f782 100644
--- a/src/setu/perf_setu_api.c
+++ b/src/setu/perf_setu_api.c
@@ -407,31 +407,35 @@ run (void *cls,
initRandomSets(450,500,500,32);
}
-void *perf_thread() {
-
- printf("OK\n");
-
+void perf_thread() {
GNUNET_TESTING_service_run("perf_setu_api",
"arm",
"test_setu.conf",
&run,
NULL);
+
}
static void run_petf_thread(int total_runs) {
- int core_count=get_nprocs_conf();
- for(int runs = 0; runs < total_runs; runs += core_count) {
- pthread_t tid[core_count];
+ int core_count = get_nprocs_conf();
+ pid_t child_pid, wpid;
+ int status = 0;
- for (int i = 0; i < core_count; i++) {
- pthread_create(&tid[i], NULL, perf_thread, NULL);
- }
+//Father code (before child processes start)
+ for (int processed = 0; processed < total_runs;) {
+ for (int id = 0; id < core_count; id++) {
- for (int i = 0; i < core_count; i++)
- pthread_join(tid[i], NULL);
- }
+ if(processed >= total_runs) break;
+ if ((child_pid = fork()) == 0) {
+ perf_thread();
+ exit(0);
+ }
+ processed=+1;
+ }
+ while ((wpid = wait(&status)) > 0);
+ }
}
static void execute_perf() {
@@ -481,12 +485,6 @@ main (int argc, char **argv)
GNUNET_log_setup ("perf_setu_api",
"WARNING",
NULL);
-
- GNUNET_TESTING_service_run("perf_setu_api",
- "arm",
- "test_setu.conf",
- &run,
- NULL);
- //execute_perf();
+ execute_perf();
return 0;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] branch master updated (e8eb1ecc0 -> 24bc8b102), gnunet, 2021/07/30
- [gnunet] 06/164: added thread lib to setu perf, gnunet, 2021/07/30
- [gnunet] 07/164: Fixed, gnunet, 2021/07/30
- [gnunet] 08/164: Fixed some stack smashing error ;-), gnunet, 2021/07/30
- [gnunet] 10/164: Fixed bug in perfomance forking, gnunet, 2021/07/30
- [gnunet] 01/164: Working, gnunet, 2021/07/30
- [gnunet] 03/164: Added multitreading, gnunet, 2021/07/30
- [gnunet] 14/164: Increased set difference for test by x10, gnunet, 2021/07/30
- [gnunet] 17/164: Perf test with bytes send/resived per ibf, gnunet, 2021/07/30
- [gnunet] 09/164: Added forking to perf test,
gnunet <=
- [gnunet] 15/164: Perf run to test with bigger element set, gnunet, 2021/07/30
- [gnunet] 33/164: Make 5000 elements perftest for perftest, gnunet, 2021/07/30
- [gnunet] 16/164: Perf run to test with bigger element set smaller set, gnunet, 2021/07/30
- [gnunet] 25/164: Simulation with 10x less elements & Removed some debuging statements, gnunet, 2021/07/30
- [gnunet] 35/164: Add total bytes transmitted to perf, gnunet, 2021/07/30
- [gnunet] 19/164: Run generate missing data, gnunet, 2021/07/30
- [gnunet] 27/164: Fixed fork doubeling, gnunet, 2021/07/30
- [gnunet] 38/164: Test to 5000 elements, gnunet, 2021/07/30
- [gnunet] 32/164: Added test with 2.5, gnunet, 2021/07/30
- [gnunet] 05/164: added thread lib to setu perf, gnunet, 2021/07/30