[H5r-commits] r70 - / src tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 22 01:17:38 CEST 2011


Author: extemporaneousb
Date: 2011-10-22 01:17:38 +0200 (Sat, 22 Oct 2011)
New Revision: 70

Modified:
   DESCRIPTION
   src/h5_wrap.c
   tests/testMemory.R
Log:
Changed some of the H5 macros to explicitly call functions.



Modified: DESCRIPTION
===================================================================
--- DESCRIPTION	2011-09-20 07:16:02 UTC (rev 69)
+++ DESCRIPTION	2011-10-21 23:17:38 UTC (rev 70)
@@ -5,7 +5,7 @@
 Date: 2011-09-19
 Author: James Bullard
 Maintainer: <jbullard at pacificbiosciences.com>
-Depends: R (>= 2.11.0), methods, base
+Depends: R (>= 2.10.0), methods, base
 Description: A package for interfacing with HDF5 files.
 License: LGPL
 

Modified: src/h5_wrap.c
===================================================================
--- src/h5_wrap.c	2011-09-20 07:16:02 UTC (rev 69)
+++ src/h5_wrap.c	2011-10-21 23:17:38 UTC (rev 70)
@@ -78,15 +78,15 @@
 }
 
 SEXP h5R_get_group(SEXP h5_obj, SEXP group_name) {
-    return _h5R_make_holder(H5Gopen(HID(h5_obj), NM(group_name), H5P_DEFAULT), 0);
+    return _h5R_make_holder(H5Gopen2(HID(h5_obj), NM(group_name), H5P_DEFAULT), 0);
 }
 
 SEXP h5R_create_group(SEXP h5_obj, SEXP group_name) {
-    return _h5R_make_holder(H5Gcreate(HID(h5_obj), NM(group_name), H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT), 0);
+    return _h5R_make_holder(H5Gcreate2(HID(h5_obj), NM(group_name), H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT), 0);
 }
 
 SEXP h5R_get_dataset(SEXP h5_obj, SEXP dataset_name) {
-    return _h5R_make_holder(H5Dopen(HID(h5_obj), NM(dataset_name), H5P_DEFAULT), 0);
+    return _h5R_make_holder(H5Dopen2(HID(h5_obj), NM(dataset_name), H5P_DEFAULT), 0);
 }
 
 SEXP h5R_get_attr(SEXP h5_obj, SEXP attr_name) {
@@ -330,8 +330,8 @@
     H5Pset_chunk(cparms, length(chunks), chunk_lens);
     
     hid_t dataspace = H5Screate_simple(length(dims), current_dims, max_dims);
-    hid_t dataset   = H5Dcreate(HID(h5_obj), NM(name), memtype, 
-				dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
+    hid_t dataset   = H5Dcreate2(HID(h5_obj), NM(name), memtype, 
+				 dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
     
     H5Pclose(cparms);
     H5Sclose(dataspace);
@@ -615,7 +615,7 @@
     }
     
     hid_t dataspace = H5Screate_simple(length(dims), current_dims, max_dims);
-    hid_t attribute = H5Acreate(HID(h5_obj), NM(name), memtype, 
+    hid_t attribute = H5Acreate2(HID(h5_obj), NM(name), memtype, 
 				dataspace, H5P_DEFAULT, H5P_DEFAULT);
     
     H5Sclose(dataspace);
@@ -774,7 +774,7 @@
     hsize_t n   = 0;
     SEXP dta;
 
-    H5Aiterate(HID(h5_obj), H5_INDEX_NAME, H5_ITER_NATIVE, &n, (H5A_operator2_t) _h5R_count_func, (void*) &counter);
+    H5Aiterate2(HID(h5_obj), H5_INDEX_NAME, H5_ITER_NATIVE, &n, (H5A_operator2_t) _h5R_count_func, (void*) &counter);
     
     __index_and_SEXP__* isxp = (__index_and_SEXP__*) Calloc(1, __index_and_SEXP__);
     PROTECT(dta = allocVector(STRSXP, counter));
@@ -782,7 +782,7 @@
     isxp->i = 0;
     
     n = 0;
-    H5Aiterate(HID(h5_obj), H5_INDEX_NAME, H5_ITER_NATIVE, &n, (H5A_operator2_t) _h5R_capture_name, (void*) isxp);
+    H5Aiterate2(HID(h5_obj), H5_INDEX_NAME, H5_ITER_NATIVE, &n, (H5A_operator2_t) _h5R_capture_name, (void*) isxp);
 
     Free(isxp);
     UNPROTECT(1);

Modified: tests/testMemory.R
===================================================================
--- tests/testMemory.R	2011-09-20 07:16:02 UTC (rev 69)
+++ tests/testMemory.R	2011-10-21 23:17:38 UTC (rev 70)
@@ -1,38 +1,46 @@
 ##
+## This isn't really a test of the h5r package - so probably best to
+## just comment it out. Mostly, this is about me allocating too small
+## chunks of memory and then running out.
+##
+
+##
 ## Currently, it seems as if I hold on to too much memory - this
 ## corresponds to me not cleaning something up in HDF5 because
 ## Valgrind says I'm fine.
 ##
-require(h5r)
+## require(h5r)
 
-showPS <- function() system(paste('ps -eo pid,vsz,%mem | grep', Sys.getpid()))
-gcl <- function() { lapply(1:10, gc, verbose = F)[[10]] }
 
-showPS()
-m <- .Call("h5R_allocate_gig")
-rm(m)
-gcl()
-showPS()
 
-m <- sapply(1:1000, function(a) {
-  .Call("h5R_allocate_meg")
-})
-rm(m)
-gcl()
-showPS()
+## showPS <- function() system(paste('ps -eo pid,vsz,%mem | grep', Sys.getpid()))
+## gcl <- function() { lapply(1:10, gc, verbose = F)[[10]] }
 
-m <- sapply(1:100000, function(a) {
-  .Call("h5R_allocate_k")
-})
-rm(m)
-gcl()
-showPS()
+## showPS()
+## m <- .Call("h5R_allocate_gig")
+## rm(m)
+## gcl()
+## showPS()
 
-m <- sapply(1:1000000, function(a) {
-  .Call("h5R_allocate_k")
-})
-rm(m)
-gcl()
-showPS()
+## m <- sapply(1:1000, function(a) {
+##   .Call("h5R_allocate_meg")
+## })
+## rm(m)
+## gcl()
+## showPS()
 
+## m <- sapply(1:100000, function(a) {
+##   .Call("h5R_allocate_k")
+## })
+## rm(m)
+## gcl()
+## showPS()
 
+## m <- sapply(1:1000000, function(a) {
+##   .Call("h5R_allocate_k")
+## })
+## rm(m)
+## gcl()
+## showPS()
+
+



More information about the H5r-commits mailing list