summaryrefslogtreecommitdiff
path: root/charf.c
diff options
context:
space:
mode:
Diffstat (limited to 'charf.c')
-rw-r--r--charf.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/charf.c b/charf.c
index 832a8d8..0d11f22 100644
--- a/charf.c
+++ b/charf.c
@@ -351,7 +351,6 @@ void* compute_chunk(void* arguments){
Args* args = arguments;
int i = args -> num_thread;
int* domain_current = args -> domain_current;
- VALUETYPE f[N];
int d = 0;
while(d >= 0){
d = compute(i, args -> exponents, args -> records_ratio, args -> records_index);
@@ -363,10 +362,10 @@ void* compute_chunk(void* arguments){
}
(*(args -> cont))++;
if(*(args -> cont) >= NUM_THREADS) printf("Calculation finished. Press any button to stop.\n");
+ return NULL;
}
int main() {
- int num_exponents[K+1];
EXPTYPE exponents[P];
exponents[0] = int_to_exptype(1);
exponents[1] = infinity_to_exptype();
@@ -377,7 +376,6 @@ int main() {
int records_index[K+1][P];
for(int k=0; k<=K; k++) for(int p=0; p<P; p++) records_ratio[k][p] = int_to_valuetype(0);
int domain_current = 0;
- int result_code;
int cont = 0;
for (int i = 0; i < NUM_THREADS; i++) {
@@ -388,7 +386,7 @@ int main() {
args[i].num_thread = i;
args[i].domain_current = &domain_current;
args[i].cont = &cont;
- result_code = pthread_create(&threads[i], NULL, compute_chunk, args+i);
+ pthread_create(&threads[i], NULL, compute_chunk, args+i);
}
size_t sz = 1024;
@@ -409,7 +407,7 @@ int main() {
// wait for each thread to complete
for (int i = 0; i < NUM_THREADS; i++) {
- result_code = pthread_join(threads[i], NULL);
+ pthread_join(threads[i], NULL);
printf("In main: Thread %d has ended.\n", i);
}