Compare commits

...

11 Commits

Author SHA1 Message Date
Kurt Stockinger 7d140c6cb6 Preparing tag 1.4 2007-08-29 01:43:58 +00:00
gsell 8d760dc264 configure.ac: incr version number to 1.3.3 and bug-report address changed 2007-04-25 07:21:56 +00:00
Kurt Stockinger 4546846f06 Delete all files are benchmark is done. 2007-04-24 22:48:53 +00:00
Kurt Stockinger 62c46dc8bf Minor documentation updates. 2007-04-24 21:57:28 +00:00
gsell 9516e493bc doc/Downloading
- fix links to software
	- HDF5 build instructions removed
2007-04-20 12:00:40 +00:00
gsell 9df1d56714 doc/BuildingHDF5.html
- SSI statements removed
	- bgcolor removed
2007-04-20 11:59:54 +00:00
gsell 98e1055b7b doc/UsingC.html
doc/UsingF.html
	- SSI statements removed
2007-04-20 11:58:58 +00:00
gsell 436cce16c7 doc/H5PartTools.html
- SSI statements removed
	- bgcolor removed
2007-04-20 11:57:57 +00:00
gsell ec6f30bbd8 - doc/H5X_File_Format.txt
* added
2007-04-20 08:33:47 +00:00
Kurt Stockinger d356142bc4 Commented out some dead links. 2007-04-19 22:06:53 +00:00
Kurt Stockinger 00c9b0804b Updated doxygen information. 2007-04-19 21:43:57 +00:00
12 changed files with 340 additions and 219 deletions
+1
View File
@@ -28,6 +28,7 @@ doc/H5PartVisIt/cloud_visit_2D.png -text
doc/H5PartVisIt/cloud_visit_2D.s.png -text
doc/H5PartVisIt/visit_query1.png -text
doc/H5PartVisIt/visit_query1.s.png -text
doc/H5X_File_Format.txt -text
doc/H5tools/H5tools.html -text
doc/H5tools/H5tools_files/snapshot1.jpg -text
doc/InternalLayout.html -text
+1 -1
View File
@@ -1,6 +1,6 @@
# Every configure script must call AC_INIT before doing anything else.
# AC_INIT (package, version, [bug-report], [tarname])
AC_INIT([H5Part], [1.3.2], [vis@hpcrdm.lbl.gov], H5Part)
AC_INIT([H5Part], [1.3.3], [h5part@lists.psi.ch], H5Part)
# Ensure that a recent enough version of Autoconf is being used.
+1 -5
View File
@@ -6,8 +6,6 @@
<meta name="keywords" content="scientific visualization">
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
<!--#include virtual="/include/topIncludes.html"-->
<div id="maincenter">
@@ -15,7 +13,7 @@
<title>Building HDF5</title>
</head>
<body bgcolor="#F0F0F0">
<body>
<font face="arial,helvetica" size="+2" color="#555588"><h2>Building H5Part</h2></font>
<UL>
<LI><a href="#ConfigOptions">Configure Options</a>
@@ -64,5 +62,3 @@ source .tcshr (.cshrc, .bashrc) in the one that you are using.
You can <a href="http://vis.lbl.gov/Research/AcceleratorSAPP/Downloading.html">continue <a/>downloading and installing H5Part.
</div>
<!--#include virtual="/include/dateFooter.html"-->
+10 -58
View File
@@ -11,7 +11,7 @@
<title>Downloading HDF5 and H5Part</title>
</head>
<body bgcolor="#F0F0F0">
<body>
<font face="arial,helvetica" size="+2" color="#555588"><h2>Downloading H5Part</h2></font>
<UL>
<LI><a href="#hdf5">Downloading HDF5</a>
@@ -21,63 +21,15 @@
<hr>
<a name="hdf5">
<h2>Downloading HDF5</h2></a>
You will need to download and install the hdf5 library and link H5Part with it.
<pre>
ftp ftp.ncsa.uiuc.edu
username: anonymous
password: your email
cd HDF/HDF5/current/src
ls
get hdf5-1.6.5.tar.gz (get the current version, this as the one on April 20th, 2006)
cd szip/src
ls
get szip-2.0.tar.gz (get the current version, this as the one on April 20th, 2006)
cd ../../
cd zlib/1.2/src
ls
get zlib-1.2.1.tar.gz (get the current version, this as the one on April 20th, 2006)
</pre>
<P>
Note: you might already have libz in your system and you will not need libsz unless you build hdf5 with support for it.
</P>
<h4>Building Parallel HDF5</h4>
<P>
When you build HDF5, you will need to build an version with parallel I/O
enabled. Here is a set of configure options that worked for us on a
Linux workstation running SuSE 10.1 with MPICH installed in /usr/local/mpich.
</p>
<pre>
./configure --prefix=/usr/local/hdf5-mpich --enable-parallel CC=mpicc CXX=mpicxx --disable-shared --enable-static --enable-stream-vfd
</pre>
<UL>
<li> --prefix=/usr/local/hdf5-mpich : the location where the HDF5 libs and
binaries will be installed.</LI>
<li> --enable-parallel : contrary to the HDF5 documentation, which says that
"--enable-parallel" is optional for building the parallel version of
HDF5, you <b>must</b> have --enable-parallel to get the parallel-enabled
build. See <a href="ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/release_docs/INSTALL_parallel">these notes from HDF5</a> where they claim that
--enable-parallel is optional.</LI>
<li> CC=mpicc CXX=mpicxx : contrary to the output from configure --help, the
configure script seems to ignore the CC and CXX environment variables.
We tried setting these environment variables to mpicc and mpicxx,
respectively, and then ran configure with --enable-parallel. The configure
script would faile with this error message:
<pre>
checking whether a simple MPI-IO program can be linked... no
configure: error: unable to link a simple MPI-IO application
</pre>
</LI>
<LI> --disable-shared and --enable-static: the HDF5 build failed for us
w/o these options when attempting to read symbols from libmpich.a. The
result of these options is that your parallel-enabled HDF5 libaries
will be static rather than dynamic.
</UL>
You will need to download and install the HDF5 library and link H5Part with it.
<UL>
<LI><a href="ftp://ftp.hdfgroup.org/HDF5/current/src/hdf5-1.6.5.tar.gz">ftp://ftp.hdfgroup.org/HDF5/current/src/hdf5-1.6.5.tar.gz</a></LI>
<LI><a href="http://www.zlib.net/zlib-1.2.3.tar.gz">http://www.zlib.net/zlib-1.2.3.tar.gz</a></LI>
<LI><a href="ftp://ftp.hdfgroup.org/lib-external/szip/2.0/src/szip-2.0.tar.gz">ftp://ftp.hdfgroup.org/lib-external/szip/2.0/src/szib-2.0.tar.gz</a></LI>
</UL>
<P>
Note: you might already have libz in your system and you will not need libsz unless you build hdf5 with support for it.
</P>
<h2 id="h5part">Downloading H5Part</h2>
H5Part is available for download from Berkeley Labs Codeforge system <a href="https://codeforge.lbl.gov/projects/h5part/">https://codeforge.lbl.gov/projects/h5part</a>.
+1 -1
View File
@@ -4,7 +4,7 @@
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = H5Part
PROJECT_NUMBER = 1.3.1
PROJECT_NUMBER = 1.3.3
OUTPUT_DIRECTORY = ./ReferencePages
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
+1 -6
View File
@@ -6,8 +6,6 @@
<meta name="keywords" content="scientific visualization">
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
<!--#include virtual="/include/topIncludes.html"-->
<div id="maincenter">
@@ -15,7 +13,7 @@
<title>H5Part Utility Tools</title>
</head>
<body bgcolor="#F0F0F0">
<body>
<font face="arial,helvetica" size="+2" color="#555588"><h2>H5Part Utility Tools</h2></font>
<UL>
<LI><a href="h5pAttrib">h5pAttrib</a>
@@ -94,6 +92,3 @@ usage: h5pToGNUplot -t TIMESTEP -1 VARIABLE#1 -2 VARIABLE#2 -i INPUTFILE [OPTION
</div>
<!--#include virtual="/include/dateFooter.html"-->
+151
View File
@@ -0,0 +1,151 @@
Proposal for a more general file format used by H5Part/H5Block
Authors: Achim Gsell
Status: Draft
1. Introduction
H5X is the file format used by H5Part and H5Block. H5X is designed on
top of HDF5: A H5X file is a very special HDF5 file.
+--------------------+
| Application |
+--------------------+
| H5Part/H5Block API |
+--------------------+
| H5X API |
+--------------------+
| HDF5 API |
+--------------------+
| Filesystem of OS |
+--------------------+
2. H5X file format specification
2.1 The root group
2.1.1 File attributes
Attributes of the HDF5 root group are called "file attributes". There
are no restrictions on file attribute names. Supported values are
scalars and arrays of 64bit integer and 64bit floating point number as
well as string values, but not arrays of strings.
2.1.1.1 Predefined file attributes
__stepname__ (optional)
See below.
__stepnumwidth__ (optional)
See below.
2.1.2 Members of the root group
Members of the root group are special formated HDF5 groups called
"step groups". The name of a step group is "<name>#<number>".
Whereby <name> is either defined by the optional file attribute
__stepname__ or set to "Step" by default. <number> is an
unsigned integer less than 2^63.
/
+- Step#0
+- Step#1
...
+- Step#n
+- StepProperties [NEW]
+- Mesh [NEW]
The optional file attribute __stepnumwidth__ defines the minimum width
of <number> in the name of the step group. The number is padded with
'0'. The minimum width defaults to zero, so that no paddings occurs.
Example: With __stepnumwidth__ := 5 the name of the step group with
number 42 is "Step#00042", with __stepnumwidth__ := 0 the name is
"Step#42".
Step groups may be unsorted in the HDF5 file und may not be number
consecutively.
2.2 Format of a step group
2.2.1 Step attributes
Step attributes are HDF5 attributes asigned to a step group. There
are no restrictions on file attribute names. Supported values are
scalars and arrays of 64bit integer and 64bit floating point number as
well as string values, but not arrays of strings.
2.2.2 Predefined step attributes
No predefined step attributes exists.
2.2.3 Members of a step group
Members of a step group are HDF5 datasets and optional one HDF5 group
with the name "Block". HDF5 datasets in a step group are called "step
datasets". The optional block group is called "block data".
Mesh?!
2.2.4 Step datasets
Step datasets are arrays of rank 1. The dataset size must be the same
for all datasets inside a step. The size of the dataset may vary
from step to step. Array values are 64bit integer or 64bit floating
point numbers. No limitations (other than given by HDF5) are given on
step dataset names.
2.2.5 Block Data
The block data group is a container for an arbitrary number of field
data. A field is a data structure to store arrays of rank m with
n-dimensional vector values. Fields are represented within HDF5
groups. The HDF5 group name is the unique identifier for a field in
the current step.
2.2.5.1 m-rank fields with n-dimensional-vector values
Values are stored per dimension in separate datasets. Thus we have n
datasets for a field with n-dimensional vector values. Each dataset
corresponse to one dimension. The datasets are numbered from '0' to
'n-1'. Arrays are stored in column major order (Fortran indexing
scheme).
/ # HDF5 root group
...
+- Step#<i> # HDF5 group
|
+- Block # HDF5 group
|
+- <field name> # HDF5 group
|
+- 0 # HDF5 dataset, first dim of vector
+- 1 # HDF5 dataset, second dim of vector
...
+- n-1 # HDF5 dataset, last dim of vector
...
2.2.5.2 m-rank fields with scalar values
Fields with scalar values are stored as special case of fields with
n-dimensional vector values with n := 1.
/ # HDF5 root group
...
+- Step#<i> # HDF5 group
|
+- Block # HDF5 group
|
+- <field name> # HDF5 group
|
+- 0 # HDF5 dataset, scalar value
...
2.3 Step properties [NEW]
-3
View File
@@ -6,8 +6,6 @@
<meta name="keywords" content="scientific visualization">
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
<!--#include virtual="/include/topIncludes.html"-->
<div id="maincenter">
<h1>The C/C++ Application Programming Interface (API)</h1>
@@ -603,4 +601,3 @@ if (H5PartReadStepAttrib(file, "filename", &name[0]) == 1){
</div>
<!--#include virtual="/include/dateFooter.html"-->
-4
View File
@@ -6,8 +6,6 @@
<meta name="keywords" content="scientific visualization">
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
<!--#include virtual="/include/topIncludes.html"-->
<div id="maincenter">
@@ -500,5 +498,3 @@ err=h5pt_readstepattrib(file,"RealTime",data)
</div>
<!--#include virtual="/include/dateFooter.html"-->
+6 -6
View File
@@ -9,7 +9,7 @@
<div id="maincenter">
<font face="arial,helvetica"><h1>H5Part: a Portable High Performance Parallel Data Interface to HDF5</h1></font>
<h2><font color="red"> THESE PAGES ARE UNDER CONSTRUCTION, September 2006</h2></font>
<!--<h2><font color="red"> THESE PAGES ARE UNDER CONSTRUCTION, September 2006</h2></font>-->
<font face="arial,helvetica" color="#555588"><h2>Motivation</h2></font>
<P>
<TABLE>
@@ -105,17 +105,17 @@ of datasets that contain multiple fields.
<LI><a href="UsingF.html">Using the F77/F90 interface</a>
<LI><a href="InternalLayout.html">Logical Internal HDF5 File</a>
<LI><a href="H5PartTools.html">H5Part Utility Tools</a>
<LI><a href="ReferencePages/index.html">Reference Manual</a>
<LI><a href="ReferencePages/index.html">Reference Manual</a> (Note: Requires doxygen
to be run in the directory /doc)
</UL>
<font face="arial,helvetica" color="#555588"><h2>H5Part Visualization Tools</h2></font>
<UL>
<LI><a href="H5PartExpress.html">H5Part Express Reader</a>
<!--<LI><a href="H5PartExpress.html">H5Part Express Reader</a>-->
<LI><a href="H5PartVisIt.html">H5Part VisIt Reader</a>
<LI><a href="H5PartIDL.html">H5Part IDL Reader</a>
<!--<LI><a href="H5PartIDL.html">H5Part IDL Reader</a>-->
<LI><a href="http://www.cscs.ch/a-display.php?id=170">H5Part sparticles Reader: developed at CSCS, Switzerland</a>
<LI><a href="H5PartPartView.html">PartView Visualization Application</a>
<LI><a href="http://vis.lbl.gov/Vignettes/PartView/index.html">PartView Visualization Application</a>
</UL>
</div>
+30 -8
View File
@@ -7,19 +7,40 @@ analysis needs to be preserved, reading and writing such enormous
restart files on massively parallel supercomputing systems remains
challenging.
H5Part consists of Particles, Block structured Fields and unstructured
data (Topo).
H5Part consists of Particles and Block structured Fields.
Developed by .
Developed by:
For further information contact: <a href="mailto:xxxxx">xxxxxx</a> -
xxxx xxxxx, (xxx) xxx.
<UL>
<LI> Andreas Adelmann (PSI) </LI>
<LI> Achim Gsell (PSI) </LI>
<LI> Benedikt Oswald (PSI) </LI>
<LI> Wes Bethel (NERSC/LBNL)</LI>
<LI> John Shalf (NERSC/LBNL)</LI>
<LI> Cristina Siegerist (NERSC/LBNL)</LI>
</UL>
Last modified on xxx xx, 2006.
Papers:
<a href="http://www-vis.lbl.gov/Research/AcceleratorSAPP/index.html">LBNL Vis Group </a><br>
<UL>
<LI> A. Adelmann, R.D. Ryne, C. Siegerist, J. Shalf,"From Visualization to Data Mining with Large Data Sets," <i>
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005. (LBNL-57603)
<a href="http://vis.lbl.gov/Publications/2005/FPAT082.pdf">FPAT082.pdf</a>
</LI>
<LI> A. Adelmann, R.D. Ryne, J. Shalf, C. Siegerist,"H5Part: A Portable High Performance Parallel Data Interface for Particle Simulations," <i>
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005.
<a href="http://vis.lbl.gov/Publications/2005/FPAT083.pdf">FPAT083.pdf</a>
</LI>
</UL>
For further information contact: <a href="mailto:h5part@lists.psi.ch">h5part</a>
Last modified on April 19, 2007.
*/
@@ -1601,7 +1622,8 @@ H5PartGetDatasetInfo (
f->groupname_step, f->stepno_width, (long long) f->timestep );
herr = _H5Part_get_object_name (
f->timegroup,
//f->timegroup,
f->file,
step_name,
H5G_DATASET,
idx,
+138 -127
View File
@@ -22,13 +22,14 @@
/*
bench <nParticles>
bench <nParticles>
*/
int main(int argc,char *argv[]){
printf("Start benchmarks...\n");
MPI_Info info;
int nprocs,rank;
int trial;
@@ -48,6 +49,7 @@ int main(int argc,char *argv[]){
H5PartFile *f;
#endif
char newfilename[128];
char lastfilename[128];
FILE *fd;
MPI_File file;
MPI_Offset foffset;
@@ -74,7 +76,7 @@ int main(int argc,char *argv[]){
/* printf("about to call create subarray with nparticles=%u localnp=%u offset=%u\n",
nparticles,localnp,offset); */
nparticles,localnp,offset); */
MPI_Type_create_subarray(1, /* rank */
&nparticles, /* size of the global array */
&localnp, /* size of my local chunk */
@@ -86,148 +88,157 @@ int main(int argc,char *argv[]){
MPI_Info_create(&info);
if(rank==0) printf("Nprocs=%u Particles=%u*6attribs*sizeof(double) Particles/proc=%u Nsteps=%u Ntrials=%u\n",
nprocs,nparticles,localnp,NSTEPS,NTRIALS);
nprocs,nparticles,localnp,NSTEPS,NTRIALS);
for(trial=0;trial<NTRIALS;trial++){
if(rank==0) printf("---------------------- Trial %u of %u ---------------------\n",trial+1,NTRIALS);
if(rank==0) printf("---------------------- Trial %u of %u ---------------------\n",trial+1,NTRIALS);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
sprintf(filename,"%s.%u.mpio.dat",FILENAME,nprocs);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
sprintf(filename,"%s.%u.mpio.dat",FILENAME,nprocs);
sprintf(lastfilename,"%s.%u.mpio.dat",FILENAME,nprocs);
if(rank==0) unlink(filename);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
if(rank==0) unlink(filename);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
MPI_File_open(MPI_COMM_WORLD,filename,
MPI_MODE_CREATE | MPI_MODE_RDWR,
info,&file);
MPI_File_open(MPI_COMM_WORLD,filename,
MPI_MODE_CREATE | MPI_MODE_RDWR,
info,&file);
MPI_File_set_view(file,0,MPI_DOUBLE,chunktype,"native",info);
/* now a barrier to get the start timers roughly synced*/
MPI_Barrier(MPI_COMM_WORLD);
curtime = starttime = MPI_Wtime();
endtime = starttime+5.0*60.0; /* end in 5 minutes */
MPI_Bcast(&endtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
/* must touch the entire array after each write */
/* ensures cache-invalidation */
foffset=0;
i=0;
curtime=starttime;
for(i=0;i<NSTEPS;i++){
int n;
MPI_Status status;
for(j=0;j<6;j++){
/* touch data */
for(n=0;n<localnp;n++)
(data[j])[n]=(double)rank;
/* write to that file */
/* MPI_File_set_view(file,foffset,MPI_DOUBLE,chunktype,"native",info);*/
MPI_File_write_at_all(file,
foffset,
data[j],
localnp,
MPI_DOUBLE,&status);
foffset+=nparticles/nprocs;
MPI_File_set_view(file,0,MPI_DOUBLE,chunktype,"native",info);
/* now a barrier to get the start timers roughly synced*/
MPI_Barrier(MPI_COMM_WORLD);
curtime = starttime = MPI_Wtime();
endtime = starttime+5.0*60.0; /* end in 5 minutes */
MPI_Bcast(&endtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
/* must touch the entire array after each write */
/* ensures cache-invalidation */
foffset=0;
i=0;
curtime=starttime;
for(i=0;i<NSTEPS;i++){
int n;
MPI_Status status;
for(j=0;j<6;j++){
/* touch data */
for(n=0;n<localnp;n++)
(data[j])[n]=(double)rank;
/* write to that file */
/* MPI_File_set_view(file,foffset,MPI_DOUBLE,chunktype,"native",info);*/
MPI_File_write_at_all(file,
foffset,
data[j],
localnp,
MPI_DOUBLE,&status);
foffset+=nparticles/nprocs;
}
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
}
MPI_File_close(&file);
MPI_Barrier(MPI_COMM_WORLD);
endtime=MPI_Wtime();
sprintf(filename,"%s.%u.h5.dat",FILENAME,nprocs);
/* foffset*=nprocs; if we want total megabytes written */
if(rank==0){
puts("*");
unlink(filename);
puts("======================================================");
printf("Raw MPI-IO Total Duration %lf seconds, iterations=%u %lf Megabytes written per processor Nprocs= %u \n",
(endtime-starttime),i,((double)foffset)/(1024.0*1024.0),nprocs);
printf("Raw MPI-IO Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
puts("======================================================");
}
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
}
MPI_File_close(&file);
MPI_Barrier(MPI_COMM_WORLD);
endtime=MPI_Wtime();
sprintf(filename,"%s.%u.h5.dat",FILENAME,nprocs);
/* foffset*=nprocs; if we want total megabytes written */
if(rank==0){
puts("*");
unlink(filename);
puts("======================================================");
printf("Raw MPI-IO Total Duration %lf seconds, iterations=%u %lf Megabytes written per processor Nprocs= %u \n",
(endtime-starttime),i,((double)foffset)/(1024.0*1024.0),nprocs);
printf("Raw MPI-IO Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
puts("======================================================");
}
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
/* OK, now we do this using H5Part */
sprintf(newfilename,"testio%u.%u.dat",rank,nprocs);
unlink(newfilename);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
fd = fopen(newfilename,"w");
/* start the timer */
starttime=endtime=MPI_Wtime();
for(i=0;i<NSTEPS;i++){
for(j=0;j<6;j++){
/* touch data */
for(n=0;n<localnp;n++)
(data[j])[n]=(double)rank;
fwrite(data[j],sizeof(double),localnp,fd);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
/* OK, now we do this using H5Part */
sprintf(newfilename,"testio%u.%u.dat",rank,nprocs);
unlink(newfilename);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
fd = fopen(newfilename,"w");
/* start the timer */
starttime=endtime=MPI_Wtime();
for(i=0;i<NSTEPS;i++){
for(j=0;j<6;j++){
/* touch data */
for(n=0;n<localnp;n++)
(data[j])[n]=(double)rank;
fwrite(data[j],sizeof(double),localnp,fd);
}
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
}
fclose(fd);
MPI_Barrier(MPI_COMM_WORLD);
endtime=MPI_Wtime();
if(rank==0) puts("*");
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
unlink(newfilename);
MPI_Barrier(MPI_COMM_WORLD);
if(rank==0){
puts("======================================================");
printf("Raw 1-file-per-proc Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
printf("Raw 1-file-per-proc Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
puts("======================================================");
}
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
}
fclose(fd);
MPI_Barrier(MPI_COMM_WORLD);
endtime=MPI_Wtime();
if(rank==0) puts("*");
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
unlink(newfilename);
MPI_Barrier(MPI_COMM_WORLD);
if(rank==0){
puts("======================================================");
printf("Raw 1-file-per-proc Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
printf("Raw 1-file-per-proc Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
puts("======================================================");
}
#ifndef DISABLE_H5PART
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
/* OK, now we do this using H5Part */
f = H5PartOpenFileParallel(filename,H5PART_WRITE,MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
/* start the timer */
starttime=endtime=MPI_Wtime();
H5PartSetNumParticles(f,localnp);
for(i=0;i<NSTEPS;i++){
for(j=0;j<6;j++){
/* touch data */
for(n=0;n<localnp;n++)
(data[j])[n]=(double)rank;
}
H5PartSetStep(f,i);
H5PartWriteDataFloat64(f,"x",x);
H5PartWriteDataFloat64(f,"y",y);
H5PartWriteDataFloat64(f,"z",z);
H5PartWriteDataFloat64(f,"px",px);
H5PartWriteDataFloat64(f,"py",py);
H5PartWriteDataFloat64(f,"pz",pz);
//printf("H5Part benchmark...");
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
/* OK, now we do this using H5Part */
f = H5PartOpenFileParallel(filename,H5PART_WRITE,MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
/* start the timer */
starttime=endtime=MPI_Wtime();
H5PartSetNumParticles(f,localnp);
for(i=0;i<NSTEPS;i++){
for(j=0;j<6;j++){
/* touch data */
for(n=0;n<localnp;n++)
(data[j])[n]=(double)rank;
}
H5PartSetStep(f,i);
H5PartWriteDataFloat64(f,"x",x);
H5PartWriteDataFloat64(f,"y",y);
H5PartWriteDataFloat64(f,"z",z);
H5PartWriteDataFloat64(f,"px",px);
H5PartWriteDataFloat64(f,"py",py);
H5PartWriteDataFloat64(f,"pz",pz);
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
}
H5PartCloseFile(f);
MPI_Barrier(MPI_COMM_WORLD);
endtime=MPI_Wtime();
if(rank==0){
puts("*");
unlink(filename);
puts("======================================================");
printf("H5Part Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
printf("H5Part Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
puts("======================================================");
}
MPI_Barrier(MPI_COMM_WORLD);
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
}
H5PartCloseFile(f);
MPI_Barrier(MPI_COMM_WORLD);
endtime=MPI_Wtime();
if(rank==0){
puts("*");
unlink(filename);
puts("======================================================");
printf("H5Part Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
printf("H5Part Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
puts("======================================================");
}
MPI_Barrier(MPI_COMM_WORLD);
#endif
} /* trials */
if (rank==0) {
printf("lastfilename: %s \n", lastfilename);
unlink(lastfilename);
}
MPI_Finalize();
return 0;
}