summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-04-23 16:07:50 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-04-23 16:07:50 (GMT)
commitf980ab403a3dc56ecff2631fb664e78dc3cd0afe (patch)
tree937f0b1ba438143dbab22f7c1f3d5b75228ff2ca
parentf99a4120573eb8bcededc20a91be8fa520d4ebfa (diff)
downloadhdf5-f980ab403a3dc56ecff2631fb664e78dc3cd0afe.zip
hdf5-f980ab403a3dc56ecff2631fb664e78dc3cd0afe.tar.gz
hdf5-f980ab403a3dc56ecff2631fb664e78dc3cd0afe.tar.bz2
[svn-r5232] Purpose:
Bug fix Description: The symbol "RAW" is already defined in some ioctl.h files. Changed it to RAWIO. Platforms tested: Tflops. (I am commiting this from TFLOPS. Will check it out immediate to test on local machines.)
-rw-r--r--perform/pio_engine.c31
-rw-r--r--perform/pio_perf.c14
-rw-r--r--perform/pio_perf.h2
3 files changed, 24 insertions, 23 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index e75dee1..009e84a 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -174,7 +174,7 @@ do_pio(parameters param)
fd.mpifd = MPI_FILE_NULL;
res.timers = pio_time_new(MPI_TIMER);
break;
- case RAW:
+ case RAWIO:
fd.rawfd = -1;
res.timers = pio_time_new(SYS_TIMER);
break;
@@ -323,7 +323,7 @@ done:
/* close any opened files */
/* no remove(fname) because that should have happened normally. */
switch (iot) {
- case RAW:
+ case RAWIO:
if (fd.rawfd != -1)
hrc = do_fclose(iot, &fd);
break;
@@ -366,7 +366,7 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
memset(fullname, 0, size);
switch (iot) {
- case RAW:
+ case RAWIO:
suffix = ".raw";
break;
case MPIO:
@@ -517,7 +517,7 @@ fprintf(stderr, "buffer size=%ld\n", buf_size);
/* create dataset */
switch (iot) {
- case RAW:
+ case RAWIO:
case MPIO:
/* both raw and mpi io just need dataset offset in file*/
dset_offset = (ndset - 1) * dset_size;
@@ -581,7 +581,7 @@ fprintf(stderr, "proc %d: elmts_begin=%ld, elmts_count=%ld\n",
/* Write */
/* Calculate offset of write within a dataset/file */
switch (iot) {
- case RAW:
+ case RAWIO:
file_offset = dset_offset + (elmts_begin + nelmts_written)*ELMT_SIZE;
#if AKCDEBUG
@@ -742,7 +742,7 @@ fprintf(stderr, "buffer size=%ld\n", buf_size);
/* create dataset */
switch (iot) {
- case RAW:
+ case RAWIO:
case MPIO:
/* both raw and mpi io just need dataset offset in file*/
dset_offset = (ndset - 1) * dset_size;
@@ -793,7 +793,7 @@ fprintf(stderr, "proc %d: elmts_begin=%ld, elmts_count=%ld\n",
/* read */
/* Calculate offset of read within a dataset/file */
switch (iot){
- case RAW:
+ case RAWIO:
file_offset = dset_offset + (elmts_begin + nelmts_read)*ELMT_SIZE;
#if AKCDEBUG
@@ -920,12 +920,18 @@ do_fopen(iotype iot, char *fname, file_descr *fd /*out*/, int flags)
hid_t acc_tpl = -1; /* file access templates */
switch (iot) {
- case RAW:
+ case RAWIO:
if (flags & (PIO_CREATE | PIO_WRITE))
fd->rawfd = RAWCREATE(fname);
else
fd->rawfd = RAWOPEN(fname, O_RDONLY);
+ if (fd->rawfd < 0 ) {
+ fprintf(stderr, "Raw File Open failed(%s)\n", fname);
+ GOTOERROR(FAIL);
+ }
+
+
/* The perils of raw I/O in a parallel environment. The problem is:
*
* - Process n opens a file with truncation and then starts
@@ -936,11 +942,6 @@ do_fopen(iotype iot, char *fname, file_descr *fd /*out*/, int flags)
*/
MPI_Barrier(pio_comm_g);
- if (fd->rawfd < 0 ) {
- fprintf(stderr, "Raw File Open failed(%s)\n", fname);
- GOTOERROR(FAIL);
- }
-
break;
case MPIO:
@@ -1030,7 +1031,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
int mrc = 0, rc = 0;
switch (iot) {
- case RAW:
+ case RAWIO:
rc = RAWCLOSE(fd->rawfd);
if (rc != 0){
@@ -1089,7 +1090,7 @@ do_cleanupfile(iotype iot, char *fname)
if (clean_file_g){
switch (iot){
- case RAW:
+ case RAWIO:
remove(fname);
break;
case MPIO:
diff --git a/perform/pio_perf.c b/perform/pio_perf.c
index 557f9bd..622f911 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 = Raw
+ * IO Type = RAWIO
* # Files = 1, # of dsets = 1000, Elements per dset = 37000
* Write Results = x MB/s
* Read Results = x MB/s
@@ -312,7 +312,7 @@ finish:
* number by 2 and rerun the test.
*
* - The second slowest is what type of IO to perform. We have
- * three choices: RAW, MPI-IO, and PHDF5.
+ * three choices: RAWIO, 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
@@ -381,7 +381,7 @@ run_test_loop(FILE *output, struct options *opts)
parms.num_files, parms.num_dsets, parms.num_elmts);
if (io_runs & PIO_RAW)
- run_test(output, RAW, parms);
+ run_test(output, RAWIO, parms);
if (io_runs & PIO_MPI)
run_test(output, MPIO, parms);
@@ -427,7 +427,7 @@ run_test(FILE *output, iotype iot, parameters parms)
output_report(output, "Type of IO = ");
switch (iot) {
- case RAW:
+ case RAWIO:
output_report(output, "Raw\n");
break;
case MPIO:
@@ -787,10 +787,10 @@ print_indent(register FILE *output, register int indent)
MPI_Comm_rank(pio_comm_g, &myrank);
if (myrank == 0) {
- indent *= TAB_SPACE;
+ indent *= TAB_SPACE;
- for (; indent > 0; --indent)
- fputc(' ', output);
+ for (; indent > 0; --indent)
+ fputc(' ', output);
}
}
diff --git a/perform/pio_perf.h b/perform/pio_perf.h
index 531fc4b..08306a6 100644
--- a/perform/pio_perf.h
+++ b/perform/pio_perf.h
@@ -11,7 +11,7 @@
#include "H5private.h"
typedef enum iotype_ {
- RAW,
+ RAWIO,
MPIO,
PHDF5
/*NUM_TYPES*/