Commit 7be12b4a authored by Huihuo Zheng's avatar Huihuo Zheng
Browse files

fixed memory page issue

parent 8d115c51
......@@ -41,7 +41,9 @@ void *H5Dread_pthread_func(void *args) {
if (H5DMM.num_request > 0) {
char *p_mmap = (char *) H5DMM.buf;
char *p_mem = (char *) H5DMM.tmp_buf;
//MPI_Barrier(MPI_COMM_WORLD);
MPI_Win_fence(MPI_MODE_NOPRECEDE, H5DMM.win);
//MPI_Win_fence(0, H5DMM.win);
int batch_size = H5DMM.batch_list.size();
if (H5DMM.batch_contig) {
int dest = H5DMM.batch_list[0];
......@@ -74,7 +76,9 @@ void *H5Dread_pthread_func(void *args) {
H5DMM.buf_type, H5DMM.win);
}
}
MPI_Win_fence(MPI_MODE_NOPRECEDE | MPI_MODE_NOSTORE, H5DMM.win);
MPI_Win_fence(MPI_MODE_NOSUCCEED, H5DMM.win);
//MPI_Barrier(MPI_COMM_WORLD);
//MPI_Win_fence(0, H5DMM.win);
H5DMM.num_request--;
} else {
......@@ -149,7 +153,7 @@ void create_mmap(char *path, H5Dio_mmap &f) {
fsync(fh);
close(fh);
f.fd = open(f.filename, O_RDWR);
f.buf = mmap(NULL, f.size, PROT_READ | PROT_WRITE, MAP_SHARED, f.fd, 0);
f.buf = mmap(NULL, ss, PROT_READ | PROT_WRITE, MAP_SHARED, f.fd, 0);
msync(f.buf, ss, MS_SYNC);
} else {
if (io_node()==f.rank and debug_level()>1)
......@@ -308,6 +312,7 @@ herr_t H5Dread_from_cache(hid_t dataset_id, hid_t mem_type_id,
H5DMM.buf_type, H5DMM.win);
}
MPI_Win_fence(MPI_MODE_NOPUT, H5DMM.win);
return 0;
}
......
#Makefile
CXX=mpicxx -g
CXX=CC -g
CFLAGS=-I$(HDF5_ROOT)/include -O3 -I../utils
HDF5_LIB=-L$(HDF5_ROOT)/lib -lhdf5
%.o: %.cpp
$(CXX) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
all: read_dataset_cache #prepare_dataset
all: test_mmap read_dataset_cache #prepare_dataset
test_mmap: test_mmap.o
$(CXX) $(CFLAGS) -o $@ $<
read_dataset_cache: read_dataset_cache.o H5Dio_cache.o ../utils/debug.o
$(CXX) $(CFLAGS) -o $@ read_dataset_cache.o H5Dio_cache.o ../utils/debug.o $(HDF5_LIB) -lpthread
prepare_dataset: prepare_dataset.o
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment