示例#1
0
def test_defaults():
    chunk_cache_mem_size = 1024**2
    w0 = 0.75
    n_cache_chunks = int(np.ceil(np.sqrt(chunk_cache_mem_size / 8)))
    nslots = _find_next_prime(100 * n_cache_chunks)
    d = tempfile.mkdtemp()
    try:
        with File(os.path.join(d, 'defaults.h5')) as f:
            mdc, rdcc, rdcc_nbytes, rdcc_w0 = f.id.get_access_plist().get_cache()
            assert mdc == 0
            assert rdcc == nslots
            assert rdcc_nbytes == chunk_cache_mem_size
            assert rdcc_w0 == w0
    finally:
        shutil.rmtree(d)
示例#2
0
def test_defaults():
    chunk_cache_mem_size = 1024**2
    w0 = 0.75
    n_cache_chunks = int(np.ceil(np.sqrt(chunk_cache_mem_size / 8)))
    nslots = _find_next_prime(100 * n_cache_chunks)
    d = tempfile.mkdtemp()
    try:
        with File(os.path.join(d, 'defaults.h5')) as f:
            mdc, rdcc, rdcc_nbytes, rdcc_w0 = f.id.get_access_plist(
            ).get_cache()
            assert mdc == 0
            assert rdcc == nslots
            assert rdcc_nbytes == chunk_cache_mem_size
            assert rdcc_w0 == w0
    finally:
        shutil.rmtree(d)
示例#3
0
def test_args():
    chunk_cache_mem_size = 8*1024**2
    w0 = 0.25
    n_cache_chunks = 8000
    nslots = _find_next_prime(100 * n_cache_chunks)
    d = tempfile.mkdtemp()
    try:
        with File(os.path.join(d, 'args.h5'), chunk_cache_mem_size=chunk_cache_mem_size,
                  w0=w0, n_cache_chunks=n_cache_chunks) as f:
            mdc, rdcc, rdcc_nbytes, rdcc_w0 = f.id.get_access_plist().get_cache()
            assert mdc == 0
            assert rdcc == nslots
            assert rdcc_nbytes == chunk_cache_mem_size
            assert rdcc_w0 == w0
    finally:
        shutil.rmtree(d)
示例#4
0
def test_args():
    chunk_cache_mem_size = 8 * 1024**2
    w0 = 0.25
    n_cache_chunks = 8000
    nslots = _find_next_prime(100 * n_cache_chunks)
    d = tempfile.mkdtemp()
    try:
        with File(os.path.join(d, 'args.h5'),
                  chunk_cache_mem_size=chunk_cache_mem_size,
                  w0=w0,
                  n_cache_chunks=n_cache_chunks) as f:
            mdc, rdcc, rdcc_nbytes, rdcc_w0 = f.id.get_access_plist(
            ).get_cache()
            assert mdc == 0
            assert rdcc == nslots
            assert rdcc_nbytes == chunk_cache_mem_size
            assert rdcc_w0 == w0
    finally:
        shutil.rmtree(d)