summaryrefslogtreecommitdiffstats
path: root/perform
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-05-21 22:09:04 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-05-21 22:09:04 (GMT)
commit3808fa2002f36b7b4e43d6ee1a643a4b36967cdc (patch)
tree62a49468c8c4a8d3440e84a1e93dceb7a36c1b7c /perform
parent64ff60d32e8de993181874ae624b8b206cac2f03 (diff)
downloadhdf5-3808fa2002f36b7b4e43d6ee1a643a4b36967cdc.zip
hdf5-3808fa2002f36b7b4e43d6ee1a643a4b36967cdc.tar.gz
hdf5-3808fa2002f36b7b4e43d6ee1a643a4b36967cdc.tar.bz2
[svn-r5450] Description:
The term RAWIO was confusing (lacking a better term). It was intended to represent the "raw" way of doing I/O such that an application may use the open/read/write interface (actually Posix) or the parallel file system's native API (e.g. gpfs_open). It was too confusing to mean multiple things. Solution: Split the RAW IO into two different IO API, POSIX and NATIVE. Posix is a standard that some applications that have used it for the serial version, may want to continue using it in the parallel environment. Changed the output and variable/macro/what-not names from RAWxxx to POSIXxxx. No algorithm changes. Platforms tested: modi4(pp), eirene(serial)
Diffstat (limited to 'perform')
-rw-r--r--perform/pio_engine.c78
-rw-r--r--perform/pio_perf.c32
-rw-r--r--perform/pio_perf.h2
3 files changed, 56 insertions, 56 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index 3c6adf0..9475d79 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -55,13 +55,13 @@
} while(0)
-/* Raw I/O macros */
-#define RAWCREATE(fn) HDopen(fn, O_CREAT|O_TRUNC|O_RDWR, 0600)
-#define RAWOPEN(fn, F) HDopen(fn, F, 0600)
-#define RAWCLOSE(F) HDclose(F)
-#define RAWSEEK(F,L) HDlseek(F, L, SEEK_SET)
-#define RAWWRITE(F,B,S) HDwrite(F,B,S)
-#define RAWREAD(F,B,S) HDread(F,B,S)
+/* POSIX I/O macros */
+#define POSIXCREATE(fn) HDopen(fn, O_CREAT|O_TRUNC|O_RDWR, 0600)
+#define POSIXOPEN(fn, F) HDopen(fn, F, 0600)
+#define POSIXCLOSE(F) HDclose(F)
+#define POSIXSEEK(F,L) HDlseek(F, L, SEEK_SET)
+#define POSIXWRITE(F,B,S) HDwrite(F,B,S)
+#define POSIXREAD(F,B,S) HDread(F,B,S)
enum {
PIO_CREATE = 1,
@@ -97,7 +97,7 @@ static int clean_file_g = -1; /*whether to cleanup temporary test */
/* the different types of file descriptors we can expect */
typedef union _file_descr {
- int rawfd; /* raw/Unix file */
+ int posixfd; /* POSIX file handle*/
MPI_File mpifd; /* MPI file */
hid_t h5fd; /* HDF5 file */
} file_descr;
@@ -157,8 +157,8 @@ do_pio(parameters param)
fd.mpifd = MPI_FILE_NULL;
res.timers = pio_time_new(MPI_TIMER);
break;
- case RAWIO:
- fd.rawfd = -1;
+ case POSIXIO:
+ fd.posixfd = -1;
res.timers = pio_time_new(MPI_TIMER);
break;
case PHDF5:
@@ -311,8 +311,8 @@ done:
/* close any opened files */
/* no remove(fname) because that should have happened normally. */
switch (iot) {
- case RAWIO:
- if (fd.rawfd != -1)
+ case POSIXIO:
+ if (fd.posixfd != -1)
hrc = do_fclose(iot, &fd);
break;
case MPIO:
@@ -354,8 +354,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
memset(fullname, 0, size);
switch (iot) {
- case RAWIO:
- suffix = ".raw";
+ case POSIXIO:
+ suffix = ".posix";
break;
case MPIO:
suffix = ".mpio";
@@ -505,9 +505,9 @@ fprintf(stderr, "buffer size=%ld\n", buf_size);
/* create dataset */
switch (iot) {
- case RAWIO:
+ case POSIXIO:
case MPIO:
- /* both raw and mpi io just need dataset offset in file*/
+ /* both posix and mpi io just need dataset offset in file*/
dset_offset = (ndset - 1) * dset_size;
break;
@@ -569,7 +569,7 @@ fprintf(stderr, "proc %d: elmts_begin=%ld, elmts_count=%ld\n",
/* Write */
/* Calculate offset of write within a dataset/file */
switch (iot) {
- case RAWIO:
+ case POSIXIO:
/* need to (off_t) the elmnts_begin expression because they */
/* may be of smaller sized integer types */
file_offset = dset_offset + (off_t)(elmts_begin + nelmts_written)*ELMT_SIZE;
@@ -579,10 +579,10 @@ fprintf(stderr, "proc %d: writes %ld bytes at file-offset %ld\n",
pio_mpi_rank_g, nelmts_towrite*ELMT_SIZE, file_offset);
#endif
- rc = RAWSEEK(fd->rawfd, file_offset);
- VRFY((rc>=0), "RAWSEEK");
- rc = RAWWRITE(fd->rawfd, buffer, (size_t)(nelmts_towrite * ELMT_SIZE));
- VRFY((rc == (nelmts_towrite*ELMT_SIZE)), "RAWWRITE");
+ rc = POSIXSEEK(fd->posixfd, file_offset);
+ VRFY((rc>=0), "POSIXSEEK");
+ rc = POSIXWRITE(fd->posixfd, buffer, (size_t)(nelmts_towrite * ELMT_SIZE));
+ VRFY((rc == (nelmts_towrite*ELMT_SIZE)), "POSIXWRITE");
break;
case MPIO:
@@ -730,9 +730,9 @@ fprintf(stderr, "buffer size=%ld\n", buf_size);
/* create dataset */
switch (iot) {
- case RAWIO:
+ case POSIXIO:
case MPIO:
- /* both raw and mpi io just need dataset offset in file*/
+ /* both posix and mpi io just need dataset offset in file*/
dset_offset = (ndset - 1) * dset_size;
break;
@@ -781,7 +781,7 @@ fprintf(stderr, "proc %d: elmts_begin=%ld, elmts_count=%ld\n",
/* read */
/* Calculate offset of read within a dataset/file */
switch (iot){
- case RAWIO:
+ case POSIXIO:
/* need to (off_t) the elmnts_begin expression because they */
/* may be of smaller sized integer types */
file_offset = dset_offset + (off_t)(elmts_begin + nelmts_read)*ELMT_SIZE;
@@ -791,10 +791,10 @@ fprintf(stderr, "proc %d: read %ld bytes at file-offset %ld\n",
pio_mpi_rank_g, nelmts_toread*ELMT_SIZE, file_offset);
#endif
- rc = RAWSEEK(fd->rawfd, file_offset);
- VRFY((rc>=0), "RAWSEEK");
- rc = RAWREAD(fd->rawfd, buffer, (size_t)(nelmts_toread*ELMT_SIZE));
- VRFY((rc==(nelmts_toread*ELMT_SIZE)), "RAWREAD");
+ rc = POSIXSEEK(fd->posixfd, file_offset);
+ VRFY((rc>=0), "POSIXSEEK");
+ rc = POSIXREAD(fd->posixfd, buffer, (size_t)(nelmts_toread*ELMT_SIZE));
+ VRFY((rc==(nelmts_toread*ELMT_SIZE)), "POSIXREAD");
break;
case MPIO:
@@ -908,19 +908,19 @@ do_fopen(iotype iot, char *fname, file_descr *fd /*out*/, int flags)
hid_t acc_tpl = -1; /* file access templates */
switch (iot) {
- case RAWIO:
+ case POSIXIO:
if (flags & (PIO_CREATE | PIO_WRITE))
- fd->rawfd = RAWCREATE(fname);
+ fd->posixfd = POSIXCREATE(fname);
else
- fd->rawfd = RAWOPEN(fname, O_RDONLY);
+ fd->posixfd = POSIXOPEN(fname, O_RDONLY);
- if (fd->rawfd < 0 ) {
- fprintf(stderr, "Raw File Open failed(%s)\n", fname);
+ if (fd->posixfd < 0 ) {
+ fprintf(stderr, "POSIX File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
- /* The perils of raw I/O in a parallel environment. The problem is:
+ /* The perils of POSIX I/O API in a parallel environment. The problem is:
*
* - Process n opens a file with truncation and then starts
* writing to the file.
@@ -1019,15 +1019,15 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
int mrc = 0, rc = 0;
switch (iot) {
- case RAWIO:
- rc = RAWCLOSE(fd->rawfd);
+ case POSIXIO:
+ rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
- fprintf(stderr, "Raw File Close failed\n");
+ fprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
- fd->rawfd = -1;
+ fd->posixfd = -1;
break;
case MPIO:
@@ -1078,7 +1078,7 @@ do_cleanupfile(iotype iot, char *fname)
if (clean_file_g){
switch (iot){
- case RAWIO:
+ case POSIXIO:
remove(fname);
break;
case MPIO:
diff --git a/perform/pio_perf.c b/perform/pio_perf.c
index 0f6cec6..03bc915 100644
--- a/perform/pio_perf.c
+++ b/perform/pio_perf.c
@@ -13,7 +13,7 @@
* This is what the report should look like:
*
* nprocs = Max#Procs
- * IO Type = RAWIO
+ * IO API = POSIXIO
* # Files = 1, # of dsets = 1000, Elements per dset = 37000
* Write Results = x MB/s
* Read Results = x MB/s
@@ -23,7 +23,7 @@
*
* . . .
*
- * IO Type = MPIO
+ * IO API = MPIO
* # Files = 1, # of dsets = 1000, Elements per dset = 37000
* Write Results = x MB/s
* Read Results = x MB/s
@@ -33,7 +33,7 @@
*
* . . .
*
- * IO Type = PHDF5
+ * IO API = PHDF5
* # Files = 1, # of dsets = 1000, Elements per dset = 37000
* Write Results = x MB/s
* Read Results = x MB/s
@@ -72,7 +72,7 @@
#define ONE_MB (ONE_KB * ONE_KB)
#define ONE_GB (ONE_MB * ONE_KB)
-#define PIO_RAW 0x10
+#define PIO_POSIX 0x10
#define PIO_MPI 0x20
#define PIO_HDF5 0x40
@@ -315,8 +315,8 @@ finish:
* processors to use. For each loop iteration, we divide that
* number by 2 and rerun the test.
*
- * - The second slowest is what type of IO to perform. We have
- * three choices: RAWIO, MPI-IO, and PHDF5.
+ * - The second slowest is what type of IO API to perform. We have
+ * three choices: POSIXIO, MPI-IO, and PHDF5.
*
* - Then we change the size of the buffer. This information is
* inferred from the number of datasets to create and the number
@@ -333,7 +333,7 @@ run_test_loop(struct options *opts)
parameters parms;
long num_procs;
int doing_pio; /* if this process is doing PIO */
- int io_runs = PIO_HDF5 | PIO_MPI | PIO_RAW; /* default to run all tests */
+ int io_runs = PIO_HDF5 | PIO_MPI | PIO_POSIX; /* default to run all tests */
if (opts->io_types & ~0x7) {
/* we want to run only a select subset of these tests */
@@ -345,8 +345,8 @@ run_test_loop(struct options *opts)
if (opts->io_types & PIO_MPI)
io_runs |= PIO_MPI;
- if (opts->io_types & PIO_RAW)
- io_runs |= PIO_RAW;
+ if (opts->io_types & PIO_POSIX)
+ io_runs |= PIO_POSIX;
}
parms.num_files = opts->num_files;
@@ -383,8 +383,8 @@ run_test_loop(struct options *opts)
output_report(" # of files: %ld, # of dsets: %ld, # of elmts per dset: %ld\n",
parms.num_files, parms.num_dsets, parms.num_elmts);
- if (io_runs & PIO_RAW)
- run_test(RAWIO, parms);
+ if (io_runs & PIO_POSIX)
+ run_test(POSIXIO, parms);
if (io_runs & PIO_MPI)
run_test(MPIO, parms);
@@ -431,11 +431,11 @@ run_test(iotype iot, parameters parms)
raw_size = parms.num_dsets * parms.num_elmts * sizeof(int);
parms.io_type = iot;
print_indent(2);
- output_report("Type of IO = ");
+ output_report("IO API = ");
switch (iot) {
- case RAWIO:
- output_report("Raw\n");
+ case POSIXIO:
+ output_report("POSIX\n");
break;
case MPIO:
output_report("MPIO\n");
@@ -920,7 +920,7 @@ parse_command_line(int argc, char *argv[])
break;
case 'r':
cl_opts->io_types &= ~0x7;
- cl_opts->io_types |= PIO_RAW;
+ cl_opts->io_types |= PIO_POSIX;
break;
case 'x':
cl_opts->min_xfer_size = parse_size_directive(opt_arg);
@@ -1018,7 +1018,7 @@ usage(const char *prog)
fprintf(stdout, " -o F, --output=F Output raw data into file F [default: none]\n");
fprintf(stdout, " -P N, --max-num-processes=N Maximum number of processes to use [default: all MPI_COMM_WORLD processes ]\n");
fprintf(stdout, " -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n");
- fprintf(stdout, " -r, --raw Run raw (UNIX) performance test\n");
+ fprintf(stdout, " -r, --raw Run raw (POSIX) performance test\n");
fprintf(stdout, " -X S, --max-xfer-size=S Maximum transfer buffer size [default: 1M]\n");
fprintf(stdout, " -x S, --min-xfer-size=S Minimum transfer buffer size [default: 128K]\n");
fprintf(stdout, "\n");
diff --git a/perform/pio_perf.h b/perform/pio_perf.h
index bea92f4..5f75ad1 100644
--- a/perform/pio_perf.h
+++ b/perform/pio_perf.h
@@ -11,7 +11,7 @@
#include "H5private.h"
typedef enum iotype_ {
- RAWIO,
+ POSIXIO,
MPIO,
PHDF5
/*NUM_TYPES*/