-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
428 additions
and
558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This file is to test collective io in h5py | ||
|
||
""" | ||
Author: Jialin Liu, [email protected] | ||
Date: Nov 17, 2015 | ||
|
@@ -14,14 +14,14 @@ | |
import time | ||
import sys | ||
|
||
#"run as "mpirun -np 64 python-mpi collective_io.py 1 file.h5" | ||
#"run as "mpirun -np 64 python-mpi collective_io.py 1 file.h5" | ||
#(1 is for collective write, other numbers for non-collective write)" | ||
|
||
colw=1 #default is collective write | ||
filename="parallel_test.hdf5" | ||
if len(sys.argv)>2: | ||
colw = int(sys.argv[1]) | ||
filename=str(sys.argv[2]) | ||
colw = int(sys.argv[1]) | ||
filename=str(sys.argv[2]) | ||
comm =MPI.COMM_WORLD | ||
nproc = comm.Get_size() | ||
f = h5py.File(filename, 'w', driver='mpio', comm=MPI.COMM_WORLD) | ||
|
@@ -42,17 +42,17 @@ | |
end=start+length_last_rank | ||
temp=np.random.random((end-start,length_y)) | ||
if colw==1: | ||
with dset.collective: | ||
dset[start:end,:] = temp | ||
else : | ||
dset[start:end,:] = temp | ||
with dset.collective: | ||
dset[start:end,:] = temp | ||
else: | ||
dset[start:end,:] = temp | ||
comm.Barrier() | ||
timeend=MPI.Wtime() | ||
if rank==0: | ||
if colw==1: | ||
print "collective write time %f" %(timeend-timestart) | ||
else : | ||
print "independent write time %f" %(timeend-timestart) | ||
print "collective write time %f" %(timeend-timestart) | ||
else: | ||
print "independent write time %f" %(timeend-timestart) | ||
print "data size x: %d y: %d" %(length_x, length_y) | ||
print "file size ~%d GB" % (length_x*length_y/1024.0/1024.0/1024.0*8.0) | ||
print "number of processes %d" %nproc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.