-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
181 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "mpiP-histogram.h" | ||
|
||
void | ||
init_histogram (mpiPi_histogram_t * h, int first_bin_max, int size, | ||
int *intervals) | ||
{ | ||
h->first_bin_max = first_bin_max; | ||
h->hist_size = size; | ||
h->bin_intervals = intervals; | ||
} | ||
|
||
static int | ||
get_histogram_bin (mpiPi_histogram_t * h, int val) | ||
{ | ||
int wv = val; | ||
int bin; | ||
|
||
bin = 0; | ||
|
||
if (h->bin_intervals == NULL) | ||
{ | ||
while (wv > h->first_bin_max && bin < h->hist_size) | ||
{ | ||
wv >>= 1; | ||
bin++; | ||
} | ||
} | ||
else /* Add code for custom intervals later */ | ||
{ | ||
} | ||
return bin; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef MPIPHISTOGRAM_H | ||
#define MPIPHISTOGRAM_H | ||
|
||
#include <stdio.h> | ||
|
||
typedef struct _mpiPi_histogram | ||
{ | ||
int first_bin_max; | ||
int hist_size; | ||
int *bin_intervals; | ||
} mpiPi_histogram_t; | ||
|
||
void init_histogram (mpiPi_histogram_t * h, int first_bin_max, int size, | ||
int *intervals); | ||
static int get_histogram_bin (mpiPi_histogram_t * h, int val); | ||
|
||
#endif // MPIPHISTOGRAM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
|
||
static int | ||
mpiPi_callsite_stats_pc_hashkey (const void *p) | ||
{ | ||
int res = 0; | ||
int i; | ||
callsite_stats_t *csp = (callsite_stats_t *) p; | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp); | ||
for (i = 0; i < MPIP_CALLSITE_STACK_DEPTH; i++) | ||
{ | ||
res ^= (unsigned) (long) csp->pc[i]; | ||
} | ||
return 52271 ^ csp->op ^ res ^ csp->rank; | ||
} | ||
|
||
static int | ||
mpiPi_callsite_stats_pc_comparator (const void *p1, const void *p2) | ||
{ | ||
int i; | ||
callsite_stats_t *csp_1 = (callsite_stats_t *) p1; | ||
callsite_stats_t *csp_2 = (callsite_stats_t *) p2; | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp_1); | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp_2); | ||
|
||
#define express(f) {if ((csp_1->f) > (csp_2->f)) {return 1;} if ((csp_1->f) < (csp_2->f)) {return -1;}} | ||
express (op); | ||
express (rank); | ||
|
||
for (i = 0; i < MPIP_CALLSITE_STACK_DEPTH; i++) | ||
{ | ||
express (pc[i]); | ||
} | ||
#undef express | ||
|
||
return 0; | ||
} | ||
|
||
static int | ||
mpiPi_callsite_stats_src_hashkey (const void *p) | ||
{ | ||
int res = 0; | ||
callsite_stats_t *csp = (callsite_stats_t *) p; | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp); | ||
return 52271 ^ csp->op ^ res ^ csp->rank ^ csp->csid; | ||
} | ||
|
||
static int | ||
mpiPi_callsite_stats_src_comparator (const void *p1, const void *p2) | ||
{ | ||
callsite_stats_t *csp_1 = (callsite_stats_t *) p1; | ||
callsite_stats_t *csp_2 = (callsite_stats_t *) p2; | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp_1); | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp_2); | ||
|
||
#define express(f) {if ((csp_1->f) > (csp_2->f)) {return 1;} if ((csp_1->f) < (csp_2->f)) {return -1;}} | ||
express (op); | ||
express (csid); | ||
express (rank); | ||
#undef express | ||
|
||
return 0; | ||
} | ||
|
||
static int | ||
mpiPi_callsite_stats_MPI_id_hashkey (const void *p) | ||
{ | ||
callsite_stats_t *csp = (callsite_stats_t *) p; | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp); | ||
return 52271 ^ csp->op; | ||
} | ||
|
||
static int | ||
mpiPi_callsite_stats_src_id_hashkey (const void *p) | ||
{ | ||
int res = 0; | ||
callsite_stats_t *csp = (callsite_stats_t *) p; | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp); | ||
return 52271 ^ csp->op ^ res ^ csp->csid; | ||
} | ||
|
||
static int | ||
mpiPi_callsite_stats_src_id_comparator (const void *p1, const void *p2) | ||
{ | ||
callsite_stats_t *csp_1 = (callsite_stats_t *) p1; | ||
callsite_stats_t *csp_2 = (callsite_stats_t *) p2; | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp_1); | ||
MPIP_CALLSITE_STATS_COOKIE_ASSERT (csp_2); | ||
|
||
#define express(f) {if ((csp_1->f) > (csp_2->f)) {return 1;} if ((csp_1->f) < (csp_2->f)) {return -1;}} | ||
express (op); | ||
express (csid); | ||
#undef express | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef MPIPCALLSITE_STATS_H | ||
#define MPIPCALLSITE_STATS_H | ||
|
||
typedef struct _callsite_stats | ||
{ | ||
unsigned op; | ||
unsigned rank; | ||
int csid; | ||
long long count; | ||
double cumulativeTime; | ||
double cumulativeTimeSquared; | ||
double maxDur; | ||
double minDur; | ||
double maxDataSent; | ||
double minDataSent; | ||
double maxIO; | ||
double minIO; | ||
double maxRMA; | ||
double minRMA; | ||
double cumulativeDataSent; | ||
double cumulativeIO; | ||
double cumulativeRMA; | ||
long long arbitraryMessageCount; | ||
double *siteData; | ||
int siteDataIdx; | ||
void *pc[MPIP_CALLSITE_STACK_DEPTH_MAX]; | ||
char *filename[MPIP_CALLSITE_STACK_DEPTH_MAX]; | ||
char *functname[MPIP_CALLSITE_STACK_DEPTH_MAX]; | ||
int lineno[MPIP_CALLSITE_STACK_DEPTH_MAX]; | ||
long cookie; | ||
} callsite_stats_t; | ||
|
||
#endif // MPIPCALLSITE_STATS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters