Use COZ_ macros in included benchmarks. Refs #32

This commit is contained in:
Charlie Curtsinger 2015-10-08 20:06:16 -05:00
parent 77d5fcd25a
commit ad54026e00
10 changed files with 21 additions and 24 deletions

View File

@ -126,7 +126,7 @@ void *calc_hist(void *arg) {
val = &(thread_arg->data[i+2]);
red[*val]++;
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
/*
thread_arg->red = red;

View File

@ -203,7 +203,7 @@ void *find_clusters(void *arg)
modified = true;
}
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
return (void *)0;
@ -243,10 +243,7 @@ void *calc_means(void *arg)
{
means[i][j] = sum[j] / grp_size;
}
}
//CAUSAL_PROGRESS;
// WTF: Why does enabling this progress point distort other thread runtimes?
}
}
free(sum);
return (void *)0;

View File

@ -83,7 +83,7 @@ void *linear_regression_pthread(void *args_in)
args->SYY += args->points[i].y*args->points[i].y;
args->SXY += args->points[i].x*args->points[i].y;
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
return (void *)0;

View File

@ -155,7 +155,7 @@ void *matrixmult_map(void *args_in)
//printf("THe location is %d %d, value is %d\n",x_loc, y_loc, value);
data->output[x_loc*data->matrix_len + i] = value;
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
row_count++;
}

View File

@ -546,7 +546,7 @@ ssize_t do_write(int fd, const void *buf, size_t count)
{
bytesRemaining -= nbytes;
pbuf += nbytes;
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
if (nbytes < 0)

View File

@ -147,7 +147,7 @@ void *calc_mean(void *arg) {
sum += matrix[i][j];
}
mean[i] = sum / num_cols;
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
return (void *)0;
@ -178,7 +178,7 @@ void *calc_cov(void *arg) {
i = next_row;
next_row++;
pthread_mutex_unlock(&row_lock);
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
return (void *)0;

View File

@ -53,7 +53,7 @@ void* consumer(void* arg) {
consumed++;
pthread_mutex_unlock(&queue_lock);
pthread_cond_signal(&producer_condvar);
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
}

View File

@ -251,7 +251,7 @@ void *string_match_map(void *args)
bzero(cur_word_final, MAX_REC_LEN);
total_len+=key_len;
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
free(cur_word);
free(cur_word_final);

View File

@ -269,7 +269,7 @@ void *wordcount_map(void *args_in)
break;
}
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
// Add the last word
@ -381,7 +381,7 @@ void *merge_sections(void *args_in)
curr2++;
}
CAUSAL_PROGRESS;
COZ_PROGRESS;
}
// copy the remaining elements

View File

@ -1,5 +1,5 @@
#if !defined(CAUSAL_H)
#define CAUSAL_H
#if !defined(COZ_H)
#define COZ_H
#ifndef __USE_GNU
# define __USE_GNU
@ -31,7 +31,7 @@ static void _causal_init_counter(int kind,
reg(kind, ctr, backoff, name);
}
#define CAUSAL_INCREMENT_COUNTER(kind, name) \
#define COZ_INCREMENT_COUNTER(kind, name) \
if(1) { \
static unsigned char _initialized = 0; \
static unsigned long _global_counter = 0; \
@ -55,13 +55,13 @@ static void _causal_init_counter(int kind,
#define STR2(x) #x
#define STR(x) STR2(x)
#define CAUSAL_PROGRESS CAUSAL_INCREMENT_COUNTER(PROGRESS_COUNTER, __FILE__ ":" STR(__LINE__))
#define CAUSAL_BEGIN CAUSAL_INCREMENT_COUNTER(BEGIN_COUNTER, __FILE__ ":" STR(__LINE__))
#define CAUSAL_END CAUSAL_INCREMENT_COUNTER(END_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_PROGRESS COZ_INCREMENT_COUNTER(PROGRESS_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_BEGIN COZ_INCREMENT_COUNTER(BEGIN_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_END COZ_INCREMENT_COUNTER(END_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_PROGRESS CAUSAL_INCREMENT_COUNTER(PROGRESS_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_BEGIN CAUSAL_INCREMENT_COUNTER(BEGIN_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_END CAUSAL_INCREMENT_COUNTER(END_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_PROGRESS COZ_INCREMENT_COUNTER(PROGRESS_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_BEGIN COZ_INCREMENT_COUNTER(BEGIN_COUNTER, __FILE__ ":" STR(__LINE__))
#define COZ_END COZ_INCREMENT_COUNTER(END_COUNTER, __FILE__ ":" STR(__LINE__))
#if defined(__cplusplus)
}