Skip to content

Commit

Permalink
Merge dc83268 into 99c9718
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Sep 13, 2017
2 parents 99c9718 + dc83268 commit 2a864b8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 27 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
julia 0.5
BinDeps 0.6.0
Blosc
Compat 0.24.0
Compat 0.27.0
@osx Homebrew 0.3.1
@windows WinRPM
5 changes: 3 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BinDeps
using Compat

@BinDeps.setup

Expand All @@ -23,12 +24,12 @@ provides(Pacman, "hdf5", hdf5, os=:Linux)
provides(Yum, "hdf5", hdf5, os=:Linux)
provides(BSDPkg, "hdf5", hdf5, os=:FreeBSD)

if is_windows()
if Sys.iswindows()
using WinRPM
provides(WinRPM.RPM, "hdf5", hdf5, os=:Windows)
end

if is_apple()
if Sys.isapple()
using Homebrew
provides(Homebrew.HB, "hdf5", hdf5, os=:Darwin)
end
Expand Down
3 changes: 2 additions & 1 deletion src/HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,8 @@ else
const H5RDEREFERENCE = :H5Rdereference
end
function h5r_dereference(obj_id::Hid, ref_type::Integer, pointee::HDF5ReferenceObj)
ret = ccall((H5RDEREFERENCE, libhdf5), Hid, (Hid, Cint, Ptr{HDF5ReferenceObj}), obj_id, ref_type, &pointee)
ret = ccall((H5RDEREFERENCE, libhdf5), Hid, (Hid, Cint, Ref{HDF5ReferenceObj}),
obj_id, ref_type, pointee)
if ret < 0
error("Error dereferencing object")
end
Expand Down
24 changes: 12 additions & 12 deletions src/blosc_filter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function blosc_filter(flags::Cuint, cd_nelmts::Csize_t,
status = Blosc.blosc_decompress(unsafe_load(buf), outbuf, outbuf_size)
status <= 0 && (Libc.free(outbuf); return convert(Csize_t, 0))
end

if status != 0
Libc.free(unsafe_load(buf))
unsafe_store!(buf, outbuf)
Expand All @@ -119,18 +119,18 @@ end

# register the Blosc filter function with HDF5
function register_blosc()
c_blosc_set_local = cfunction(blosc_set_local, Herr, (Hid,Hid,Hid))
c_blosc_set_local = cfunction(blosc_set_local, Herr, Tuple{Hid,Hid,Hid})
c_blosc_filter = cfunction(blosc_filter, Csize_t,
(Cuint, Csize_t, Ptr{Cuint}, Csize_t,
Ptr{Csize_t}, Ptr{Ptr{Void}}))
if ccall((:H5Zregister, libhdf5), Herr, (Ptr{H5Z_class2_t},),
&H5Z_class2_t(H5Z_CLASS_T_VERS,
FILTER_BLOSC,
1, 1,
pointer(blosc_name),
C_NULL,
c_blosc_set_local,
c_blosc_filter)) < 0
Tuple{Cuint, Csize_t, Ptr{Cuint}, Csize_t,
Ptr{Csize_t}, Ptr{Ptr{Void}}})
if ccall((:H5Zregister, libhdf5), Herr, (Ref{H5Z_class2_t},),
H5Z_class2_t(H5Z_CLASS_T_VERS,
FILTER_BLOSC,
1, 1,
pointer(blosc_name),
C_NULL,
c_blosc_set_local,
c_blosc_filter)) < 0
error("can't register Blosc filter")
end
end
Expand Down
20 changes: 10 additions & 10 deletions test/readremote.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ using Base.Test
@testset "readremote" begin

# check that we can read the official HDF5 example files
const urlbase = "https://support.hdfgroup.org/ftp/HDF5/examples/files/exbyapi/"
urlbase = "https://support.hdfgroup.org/ftp/HDF5/examples/files/exbyapi/"

const fcmp = [0 1 2 3 4 5 6;
fcmp = [0 1 2 3 4 5 6;
2 1.66667 2.4 3.28571 4.22222 5.18182 6.15385;
4 2.33333 2.8 3.57143 4.44444 5.36364 6.30769;
6 3 3.2 3.85714 4.66667 5.54545 6.46154]'
const icmp = [0 -1 -2 -3 -4 -5 -6;
icmp = [0 -1 -2 -3 -4 -5 -6;
0 0 0 0 0 0 0;
0 1 2 3 4 5 6;
0 2 4 6 8 10 12]'
const SOLID, LIQUID, GAS, PLASMA = 0, 1, 2, 3
const ecmp = [SOLID SOLID SOLID SOLID SOLID SOLID SOLID;
SOLID, LIQUID, GAS, PLASMA = 0, 1, 2, 3
ecmp = [SOLID SOLID SOLID SOLID SOLID SOLID SOLID;
SOLID LIQUID GAS PLASMA SOLID LIQUID GAS;
SOLID GAS SOLID GAS SOLID GAS SOLID;
SOLID PLASMA GAS LIQUID SOLID PLASMA GAS]'
const scmp = ["Parting", "is such", "sweet", "sorrow."]
const vicmp = Array{Int32}[[3, 2, 1],[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]]
const opq = Array{UInt8}[[0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x30],
scmp = ["Parting", "is such", "sweet", "sorrow."]
vicmp = Array{Int32}[[3, 2, 1],[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]]
opq = Array{UInt8}[[0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x30],
[0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x31],
[0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x32],
[0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x33]]
# For H5T_ARRAY
const AA = Array{Int,2}[
AA = Array{Int,2}[
[0 0 0;
0 -1 -2;
0 -2 -4;
Expand All @@ -49,7 +49,7 @@ const AA = Array{Int,2}[
12 11 10]]


const savedir = "test_files"
savedir = "test_files"
if !isdir(savedir)
mkdir(savedir)
end
Expand Down
2 changes: 1 addition & 1 deletion test/swmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function dataset_write(d, ch_written, ch_read)
for i=1:10
@assert take!(ch_read) == true
set_dims!(d, (i*10,))
inds = (1:10)+(i-1)*10
inds = (1:10) .+ (i - 1) * 10
inds, size(d)
d[inds] = inds
flush(d) # flush the dataset
Expand Down

0 comments on commit 2a864b8

Please sign in to comment.