Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aniket-modi/h5bench # Ple…
Browse files Browse the repository at this point in the history
…ase enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
aniket-modi committed Nov 8, 2023
2 parents e46dbbf + 28df0fb commit a3986c8
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 92 deletions.
41 changes: 24 additions & 17 deletions commons/h5bench_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,52 +587,59 @@ _set_io_pattern(bench_params *params_in_out)
(params_in_out->io_op == IO_APPEND)) { // file --> mem
if (params_in_out->mem_pattern == PATTERN_CONTIG) {
if (params_in_out->file_pattern == PATTERN_CONTIG) {
if (params_in_out->read_option == LDC){
if (params_in_out->read_option == LDC) {
switch (params_in_out->num_dims) {
case 2:
(*params_in_out).access_pattern.pattern_read = LDC_2D;
ret = 0;
break;
default:
ret = -1;
printf("%s(). Unexpected Dimensions for LDC. failed on line %d\n", __func__, __LINE__);
printf("%s(). Unexpected Dimensions for LDC. failed on line %d\n", __func__,
__LINE__);
break;
}
} else if (params_in_out->read_option == RDC){
}
else if (params_in_out->read_option == RDC) {
switch (params_in_out->num_dims) {
case 2:
(*params_in_out).access_pattern.pattern_read = RDC_2D;
ret = 0;
break;
default:
ret = -1;
printf("%s(). Unexpected Dimensions for RDC. failed on line %d\n", __func__, __LINE__);
printf("%s(). Unexpected Dimensions for RDC. failed on line %d\n", __func__,
__LINE__);
break;
}
} else if (params_in_out->read_option == PRL){
}
else if (params_in_out->read_option == PRL) {
switch (params_in_out->num_dims) {
case 2:
(*params_in_out).access_pattern.pattern_read = PRL_2D;
ret = 0;
break;
default:
ret = -1;
printf("%s(). Unexpected Dimensions for PRL. failed on line %d\n", __func__, __LINE__);
printf("%s(). Unexpected Dimensions for PRL. failed on line %d\n", __func__,
__LINE__);
break;
}
} else if (params_in_out->read_option == CS){
}
else if (params_in_out->read_option == CS) {
switch (params_in_out->num_dims) {
case 2:
(*params_in_out).access_pattern.pattern_read = CS_2D;
ret = 0;
break;
default:
ret = -1;
printf("%s(). Unexpected Dimensions for CS. failed on line %d\n", __func__, __LINE__);
printf("%s(). Unexpected Dimensions for CS. failed on line %d\n", __func__,
__LINE__);
break;
}
}
else{
else {
switch (params_in_out->num_dims) {
case 1:
(*params_in_out).access_pattern.pattern_read = CONTIG_1D;
Expand Down Expand Up @@ -828,16 +835,16 @@ _set_params(char *key, char *val_in, bench_params *params_in_out, int do_write)
else if (strcmp(val_in, "STRIDED") == 0) { // STRIDED
(*params_in_out).read_option = READ_STRIDED;
}
else if (strcmp(val_in, "LDC") == 0) {
else if (strcmp(val_in, "LDC") == 0) {
(*params_in_out).read_option = LDC;
}
else if (strcmp(val_in, "RDC") == 0) {
else if (strcmp(val_in, "RDC") == 0) {
(*params_in_out).read_option = RDC;
}
else if (strcmp(val_in, "PRL") == 0) {
else if (strcmp(val_in, "PRL") == 0) {
(*params_in_out).read_option = PRL;
}
else if (strcmp(val_in, "CS") == 0) {
else if (strcmp(val_in, "CS") == 0) {
(*params_in_out).read_option = CS;
}

Expand Down Expand Up @@ -1069,11 +1076,11 @@ bench_params_init(bench_params *params_out)
(*params_out).num_dims = 1;

(*params_out).stride = 0;
(*params_out).stride_2 = 0;
(*params_out).stride_3 = 0;
(*params_out).stride_2 = 0;
(*params_out).stride_3 = 0;
(*params_out).block_size = 0;
(*params_out).block_size_2 = 0;
(*params_out).block_size_3 = 0;
(*params_out).block_size_2 = 0;
(*params_out).block_size_3 = 0;
(*params_out).block_cnt = 0;
(*params_out).dim_1 = 1;
(*params_out).dim_2 = 1;
Expand Down
13 changes: 11 additions & 2 deletions commons/h5bench_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef enum read_pattern {
STRIDED_1D,
CONTIG_2D,
CONTIG_3D,
LDC_2D,
LDC_2D,
RDC_2D,
CS_2D,
PRL_2D,
Expand All @@ -89,7 +89,16 @@ typedef enum io_operation {
IO_APPEND,
} io_operation;

typedef enum read_option { READ_OPTION_INVALID, READ_FULL, READ_PARTIAL, READ_STRIDED, LDC, RDC, PRL, CS } read_option;
typedef enum read_option {
READ_OPTION_INVALID,
READ_FULL,
READ_PARTIAL,
READ_STRIDED,
LDC,
RDC,
PRL,
CS
} read_option;

typedef struct bench_params {
io_operation io_op;
Expand Down
Loading

0 comments on commit a3986c8

Please sign in to comment.