Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ExaHDF5
node_local_storage
Commits
400350a9
Commit
400350a9
authored
Mar 26, 2020
by
Huihuo Zheng
Browse files
changed function API
parent
30624b91
Changes
6
Hide whitespace changes
Inline
Side-by-side
hdf5_read/H5Dio_cache.h
View file @
400350a9
...
...
@@ -27,7 +27,7 @@ struct H5Dio_mmap {
hid_t
datatype
;
//
bool
batch_contig
;
vector
<
int
>
batch_list
;
MPI_Datatype
buf_type
;
MPI_Datatype
buf_type
;
// we construct a datatype construct
MPI_Win
win
;
pthread_t
pthread
;
pthread_cond_t
master_cond
;
...
...
hdf5_write/H5SSD.c
View file @
400350a9
...
...
@@ -211,11 +211,10 @@ hid_t H5Fcreate_cache( const char *name, unsigned flags, hid_t fcpl_id, hid_t fa
herr_t
H5Dwrite_cache
(
hid_t
dataset_id
,
hid_t
mem_type_id
,
hid_t
mem_space_id
,
hid_t
file_space_id
,
hid_t
dxpl_id
,
const
void
*
buf
)
{
// H5Fwait();
hsize_t
size
=
get_buf_size
(
mem_space_id
,
mem_type_id
);
if
(
H5SSD
.
mspace_per_rank_left
<
size
)
{
H5
Fw
ait
();
H5
PthreadW
ait
();
H5SSD
.
offset
=
0
;
H5SSD
.
mspace_per_rank_left
=
H5SSD
.
mspace_per_rank_total
;
}
...
...
@@ -248,7 +247,7 @@ H5Dwrite_cache(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
/*
Wait for the pthread to finish all the I/O request
*/
void
H5
Fw
ait
()
{
void
H5
PthreadW
ait
()
{
pthread_mutex_lock
(
&
H5SSD
.
request_lock
);
while
(
H5SSD
.
num_request
>
0
)
{
pthread_cond_signal
(
&
H5SSD
.
io_cond
);
...
...
@@ -260,7 +259,7 @@ void H5Fwait() {
/*
Terminate the pthread through joining
*/
void
H5Terminate
Pthread
()
{
void
H5
Pthread
Terminate
()
{
pthread_mutex_lock
(
&
H5SSD
.
request_lock
);
H5SSD
.
num_request
=-
1
;
pthread_cond_signal
(
&
H5SSD
.
io_cond
);
...
...
@@ -273,8 +272,8 @@ void H5TerminatePthread() {
and terminate the pthread, remove the files on the SSD.
*/
herr_t
H5Fclose_cache
(
hid_t
file_id
)
{
H5
Fw
ait
();
H5Terminate
Pthread
();
H5
PthreadW
ait
();
H5
Pthread
Terminate
();
close
(
H5SSD
.
fd
);
remove
(
H5SSD
.
fname
);
H5SSD
.
mspace_left
=
H5SSD
.
mspace_total
;
...
...
@@ -285,7 +284,7 @@ herr_t H5Fclose_cache( hid_t file_id ) {
Wait for pthread to finish the work and close the property
*/
herr_t
H5Pclose_cache
(
hid_t
dxf_id
)
{
H5
Fw
ait
();
H5
PthreadW
ait
();
return
H5Pclose
(
dxf_id
);
}
...
...
@@ -293,7 +292,7 @@ herr_t H5Pclose_cache(hid_t dxf_id) {
Wait for pthread to finish the work and close the dataset
*/
herr_t
H5Dclose_cache
(
hid_t
dset_id
)
{
H5
Fw
ait
();
H5
PthreadW
ait
();
return
H5Dclose
(
dset_id
);
}
...
...
@@ -302,6 +301,6 @@ herr_t H5Dclose_cache(hid_t dset_id) {
Wait for the pthread to finish the work and close the memory space
*/
herr_t
H5Sclose_cache
(
hid_t
filespace
)
{
H5
Fw
ait
();
H5
PthreadW
ait
();
return
H5Sclose
(
filespace
);
}
hdf5_write/H5SSD.h
View file @
400350a9
...
...
@@ -12,7 +12,7 @@ herr_t H5Dwrite_cache(hid_t dset_id, hid_t mem_type_id,
herr_t
H5Dclose_cache
(
hid_t
id
);
herr_t
H5Pclose_cache
(
hid_t
id
);
herr_t
H5Sclose_cache
(
hid_t
id
);
void
H5
Fw
ait
();
void
H5
PthreadW
ait
();
void
test_mmap_buf
();
...
...
hdf5_write/Makefile
View file @
400350a9
...
...
@@ -4,8 +4,8 @@ include make.inc
all
:
parallel_hdf5
parallel_hdf5
:
H5SSD.o parallel_hdf5.o
$(CXX)
$(CFLAGS)
-I
./
-o
parallel_hdf5.x parallel_hdf5.o H5SSD.o
$(LIBS)
parallel_hdf5
:
H5SSD.o parallel_hdf5.o
../utils/debug.o
$(CXX)
$(CFLAGS)
-I
./
-o
parallel_hdf5.x parallel_hdf5.o H5SSD.o
../utils/debug.o
$(LIBS)
parallel_hdf5.o
:
parallel_hdf5.cpp
$(CXX)
$(CFLAGS)
-o
parallel_hdf5.o
-c
parallel_hdf5.cpp
H5SSD.o
:
H5SSD.c
...
...
hdf5_write/parallel_hdf5.cpp
View file @
400350a9
...
...
@@ -19,6 +19,7 @@
#include <sys/statvfs.h>
#include <stdlib.h>
#include "stat.h"
#include "debug.h"
int
msleep
(
long
miliseconds
)
{
struct
timespec
req
,
rem
;
...
...
@@ -45,7 +46,7 @@ int main(int argc, char **argv) {
if
(
strcmp
(
ssd_cache
,
"yes"
)
==
0
)
{
cache
=
true
;
}
Timing
tt
;
// Assuming that the dataset is a two dimensional array of 8x5 dimension;
int
d1
=
2048
;
int
d2
=
2048
;
...
...
@@ -77,6 +78,7 @@ int main(int argc, char **argv) {
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_size
(
comm
,
&
nproc
);
MPI_Comm_rank
(
comm
,
&
rank
);
Timing
tt
(
rank
==
io_node
());
//printf(" MPI: I am rank %d of %d \n", rank, nproc);
// find local array dimension and offset;
hsize_t
gdims
[
2
]
=
{
d1
*
nproc
,
d2
};
...
...
@@ -179,7 +181,6 @@ int main(int argc, char **argv) {
stat
(
&
tt
[
"H5Dwrite"
].
t_iter
[
0
],
niter
,
avg
,
std
,
'i'
);
if
(
rank
==
0
)
printf
(
" Write rate: %f +/- %f MB/s
\n
"
,
size
*
avg
/
niter
/
1024
/
1024
,
size
/
niter
*
std
/
1024
/
1024
);
tt
.
PrintTiming
(
master
);
MPI_Finalize
();
return
0
;
}
hdf5_write/run.py
View file @
400350a9
...
...
@@ -23,8 +23,8 @@ if hostname.find("theta")!=-1:
parser
.
add_argument
(
"--num_nodes"
,
default
=
int
(
os
.
environ
[
'COBALT_JOBSIZE'
]),
type
=
int
)
parser
.
add_argument
(
"--ppn"
,
default
=
32
,
type
=
int
)
else
:
#
root="/Users/zhenghh/Documents/Research/ExaHDF5/io_benchmarks/ssd_cache/hdf5/"
root
=
"/gpfs/mira-home/hzheng/io_benchmarks/node_local_storage/hdf5/"
root
=
"/Users/zhenghh/Documents/Research/ExaHDF5/io_benchmarks/ssd_cache/hdf5/"
#
root="/gpfs/mira-home/hzheng/io_benchmarks/node_local_storage/hdf5/"
parser
.
add_argument
(
"--num_nodes"
,
default
=
1
,
type
=
int
)
parser
.
add_argument
(
"--SSD"
,
default
=
"SSD"
)
parser
.
add_argument
(
"--ppn"
,
default
=
2
,
type
=
int
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment