summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishwanath Venkatesan <vish@hdfgroup.org>2013-08-20 21:31:42 (GMT)
committerVishwanath Venkatesan <vish@hdfgroup.org>2013-08-20 21:31:42 (GMT)
commit51787c94a84a5e9252d648699d5924f3be424cf3 (patch)
treebb8c8cc82ef657f282434b33ab59e659a9f48334
parent0c13d5b4ebe1450d94a8950f16d8e52fc66c94fe (diff)
downloadhdf5-51787c94a84a5e9252d648699d5924f3be424cf3.zip
hdf5-51787c94a84a5e9252d648699d5924f3be424cf3.tar.gz
hdf5-51787c94a84a5e9252d648699d5924f3be424cf3.tar.bz2
[svn-r24038] Update to the benchmark
-rw-r--r--benchmark/FFbench/eff_benchmark.c32
-rw-r--r--benchmark/FFbench/ffbench.c11
-rw-r--r--benchmark/FFbench/ffbench_common.h6
-rw-r--r--benchmark/FFbench/ffbench_util.c20
-rw-r--r--benchmark/FFbench/test_config4
-rw-r--r--src/H5VLiod_dset.c2
6 files changed, 50 insertions, 25 deletions
diff --git a/benchmark/FFbench/eff_benchmark.c b/benchmark/FFbench/eff_benchmark.c
index 861e3bf..114f106 100644
--- a/benchmark/FFbench/eff_benchmark.c
+++ b/benchmark/FFbench/eff_benchmark.c
@@ -40,6 +40,9 @@ int main (int argc, char **argv){
hsize_t **count=NULL, **offset=NULL;
int num_dataspaces, i;
int *data = NULL, k ,j, count_size = 1;
+ double start, end;
+ double totallength = 0;
+ double totaltime = 0, max_time;
MPI_Init_thread(&argc,&argv, MPI_THREAD_MULTIPLE, &provided);
if(MPI_THREAD_MULTIPLE != provided) {
@@ -92,6 +95,8 @@ int main (int argc, char **argv){
event_q = H5EQcreate(fapl_id);
assert(event_q);
+
+ start = MPI_Wtime();
for (i = 0; i < num_dataspaces; i++){
@@ -104,6 +109,8 @@ int main (int argc, char **argv){
data = (int *) malloc
(sizeof(int)*count_size);
+ totallength += count_size * sizeof(int);
+
for (k=0; k < count_size; k++) {
data[k] = rank + 1001 + i;
}
@@ -118,16 +125,33 @@ int main (int argc, char **argv){
event_q);
assert(ret == 0);
-
-
-
-
+
H5EQwait(event_q, &num_requests, &status);
free(status);
if (data)
free (data);
}
+ end = MPI_Wtime();
+ totaltime = difftime (end, start);
+ totallength *= size;
+
+
+ MPI_Reduce(&totaltime, &max_time, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
+
+ if (!rank){
+
+ totallength /= 1024*1024;
+
+
+
+ fprintf (stderr,
+ "Approx. %lf MB data took %lf(s) with write bandwidth of %lf MB/s\n",
+ totallength,
+ max_time,
+ totallength/max_time);
+ }
+
if (f_dataspaces)
diff --git a/benchmark/FFbench/ffbench.c b/benchmark/FFbench/ffbench.c
index 2dc11a6..c0515a2 100644
--- a/benchmark/FFbench/ffbench.c
+++ b/benchmark/FFbench/ffbench.c
@@ -79,9 +79,10 @@ int FFbench_read_config_file (char *fname,
char *tmp_string = NULL;
int cnt = 0, i;
char *charLoc = NULL;
- int rank;
+ int rank, size = 0;
MPI_Comm_rank (comm, &rank);
+ MPI_Comm_size (comm, &size);
input_args = (file_args *) malloc (sizeof(file_args));
if (NULL == input_args){
@@ -125,7 +126,7 @@ int FFbench_read_config_file (char *fname,
}
break;
case 2:
- input_args->n_coords = atol(tmp_string);
+ input_args->n_coords = atol(tmp_string) ;
if (input_args->n_coords == 0){
DEBUG_LINE ("Coordinates cannot be 0\n")
ret_value = FFB_FAIL;
@@ -133,7 +134,7 @@ int FFbench_read_config_file (char *fname,
}
break;
case 3:
- input_args->coords[0] = atol(tmp_string);
+ input_args->coords[0] = atol(tmp_string) * size;
for ( i = 1; i < input_args->n_coords; i++){
tmp_string[0] = 0;
fgets (tmp_string, NAME_SIZE, fp);
@@ -412,14 +413,14 @@ int FFbench_create_dataspaces(hid_t **f_dataspaces,
NULL);
}
- count[0][0] = dimsf[1]/(size * input_args->num_ops);
+ count[0][0] = dimsf[0]/(size * input_args->num_ops);
for (j = 1; j < input_args->n_coords; j++){
count[0][j] = dimsf[j];
}
offset[0][0] = rank * count[0][0];
offset[0][1] = 0;
for ( i = 1; i < num_dataspaces; i++){
- count[i][0] = dimsf[1]/(size * input_args->num_ops);
+ count[i][0] = dimsf[0]/(size * input_args->num_ops);
for (j = 1; j < input_args->n_coords; j++){
count[i][j] = dimsf[j];
offset[i][j] = 0;
diff --git a/benchmark/FFbench/ffbench_common.h b/benchmark/FFbench/ffbench_common.h
index 5fbc66d..581de08 100644
--- a/benchmark/FFbench/ffbench_common.h
+++ b/benchmark/FFbench/ffbench_common.h
@@ -17,12 +17,12 @@
#define _FFBENCH_COMMON_H
#include <stdlib.h>
-#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
-
+#include <time.h>
+#include <math.h>
#define FFB_SUCCESS 0
#define FFB_FAIL -1
#define DEBUG
@@ -31,7 +31,7 @@
#define WRITE 390
-typedef struct timeval timer;
+typedef time_t timer;
typedef unsigned long long length_t;
diff --git a/benchmark/FFbench/ffbench_util.c b/benchmark/FFbench/ffbench_util.c
index 503a744..874a4ee 100644
--- a/benchmark/FFbench/ffbench_util.c
+++ b/benchmark/FFbench/ffbench_util.c
@@ -34,8 +34,7 @@ int FFbench_timer_start(timer *rettimer){
int ret_value = FFB_SUCCESS;
timer starttime;
- if (FFB_SUCCESS != gettimeofday(&starttime, NULL))
- ret_value = FFB_FAIL;
+ time(&starttime);
*rettimer = starttime;
return ret_value;
@@ -60,9 +59,7 @@ int FFbench_timer_end(timer *rettimer){
int ret_value = FFB_SUCCESS;
timer endtime;
- if (FFB_SUCCESS != gettimeofday(&endtime, NULL)){
- ret_value = FFB_FAIL;
- }
+ endtime = time(NULL);
*rettimer = endtime;
return ret_value;
@@ -85,10 +82,9 @@ int FFbench_timer_end(timer *rettimer){
double FFbench_timer_gettime(timer start,
timer end){
- double elapsedTime;
+ double elapsedTime = 0;
- elapsedTime = (end.tv_sec - start.tv_sec) * 1000.0;
- elapsedTime += (end.tv_usec - start.tv_usec) / 1000.0;
+ elapsedTime = difftime(end, start);
return elapsedTime;
@@ -113,9 +109,13 @@ double FFbench_getBandwidth(length_t totallength,
double totaltime){
/*Convert to MB*/
+
+ double bandwidth;
totallength /= 1024;
- totallength /= 1024;
- return (double) (totallength/totaltime);
+ bandwidth = totallength/totaltime;
+ printf ("b: %lf\n", bandwidth);
+
+ return bandwidth;
}
diff --git a/benchmark/FFbench/test_config b/benchmark/FFbench/test_config
index 7334cd7..6a20be6 100644
--- a/benchmark/FFbench/test_config
+++ b/benchmark/FFbench/test_config
@@ -15,8 +15,8 @@
eff_file.h5
D1
2
-12288
+1536
12288
WRITE
-16
+8
0 \ No newline at end of file
diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c
index 942ca6f..1e4f7c9 100644
--- a/src/H5VLiod_dset.c
+++ b/src/H5VLiod_dset.c
@@ -663,7 +663,7 @@ done:
fflush(stderr);
#endif
-#if H5_DO_NATIVE
+#if 1
usleep(2000);
#endif