From 9d1ffc4cb64e031d34f4f274efa662c3ebfde4e2 Mon Sep 17 00:00:00 2001 From: q-posev <45995097+q-posev@users.noreply.github.com> Date: Mon, 14 Jun 2021 07:35:37 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20TREX-CoE?= =?UTF-8?q?/trexio@cdf25b41621a5f05e8a605f7e0f8824592cc486c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.html | 4 +- index.html | 4 +- templator_front.html | 273 ++++++++++++++++++++++++++++--------------- templator_hdf5.html | 40 +++---- templator_text.html | 100 ++++++++-------- 5 files changed, 254 insertions(+), 167 deletions(-) diff --git a/README.html b/README.html index 6924990..843d76c 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +stdint.h
Memory allocation of structures can be facilitated by using the @@ -424,8 +424,8 @@ The maximum string size for the filenames is 4096 characters.
All calls to TREXIO are thread-safe. @@ -433,10 +433,10 @@ TREXIO front end is modular, which simplifies implementation of new back ends.
The C
templates that correspond to each of the abovementioned
@@ -1599,8 +1624,8 @@ precision (see Table above).
The Fortran
templates that provide an access to the C
API calls from Fortran.
@@ -1686,8 +1711,8 @@ These templates are based on the use of iso_c_binding
. Pointers hav
This section concerns API calls related to datasets. @@ -1756,8 +1781,8 @@ This section concerns API calls related to datasets.
The C templates that correspond to each of the abovementioned functions can be found below. @@ -1781,6 +1806,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T /* Error handling for this call is added by the generator */ rc = trexio_read_$group_dset_dim$_64(file, &($group_dset_dim$)); + if (rc != TREXIO_SUCCESS) return rc; if ($group_dset_dim$ == 0L) return TREXIO_INVALID_NUM; @@ -1789,22 +1815,36 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T assert(file->back_end < TREXIO_INVALID_BACK_END); + rc = TREXIO_FAILURE; switch (file->back_end) { case TREXIO_TEXT: - return trexio_text_read_$group_dset$(file, $group_dset$, rank, dims); + rc = trexio_text_read_$group_dset$(file, $group_dset$, rank, dims); break; case TREXIO_HDF5: - return trexio_hdf5_read_$group_dset$(file, $group_dset$, rank, dims); + rc = trexio_hdf5_read_$group_dset$(file, $group_dset$, rank, dims); break; /* case TREXIO_JSON: - return trexio_json_read_$group_dset$(file, $group_dset$, rank, dims); + rc = trexio_json_read_$group_dset$(file, $group_dset$, rank, dims); break; */ } - return TREXIO_FAILURE; + if (rc != TREXIO_SUCCESS) return rc; + + /* Handle index type */ + if ($is_index$) { + uint64_t dim_size = 1; + for (uint32_t i=0; i<rank; ++i){ + dim_size *= dims[i]; + } + for (uint64_t i=0; i<dim_size; ++i){ + $group_dset$[i] += ($group_dset_dtype_single$) 1; + } + } + + return TREXIO_SUCCESS; }
The Fortran
templates that provide an access to the C
API calls from Fortran
.
@@ -2110,8 +2188,8 @@ These templates are based on the use of iso_c_binding
. Pointers hav
Sparse data structures are used typically for large tensors such as @@ -2253,8 +2331,8 @@ For the values,
The function below adapts the original C-based trexio_open
for Fortran.
@@ -2268,13 +2346,22 @@ Note, that Fortran interface calls the main TREXIO
API, which is wr
integer(8) function trexio_open (filename, mode, backend)
use, intrinsic :: iso_c_binding
implicit none
- character(len=*) :: filename
- character, intent(in), value :: mode
+ character(len=*) :: filename
+ character, intent(in), value :: mode
integer(trexio_backend), intent(in), value :: backend
character(len=len_trim(filename)+1) :: filename_c
+ integer :: rc
filename_c = trim(filename) // c_null_char
trexio_open = trexio_open_c(filename_c, mode, backend)
+ if (trexio_open == 0_8) then
+ return
+ endif
+ rc = trexio_set_one_based(trexio_open)
+ if (rc /= TREXIO_SUCCESS) then
+ rc = trexio_close(trexio_open)
+ trexio_open = 0_8
+ endif
end function trexio_open
TREXIO
API, which is wr
#define $GROUP$_GROUP_NAME "$group$" @@ -340,8 +340,8 @@ for the JavaScript code in this tag.
typedef struct trexio_hdf5_s { @@ -356,8 +356,8 @@ for the JavaScript code in this tag.
trexio_exit_code
@@ -437,8 +437,8 @@ for the JavaScript code in this tag.
trexio_exit_code
@@ -560,8 +560,8 @@ for the JavaScript code in this tag.
trexio_exit_code
@@ -695,7 +695,7 @@ for the JavaScript code in this tag.
$group_num$
attribute$group_dset$
dataset$group_num$
attribute$group_dset$
datasetThe "file" produced by the text back end is a directory with one @@ -359,8 +359,8 @@ The file is written when closed, or when the flush function is called.
typedef struct $group$_s { @@ -376,8 +376,8 @@ The file is written when closed, or when the flush function is called.
typedef struct rdm_s { @@ -403,8 +403,8 @@ The file is written when closed, or when the flush function is called.
trexio_exit_code
@@ -505,8 +505,8 @@ The file is written when closed, or when the flush function is called.
trexio_exit_code
@@ -531,8 +531,8 @@ The file is written when closed, or when the flush function is called.
$group$_t* @@ -698,8 +698,8 @@ trexio_text_read_$group$ (trexio_text_t*
trexio_exit_code @@ -758,8 +758,8 @@ trexio_text_read_$group$ (trexio_text_t*
Memory is allocated when reading. The following function frees memory. @@ -795,8 +795,8 @@ Memory is allocated when reading. The following function frees memory.
$group_num$
attribute$group_num$
attributetrexio_exit_code
@@ -858,8 +858,8 @@ Memory is allocated when reading. The following function frees memory.
$group_dset$
dataset$group_dset$
dataset
The group_dset
array is assumed allocated with the appropriate size.
@@ -956,12 +956,12 @@ The group_dset
array is assumed allocated with the appropriate size
rdm_t* trexio_text_read_rdm(trexio_text_t* const file);
@@ -1056,8 +1056,8 @@ The group_dset
array is assumed allocated with the appropriate size
trexio_exit_code trexio_text_flush_rdm(trexio_text_t* const file);
@@ -1099,8 +1099,8 @@ The group_dset
array is assumed allocated with the appropriate size
Memory is allocated when reading. The followig function frees memory. @@ -1136,8 +1136,8 @@ Memory is allocated when reading. The followig function frees memory.
The one_e
array is assumed allocated with the appropriate size.
@@ -1203,8 +1203,8 @@ The one_e
array is assumed allocated with the appropriate size.
two_e
is a sparse data structure, which can be too large to fit
@@ -1312,7 +1312,7 @@ file for each sparse float structure.