Skip to content
Snippets Groups Projects
Commit 99651709 authored by dansa828's avatar dansa828
Browse files

measurements

parent 983f478d
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ done ...@@ -7,7 +7,7 @@ done
make clean make clean
for i in {1..8} for i in {1..8}
do do
make NB_THREADS=$i MEASURE=2 NON_BLOCKING=1 make NB_THREADS=$i MEASURE=1 NON_BLOCKING=0
./stack ./stack
make clean make clean
done done
......
...@@ -5,7 +5,7 @@ NB_THREADS=3 ...@@ -5,7 +5,7 @@ NB_THREADS=3
NON_BLOCKING=0 NON_BLOCKING=0
SUFFIX= SUFFIX=
MEASURE=0 MEASURE=0
MAX_PUSH_POP=5000 MAX_PUSH_POP=100000
OUT=stack$(SUFFIX) OUT=stack$(SUFFIX)
DEBUG=0 DEBUG=0
......
0.002493
0.012611
0.009709
0.012847
0.013490
0.016285
0.017171
0.017415
0.002621
0.009616
0.008025
0.011671
0.011819
0.013610
0.014294
0.015276
0.001729
0.007576
0.016461
0.017137
0.020568
0.022439
0.023629
0.025120
0.002048
0.008631
0.009847
0.011102
0.011544
0.011367
0.011537
0.012339
0.002501
0.013199
0.009462
0.013956
0.013280
0.016288
0.017189
0.016427
...@@ -428,13 +428,23 @@ setbuf(stdout, NULL); ...@@ -428,13 +428,23 @@ setbuf(stdout, NULL);
pthread_join(thread[i], NULL); pthread_join(thread[i], NULL);
} }
clock_gettime(CLOCK_MONOTONIC, &stop); clock_gettime(CLOCK_MONOTONIC, &stop);
float maxtime = 0;
// Print out results // Print out results
for (i = 0; i < NB_THREADS; i++) for (i = 0; i < NB_THREADS; i++)
{ {
printf("Thread %d time: %f\n", i, timediff(&t_start[i], &t_stop[i])); printf("Thread %d time: %f\n", i, timediff(&t_start[i], &t_stop[i]));
if(timediff(&t_start[i], &t_stop[i])> maxtime)
{
maxtime = timediff(&t_start[i], &t_stop[i]);
}
} }
stack_check(stack); stack_check(stack);
FILE* fp;
fp = fopen("measureNB1M2.txt", "a+");
//fprintf(fp, "%s%i\n", "THREADS: ",NB_THREADS);
fprintf(fp, "%f\n", maxtime);
fclose(fp);
// Deallocate memory // Deallocate memory
test_teardown(); test_teardown();
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment