Skip to content

Instantly share code, notes, and snippets.

View goyalankit's full-sized avatar
🏠
Working from home

Ankit Goyal goyalankit

🏠
Working from home
View GitHub Profile
all: clean sph_out multi # deletes all object and executables before creating new ones! Remove clean for final submission.
multi: mph_out
multi_process_hash.o:
g++ -c multi_process_hash.cpp #-DDEBUG #-DSCHED_INFO #-DDEBUG # remove -DDEBUG to disable debug information
backgroundTask.o:
g++ -c backgroundTask.c
#include <stdio.h>
#include "papi_helper.h"
int rozmer = 100;
void compute() {
// startPapiCounters();
float matice1[rozmer][rozmer];
float matice2[rozmer][rozmer];
float matice3[rozmer][rozmer];

Paxos

  • Algorithm executes multiple rounds.
  • An acceptor votes to accept atmost one value in a single round.
  • Goal: Achieve consistency by ensuring that different values are not chosen in different rounds.
  • Note that rounds can run concurrently, may be skipped altogether.

Accepter

#include <papi.h>
#include <stdio.h>
main()
{
int EventCode, retval;
char EventCodeStr[PAPI_MAX_STR_LEN];
/* Initialize the library */
retval = PAPI_library_init(PAPI_VER_CURRENT);
--------------------------------------------------------------------------------
|                                                                              |
:
| perf::PERF_COUNT_HW_CACHE_L1D                                                |
|            L1 data cache                                                     |
|     :READ                                                                    |
|            read access                                                       |
|     :WRITE                                                                   |
@goyalankit
goyalankit / test_avl.cpp
Created November 15, 2014 07:16
Compile using - `g++ test_avl.cpp -I/perfexpert/tools/macpo/common`
#include <cassert>
#include <map>
#include <vector>
#include "avl_tree.h"
// creates a bit mask with bits between a and b from the right as 1.
// example: b = 4, a = 2 => 0000001100
#define BIT_MASK(a, b) (size_t)(((size_t) -1 >> ((sizeof(size_t)*8) \
- (b))) & ~((1U << (a)) - 1))

Seed 103483

Macpo:

Iteration 1
Total Conflicts: 3858

Iteration 2
Total Conflicts: 3849
HW_PRE_REQ.DL1_MISS	Hardware Prefetch requests that miss the L1D cache. A request is being counted each time it access the cache & miss it including if a block is applicable or if hit the Fill Buffer for example.(This accounts for both L1 streamer and IP-based (IPP) HW prefetchers. )														
L1D.REPLACEMENT	Counts the number of lines brought into the L1 data cache.														
L1D.ALLOCATED_IN_M	Counts the number of allocations of modified L1D cache lines.														
L1D.EVICTION	Counts the number of modified lines evicted from the L1 data cache due to replacement.														
L1D.ALL_M_REPLACEMENT	Cache lines in M state evicted out of L1D due to Snoop HitM or dirty line replacement														

All addresses map to set 0 of the cache.

1168214315068
1168214319164
1168214323260
1168214327356
1168214331452
1168214335548
1168214339644