Communication techniques bench: act more like a WB
* Send addresses of place in memory where another addresses has been stored
This commit is contained in:
parent
85f383fd7d
commit
0a4da54fec
|
@ -31,7 +31,7 @@ extern struct communication_assoc assoc_root;
|
|||
__BEGIN_DECLS
|
||||
|
||||
struct communication_assoc *create_comm_assoc(void);
|
||||
static inline void send(void *addr) {
|
||||
static inline void send(void **addr) {
|
||||
asm volatile("mov %%gs:channel@NTPOFF + 2 *" toString(BUF_SIZE) " + " toString(CACHE_LINE_SIZE) ", %%eax\n\t"
|
||||
"mov %0, %%gs:channel@NTPOFF(%%eax)\n\t"
|
||||
"addl $4, %%eax\n\t"
|
||||
|
|
|
@ -26,7 +26,7 @@ extern __thread int pipefd[];
|
|||
extern struct communication_assoc assoc_root;
|
||||
|
||||
struct communication_assoc *create_comm_assoc(void);
|
||||
static inline void send(void *addr) {
|
||||
static inline void send(void **addr) {
|
||||
write(pipefd[WRITE_IDX], &addr, sizeof(void *));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ extern __thread volatile int prod_idx;
|
|||
extern __thread volatile int cons_idx;
|
||||
|
||||
struct communication_assoc *create_comm_assoc(void);
|
||||
static inline void send(void *addr) {
|
||||
static inline void send(void **addr) {
|
||||
while ((prod_idx + 1) % SHARED_SPACE_VOIDPTR == cons_idx);
|
||||
shared_space[prod_idx] = addr;
|
||||
prod_idx = (prod_idx + 1) % SHARED_SPACE_VOIDPTR;
|
||||
|
|
|
@ -28,7 +28,7 @@ extern __thread volatile int prod_idx;
|
|||
extern __thread volatile int cons_idx;
|
||||
|
||||
struct communication_assoc *create_comm_assoc(void);
|
||||
static inline void send(void *addr) {
|
||||
static inline void send(void **addr) {
|
||||
static __thread int local_cons_idx = 0;
|
||||
|
||||
if (likely(((prod_idx + 1) % SHARED_SPACE_VOIDPTR) == local_cons_idx))
|
||||
|
|
|
@ -148,7 +148,7 @@ int analyse_options(int argc, char *argv[])
|
|||
void *producer(void *cont_ptr_void)
|
||||
{
|
||||
int i, j;
|
||||
uintptr_t k;
|
||||
void *k;
|
||||
volatile int *cont;
|
||||
|
||||
cont = *((volatile int **) cont_ptr_void);
|
||||
|
@ -168,7 +168,7 @@ void *producer(void *cont_ptr_void)
|
|||
}
|
||||
printf("Registering: %p !\n", (void*) pthread_self());
|
||||
add_sender();
|
||||
k = (uintptr_t) pthread_self();
|
||||
k = cont_ptr_void;
|
||||
if (initialize_papi() != -1)
|
||||
{
|
||||
for(i = 0; i < nb_cache_lines; i++) {
|
||||
|
|
Loading…
Reference in New Issue