mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[svn-r11265] Purpose:
New feature Description: All datasets were 1D only before. Added -g to use 2D datasets such that it allows more options in testing various access patterns. Platforms tested: heping pp. Misc. update:
This commit is contained in:
parent
6496413284
commit
592cd4d723
2847
perform/pio_engine.c
2847
perform/pio_engine.c
File diff suppressed because it is too large
Load Diff
@ -116,9 +116,9 @@ static const char *progname = "h5perf";
|
||||
* adding more, make sure that they don't clash with each other.
|
||||
*/
|
||||
#if 1
|
||||
static const char *s_opts = "a:A:B:cCd:D:e:F:hi:Imno:p:P:stT:wx:X:";
|
||||
static const char *s_opts = "a:A:B:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
|
||||
#else
|
||||
static const char *s_opts = "a:A:bB:cCd:D:e:F:hi:Imno:p:P:stT:wx:X:";
|
||||
static const char *s_opts = "a:A:bB:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
|
||||
#endif /* 1 */
|
||||
static struct long_options l_opts[] = {
|
||||
{ "align", require_arg, 'a' },
|
||||
@ -161,6 +161,13 @@ static struct long_options l_opts[] = {
|
||||
{ "debu", require_arg, 'D' },
|
||||
{ "deb", require_arg, 'D' },
|
||||
{ "de", require_arg, 'D' },
|
||||
{ "geometry", no_arg, 'g' },
|
||||
{ "geometr", no_arg, 'g' },
|
||||
{ "geomet", no_arg, 'g' },
|
||||
{ "geome", no_arg, 'g' },
|
||||
{ "geom", no_arg, 'g' },
|
||||
{ "geo", no_arg, 'g' },
|
||||
{ "ge", no_arg, 'g' },
|
||||
{ "help", no_arg, 'h' },
|
||||
{ "hel", no_arg, 'h' },
|
||||
{ "he", no_arg, 'h' },
|
||||
@ -270,7 +277,7 @@ struct options {
|
||||
const char *output_file; /* file to print report to */
|
||||
long num_dsets; /* number of datasets */
|
||||
long num_files; /* number of files */
|
||||
size_t num_bpp; /* number of bytes per proc per dset */
|
||||
off_t num_bpp; /* number of bytes per proc per dset */
|
||||
int num_iters; /* number of iterations */
|
||||
int max_num_procs; /* maximum number of processes to use */
|
||||
int min_num_procs; /* minimum number of processes to use */
|
||||
@ -279,6 +286,7 @@ struct options {
|
||||
size_t blk_size; /* Block size */
|
||||
unsigned interleaved; /* Interleaved vs. contiguous blocks */
|
||||
unsigned collective; /* Collective vs. independent I/O */
|
||||
unsigned dim2d; /* 1D vs. 2D */
|
||||
int print_times; /* print times as well as throughputs */
|
||||
int print_raw; /* print raw data throughput info */
|
||||
off_t h5_alignment; /* alignment in HDF5 file */
|
||||
@ -408,6 +416,7 @@ finish:
|
||||
* Return: Nothing
|
||||
* Programmer: Bill Wendling, 30. October 2001
|
||||
* Modifications:
|
||||
* Added 2D testing (Christian Chilan, 10. August 2005)
|
||||
*/
|
||||
static void
|
||||
run_test_loop(struct options *opts)
|
||||
@ -415,6 +424,7 @@ run_test_loop(struct options *opts)
|
||||
parameters parms;
|
||||
int num_procs;
|
||||
int doing_pio; /* if this process is doing PIO */
|
||||
off_t snbytes;
|
||||
|
||||
parms.num_files = opts->num_files;
|
||||
parms.num_dsets = opts->num_dsets;
|
||||
@ -422,6 +432,7 @@ run_test_loop(struct options *opts)
|
||||
parms.blk_size = opts->blk_size;
|
||||
parms.interleaved = opts->interleaved;
|
||||
parms.collective = opts->collective;
|
||||
parms.dim2d = opts->dim2d;
|
||||
parms.h5_align = opts->h5_alignment;
|
||||
parms.h5_thresh = opts->h5_threshold;
|
||||
parms.h5_use_chunks = opts->h5_use_chunks;
|
||||
@ -449,16 +460,34 @@ run_test_loop(struct options *opts)
|
||||
for (buf_size = opts->min_xfer_size;
|
||||
buf_size <= opts->max_xfer_size; buf_size <<= 1) {
|
||||
parms.buf_size = buf_size;
|
||||
parms.num_bytes = (off_t)opts->num_bpp*parms.num_procs;
|
||||
|
||||
print_indent(1);
|
||||
output_report("Transfer Buffer Size: %ld bytes, File size: %.2f MBs\n",
|
||||
buf_size,
|
||||
((double)parms.num_dsets * (double)parms.num_bytes)
|
||||
/ ONE_MB);
|
||||
print_indent(1);
|
||||
output_report(" # of files: %ld, # of datasets: %ld, dataset size: %.2f MBs\n",
|
||||
parms.num_files, parms.num_dsets, (double)parms.num_bytes/ONE_MB);
|
||||
if (parms.dim2d){
|
||||
parms.num_bytes = (off_t)pow((double)(opts->num_bpp*parms.num_procs),2);
|
||||
if (parms.interleaved)
|
||||
output_report("Transfer Buffer Size: %ldx%ld bytes, File size: %.2f MBs\n",
|
||||
buf_size, opts->blk_size,
|
||||
((double)parms.num_dsets * (double)parms.num_bytes)
|
||||
/ ONE_MB);
|
||||
else
|
||||
output_report("Transfer Buffer Size: %ldx%ld bytes, File size: %.2f MBs\n",
|
||||
opts->blk_size, buf_size,
|
||||
((double)parms.num_dsets * (double)parms.num_bytes)
|
||||
/ ONE_MB);
|
||||
|
||||
print_indent(1);
|
||||
output_report(" # of files: %ld, # of datasets: %ld, dataset size: %.2fx%.2f KBs\n",
|
||||
parms.num_files, parms.num_dsets, (double)(opts->num_bpp*parms.num_procs)/ONE_KB,
|
||||
(double)(opts->num_bpp*parms.num_procs)/ONE_KB);
|
||||
}
|
||||
else{
|
||||
parms.num_bytes = (off_t)opts->num_bpp*parms.num_procs;
|
||||
output_report("Transfer Buffer Size: %ld bytes, File size: %.2f MBs\n",
|
||||
buf_size,((double)parms.num_dsets * (double)parms.num_bytes) / ONE_MB);
|
||||
|
||||
print_indent(1);
|
||||
output_report(" # of files: %ld, # of datasets: %ld, dataset size: %.2f MBs\n",
|
||||
parms.num_files, parms.num_dsets, (double)(opts->num_bpp*parms.num_procs)/ONE_MB);
|
||||
}
|
||||
|
||||
if (opts->io_types & PIO_POSIX)
|
||||
run_test(POSIXIO, parms, opts);
|
||||
@ -1008,9 +1037,6 @@ report_parameters(struct options *opts)
|
||||
HDfprintf(output, "rank %d: IO API=", rank);
|
||||
print_io_api(opts->io_types);
|
||||
|
||||
HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank);
|
||||
recover_size_and_print((long_long)opts->num_bpp, "\n");
|
||||
|
||||
HDfprintf(output, "rank %d: Number of files=%Hd\n", rank,
|
||||
(long_long)opts->num_files);
|
||||
HDfprintf(output, "rank %d: Number of datasets=%Hd\n", rank,
|
||||
@ -1020,21 +1046,60 @@ report_parameters(struct options *opts)
|
||||
HDfprintf(output, "rank %d: Number of processes=%d:%d\n", rank,
|
||||
opts->min_num_procs, opts->max_num_procs);
|
||||
|
||||
HDfprintf(output, "rank %d: Size of dataset(s)=", rank);
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), ":");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs), "\n");
|
||||
if (opts->dim2d){
|
||||
HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank);
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->num_bpp * opts->min_num_procs), ":");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->num_bpp * opts->max_num_procs), "\n");
|
||||
|
||||
HDfprintf(output, "rank %d: File size=", rank);
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs
|
||||
* opts->num_dsets), ":");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs
|
||||
* opts->num_dsets), "\n");
|
||||
HDfprintf(output, "rank %d: Size of dataset(s)=", rank);
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), "x");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), ":");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs), "x");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs), "\n");
|
||||
|
||||
HDfprintf(output, "rank %d: Transfer buffer size=", rank);
|
||||
recover_size_and_print((long_long)opts->min_xfer_size, ":");
|
||||
recover_size_and_print((long_long)opts->max_xfer_size, "\n");
|
||||
HDfprintf(output, "rank %d: Block size=", rank);
|
||||
recover_size_and_print((long_long)opts->blk_size, "\n");
|
||||
HDfprintf(output, "rank %d: File size=", rank);
|
||||
recover_size_and_print((long_long)(pow(opts->num_bpp * opts->min_num_procs,2)
|
||||
* opts->num_dsets), ":");
|
||||
recover_size_and_print((long_long)(pow(opts->num_bpp * opts->max_num_procs,2)
|
||||
* opts->num_dsets), "\n");
|
||||
|
||||
HDfprintf(output, "rank %d: Transfer buffer size=", rank);
|
||||
if(opts->interleaved){
|
||||
recover_size_and_print((long_long)opts->min_xfer_size, "x");
|
||||
recover_size_and_print((long_long)opts->blk_size, ":");
|
||||
recover_size_and_print((long_long)opts->max_xfer_size, "x");
|
||||
recover_size_and_print((long_long)opts->blk_size, "\n");
|
||||
}
|
||||
else{
|
||||
recover_size_and_print((long_long)opts->blk_size, "x");
|
||||
recover_size_and_print((long_long)opts->min_xfer_size, ":");
|
||||
recover_size_and_print((long_long)opts->blk_size, "x");
|
||||
recover_size_and_print((long_long)opts->max_xfer_size, "\n");
|
||||
}
|
||||
HDfprintf(output, "rank %d: Block size=", rank);
|
||||
recover_size_and_print((long_long)opts->blk_size, "x");
|
||||
recover_size_and_print((long_long)opts->blk_size, "\n");
|
||||
}
|
||||
else{
|
||||
HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank);
|
||||
recover_size_and_print((long_long)opts->num_bpp, "\n");
|
||||
|
||||
HDfprintf(output, "rank %d: Size of dataset(s)=", rank);
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), ":");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs), "\n");
|
||||
|
||||
HDfprintf(output, "rank %d: File size=", rank);
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs
|
||||
* opts->num_dsets), ":");
|
||||
recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs
|
||||
* opts->num_dsets), "\n");
|
||||
|
||||
HDfprintf(output, "rank %d: Transfer buffer size=", rank);
|
||||
recover_size_and_print((long_long)opts->min_xfer_size, ":");
|
||||
recover_size_and_print((long_long)opts->max_xfer_size, "\n");
|
||||
HDfprintf(output, "rank %d: Block size=", rank);
|
||||
recover_size_and_print((long_long)opts->blk_size, "\n");
|
||||
}
|
||||
|
||||
HDfprintf(output, "rank %d: Block Pattern in Dataset=", rank);
|
||||
if(opts->interleaved)
|
||||
@ -1048,6 +1113,12 @@ report_parameters(struct options *opts)
|
||||
else
|
||||
HDfprintf(output, "Independent\n");
|
||||
|
||||
HDfprintf(output, "rank %d: Geometry=", rank);
|
||||
if(opts->dim2d)
|
||||
HDfprintf(output, "2D\n");
|
||||
else
|
||||
HDfprintf(output, "1D\n");
|
||||
|
||||
HDfprintf(output, "rank %d: VFL used for HDF5 I/O=", rank);
|
||||
if(opts->h5_use_mpi_posix)
|
||||
HDfprintf(output, "MPI-posix driver\n");
|
||||
@ -1081,6 +1152,7 @@ report_parameters(struct options *opts)
|
||||
* Return: Pointer to an OPTIONS structure
|
||||
* Programmer: Bill Wendling, 31. October 2001
|
||||
* Modifications:
|
||||
* Added 2D testing (Christian Chilan, 10. August 2005)
|
||||
*/
|
||||
static struct options *
|
||||
parse_command_line(int argc, char *argv[])
|
||||
@ -1103,6 +1175,7 @@ parse_command_line(int argc, char *argv[])
|
||||
cl_opts->blk_size = 128 * ONE_KB; /* Default to writing 128K per block */
|
||||
cl_opts->interleaved = 0; /* Default to contiguous blocks in dataset */
|
||||
cl_opts->collective = 0; /* Default to independent I/O access */
|
||||
cl_opts->dim2d = 0; /* Default to 1D */
|
||||
cl_opts->print_times = FALSE; /* Printing times is off by default */
|
||||
cl_opts->print_raw = FALSE; /* Printing raw data throughput is off by default */
|
||||
cl_opts->h5_alignment = 1; /* No alignment for HDF5 objects by default */
|
||||
@ -1233,6 +1306,9 @@ parse_command_line(int argc, char *argv[])
|
||||
case 'F':
|
||||
cl_opts->num_files = atoi(opt_arg);
|
||||
break;
|
||||
case 'g':
|
||||
cl_opts->dim2d = 1;
|
||||
break;
|
||||
case 'i':
|
||||
cl_opts->num_iters = atoi(opt_arg);
|
||||
break;
|
||||
@ -1354,6 +1430,7 @@ parse_size_directive(const char *size)
|
||||
* Return: Nothing
|
||||
* Programmer: Bill Wendling, 31. October 2001
|
||||
* Modifications:
|
||||
* Added 2D testing (Christian Chilan, 10. August 2005)
|
||||
*/
|
||||
static void
|
||||
usage(const char *prog)
|
||||
@ -1384,6 +1461,7 @@ usage(const char *prog)
|
||||
printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
|
||||
printf(" [default: 256K]\n");
|
||||
printf(" -F N, --num-files=N Number of files [default: 1]\n");
|
||||
printf(" -g, --geometry Use 2D geometry [default: 1D]\n");
|
||||
printf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n");
|
||||
printf(" -I, --interleaved Interleaved block I/O (see below for example)\n");
|
||||
printf(" [default: Contiguous block I/O]\n");
|
||||
|
@ -47,6 +47,7 @@ typedef struct parameters_ {
|
||||
size_t blk_size; /* Block size */
|
||||
unsigned interleaved; /* Interleaved vs. contiguous blocks */
|
||||
unsigned collective; /* Collective vs. independent I/O */
|
||||
unsigned dim2d; /* 1D vs. 2D */
|
||||
hsize_t h5_align; /* HDF5 object alignment */
|
||||
hsize_t h5_thresh; /* HDF5 object alignment threshold */
|
||||
int h5_use_chunks; /* Make HDF5 dataset chunked */
|
||||
|
Loading…
Reference in New Issue
Block a user