1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-09-27 03:51:07 +02:00
Commit Graph

500 Commits

Author SHA1 Message Date
q-posev
c4177465bc Add safe and Fortran APIs for determinants 2022-04-12 16:34:42 +02:00
q-posev
1dc0f0f089 Manually add source code for determinants 2022-04-12 11:49:02 +02:00
q-posev
722453688b Fix EOF detection for an arbitrary ranked dset 2022-04-12 11:48:21 +02:00
q-posev
4904de5674 Fix bug with broken data offset upon writing 2022-04-12 11:47:07 +02:00
q-posev
738d8de5ca TEXT back end working 2022-04-12 00:41:57 +02:00
ac41cd6080 Implement HDF5 functions for determinant_list I/O 2022-04-11 16:33:01 +02:00
a3f70336d7 Add calls to HDF5 back end; overwrite determinant_num 2022-04-11 16:32:23 +02:00
7d640b06dd Reformat 2022-04-11 16:31:45 +02:00
aa47ae4c2e Working text back end [to test] 2022-04-11 13:13:56 +02:00
q-posev
a2fee3164b [WIP] text back end 2022-04-11 09:26:54 +02:00
q-posev
e5d6104a63 [WIP] determinants 2022-04-06 18:26:57 +02:00
e43dde90d9 If nelec != nup+ndn, rewrite nelec 2022-03-31 13:55:50 +02:00
15c8e10184 Added test 2022-03-31 13:53:57 +02:00
8262b97104 Merge branch 'walkers' of github.com:TREX-CoE/trexio into walkers 2022-03-31 13:34:41 +02:00
0e75cb42b5 Add support for Python with statement
(see PEP 343 for more details)
2022-03-07 14:12:31 +01:00
68d34a0ace use built-in trexio_text_free_group function for garbage collection 2022-02-14 10:44:04 +01:00
5eb697abcc [WIP] refactor read_group set of functions to read data in arbitrary order
This fix is required to fix backwards compatibility issue of TEXT back end. In the meantime, the custom garbage collector from generator_tools which was deallocating previously allocated memory (datasets and strings) is no longer valid here since the order of allocation can be atrbitrary. This requires a new custom garbage collector, maybe as a separate functions in TEXT back end
2022-02-07 15:57:38 +01:00
999dd2065a update documentation of the trexio_open function 2022-02-04 11:21:56 +01:00
246847b8d5 Merge branch 'master' into add-auto-backend 2022-01-25 16:24:34 +01:00
a65b22eebb add TREXIO_AUTO back end for READONLY (r) mode 2022-01-25 14:59:51 +01:00
4e5bb5472a remove merge leftovers 2022-01-25 13:17:49 +01:00
dcdac7dbf9 add metadata_unsafe attribute to trex.json; write it upon first unsafe trexio_open 2022-01-25 11:13:32 +01:00
8947f6caa7 Merge branch 'master' into add-unsafe-open-mode 2022-01-24 18:25:52 +01:00
82e7cd058b add overwriting functionality for unsafe mode [HDF5] 2022-01-24 16:15:31 +01:00
f68a59417e add overwriting functionality for unsafe mode [TEXT] 2022-01-24 16:13:27 +01:00
179e0c8dfc document the HDF5 issue with releasing the free space
suggest using h5repack after each deletion to get the file size right
2022-01-24 11:52:25 +01:00
6fe5a1eaa7 [WIP] add delete_group functions and unsafe trexio_open mode 2022-01-24 10:10:16 +01:00
Evgeny Posenitskiy
f3d17da7b8
Merge branch 'master' into add-inquire-functionality 2022-01-21 12:33:32 +01:00
734f813544 remove C-kind integer types for TREXIO_VERSION-s in Fortran 2022-01-21 12:28:15 +01:00
3e65a74676 better documentation for trexio_inquire function 2022-01-21 10:07:36 +01:00
2a9cfb3fa4 [CMake] add minor support for pthreads and stdint 2022-01-20 17:32:01 +01:00
4afd9cf2c1 Merge branch 'master' into add-inquire-functionality 2022-01-20 14:32:50 +01:00
23c1601442 add trexio_info function 2022-01-20 14:21:54 +01:00
8817a86cf6 Minor fixes 2022-01-20 11:13:28 +01:00
7cb1ca8d68 add missing checks for NULL pointers 2022-01-20 10:54:22 +01:00
73a8ef1925 Renamed backend -> back_end for consistency + Better type names, using types in functions. 2022-01-20 09:58:27 +01:00
0651ef66b6 Removed erroneous c_double 2022-01-19 22:03:25 +01:00
81c41c1ffc Merge branch 'master' into iso_fortran_env 2022-01-19 19:45:58 +01:00
78c632f93f
Merge pull request #74 from TREX-CoE/build_fixes
Build fixes
2022-01-19 19:33:23 +01:00
e3d1026a41 iso_c_binding 2022-01-19 19:16:03 +01:00
16e9a815d2 Using iso_c_binding types in trexio_f.f90 2022-01-19 19:13:52 +01:00
550c5c3954 implement trexio_inquire function in front and back ends 2022-01-19 14:06:10 +01:00
Pablo Lopez Rios
57973eaca0 templator_front.org: undo two unnecessary changes 2022-01-19 10:38:01 +00:00
Pablo Lopez Rios
9e5d81b292 Use c_int64_t and c_int32_t as requested by Evgeny Posenitskiy. 2022-01-19 10:23:11 +00:00
Pablo Lopez Rios
36a05c184d Use cmake's configure_file() as suggested by Evgeny Posenitskiy. 2022-01-19 10:14:31 +00:00
Pablo Lopez Rios
0e9b9f1900 trexio_f: fix complaints from gfortran 11, including data type issues
This includes:
* Define kind of arguments of bind(C) procedures using the relevant C
  types provided by iso_c_binding.
* Replaced "call exit(1)" with "error stop 1".
* Fixed a couple of implicit type conversions between 4-/8-byte
  integers.

The first two fix compilation of the Fortran module with -std=f2008.
2022-01-18 16:58:07 +00:00
Pablo Lopez Rios
f89e542f26 gitignore editor swap/backup files, suggested build directory, build byproducts 2022-01-18 14:14:27 +00:00
Pablo Lopez Rios
12a7454c0c Fix cmake compilation.
This includes:
* Declare generated source files in include/ as GENERATED in
  TREXIO_DEVEL mode.
* Generate include/config.h with version components from project
  delcaration, and for good measure have src/templates_front/build.sh
  set version components to 0 if not present.
2022-01-18 14:04:00 +00:00
acff2de611 safer struct 2022-01-07 11:58:24 +01:00
64081e46ad cppcheck fixes 2022-01-07 11:50:55 +01:00
98e303ffe2 Merge branch 'master' of github.com:TREX-CoE/trexio 2022-01-07 11:22:44 +01:00
3f4b8e2c7e cppcheck fixes 2022-01-07 11:21:12 +01:00
dbb6f78397 cppcheck fixes 2022-01-07 11:01:23 +01:00
3787226fd1 overlapping changes 2022-01-07 09:58:03 +01:00
1f7386c4ca Missing break in front end 2022-01-07 08:57:45 +01:00
fc08ee68ef Merge branch 'master' of github.com:TREX-CoE/trexio 2022-01-05 14:05:25 +01:00
Evgeny Posenitskiy
c687c80f92
Merge pull request #71 from TREX-CoE/add-sparse-datasets
Add Python API for sparse datasets
2022-01-05 13:57:32 +01:00
b65ec031dc rename returned variable to n_int_read 2021-12-27 17:17:00 +01:00
4ef5386ae6 [cppcheck] fix some warnings 2021-12-27 16:29:26 +01:00
6ab5c67ebe [pre-release] upgrade versions and produce wheels for CPython 3.10 2021-12-27 16:26:17 +01:00
31ffa574ab finish top-level Python API for sparse data 2021-12-27 14:00:46 +01:00
722c546113 documentation for sparse arrays
+ add safe functions to Fortran API
2021-12-24 12:40:23 +01:00
c18a330eab [WIP] working read/write of sparse data in the low-level (SWIG) Python API
TODO: top-level Python API with error handling and truncation of output arrays when EOF is encountered (low-level API fills the remaining elements with garbase)
2021-12-24 11:49:54 +01:00
0a8aa638f6 fix double deallocation in text back end 2021-12-23 18:49:00 +01:00
72897e4b5d [WIP] read/write of sparse data in Python 2021-12-23 18:27:24 +01:00
c2376bf168 Fixed bug in text back-end when reading empt attributes 2021-12-23 18:21:17 +01:00
q-posev
31ccd27a0a fix warnings on MacOS 2021-12-17 17:07:53 +01:00
2639b76a6e optimize storage of indices depending on the size_max variable [TEXT] 2021-12-17 15:32:03 +01:00
daa5bdb3cc (inout) buffer size instead if (out) [Fortran] 2021-12-17 13:33:27 +01:00
314beb58c9 refactoring done; moved common blocks into _hdf5_open_read_dset_sparse 2021-12-17 13:32:35 +01:00
1c49c81da8 [WIP] refactoring; write_dset_sparse done 2021-12-16 16:52:35 +01:00
fafb155228 return the number of read elements if read_sparse reached EOF 2021-12-16 11:05:57 +01:00
2e99a14b6e read dim variable of sparse dset to compress storage of indices in HDF5 2021-12-14 18:03:51 +01:00
a8b251d820 write sparse values and compress int indices depending on the max num value 2021-12-14 18:02:58 +01:00
b90abcc307 fix memory leak in the Fortran test 2021-12-13 09:59:27 +01:00
070ef06818 better error handling for HDF5 2021-12-10 16:49:31 +01:00
1c16b75992 adapt HDF5 back end to be generated for an arbitrary number of indices 2021-12-10 16:02:38 +01:00
9f5ee463e1 only shift indices that have been read to the buffer (EOF case) 2021-12-10 14:02:05 +01:00
7afb53be49 implement shift of sparse indices to be one-based in Fortran 2021-12-10 11:34:37 +01:00
e00f3b106e working HDF5 I/O for sparse indices 2021-12-09 16:13:28 +01:00
e774cb6852 add read_size function to HDF5 back end 2021-12-09 14:10:51 +01:00
d001844c2f [WIP] working write_ for chunked extensible (sparse) datasets 2021-12-08 17:26:55 +01:00
e5bde10056 alternative way to check for EOF with fgets while reading 2021-12-03 19:23:01 +01:00
ed3bde973e [WIP] more general templated variables for sparse data
+ renamed templated variables with std_dtype_in|out suffix into _format_scanf|printf for clarity
2021-12-03 15:42:40 +01:00
c520175cbe use size_max values provided by the read_size functions 2021-12-03 11:48:51 +01:00
d2c95cd306 add functions to read the number of stored sparse elements 2021-12-02 17:28:37 +01:00
acdf982a94 fixed string length for file name + comments 2021-12-01 16:28:47 +01:00
7afce779a8 better error handling in TEXT back end 2021-12-01 16:11:40 +01:00
c30c3a532c add Fortran interface for sparse data 2021-12-01 13:35:42 +01:00
83c926fd6b replace offset_data arg with pointer arithmetics 2021-12-01 09:56:31 +01:00
d3ba8f3652 [WIP] working generator for sparse functions
+ remove trailing whitespaces
2021-11-30 16:30:36 +01:00
c1e1176400 [WIP] text back end 2021-11-24 17:44:54 +01:00
d44883f0ea add search bar
close #40
2021-11-19 12:50:12 +01:00
527417cd8f fix type conversion for 32-bit indices 2021-11-18 14:33:18 +01:00
72c355c7cc Top-level CMakeLists with subdirectories 2021-11-17 14:00:35 +01:00
954ee4216c add trexio_has_backend function to the C and Fortran APIs 2021-11-02 11:05:27 +01:00
7f3ee3cc18 reset back end values and add TREXIO_BACK_END_MISSING error 2021-11-02 10:32:00 +01:00
5504bc0fe6 wrap TREXIO_INVALID_BACK_END definition in preprocessor macro 2021-11-01 13:22:46 +01:00
d42dc7f449 optional HDF5 compilation
via configure script and pre-processor macros
2021-11-01 11:55:34 +01:00
1812deb9dd Check return value of mkdtemp 2021-10-14 10:53:15 +02:00
5cf12131f1 Fix text back end for read-only directories (make distcheck in qmckl) 2021-10-13 17:43:15 +02:00
d017306706 Better error handling with open in text back end 2021-10-13 16:13:24 +02:00
954b26ccff Update README 2021-10-13 14:24:54 +02:00
fb9c95bd61 add version attributes to the Fortran module 2021-10-08 13:55:56 +02:00
947a8a12f8 Fix bug due to PACKAGE_VERSION definition in trexio.h 2021-10-07 09:54:19 +02:00
68284161d3 downgrade numpy.i SWIG interface to numpy 1.17.3 2021-09-30 17:22:50 +02:00
2e2dac3982 modify rc_open only if it is not a NULL pointer 2021-09-24 12:23:59 +02:00
67b00efa9c handle return error of trexio_open in the Python API 2021-09-22 16:40:55 +02:00
9457a826d2 return error code from trexio_open [C, Fortran] 2021-09-22 14:50:22 +02:00
14472cda48 better error handling in case of invalid dimensioning variable 2021-09-22 11:33:27 +02:00
389d265f7f fix cppcheck warnings regarding redundant size_dset_str checks 2021-09-21 16:08:04 +02:00
d1a9af4185 remove blank spaces in front of pointers 2021-09-21 15:54:11 +02:00
788f7e666d read single numerical attributes based on _isSet bool flag 2021-09-21 15:41:12 +02:00
d5405e700c raise TREXIO_INVALID_ARG_2 also when writing zero as dimensioning variable 2021-09-21 14:35:29 +02:00
6459543afd better front end documentation for numerical attributes 2021-09-21 10:58:07 +02:00
11a17c65d3 add attr_ prefix to the template file name for numerical attributes 2021-09-21 10:41:37 +02:00
c22e9d2925 put back sanity check that dimensioning variables are positive 2021-09-20 17:00:05 +02:00
ce0d98b984 add conversion of float-like attributes into an output tuple 2021-09-20 15:52:55 +02:00
4b9827048f adapt the templates in back ends 2021-09-20 15:51:36 +02:00
261e7c8b84 modify front end for more general numerical attributes 2021-09-20 13:16:44 +02:00
11dadaab36 add tutorial HTML page to the main documentation 2021-09-15 13:43:57 +02:00
f251f0afba remove unnecessary comments in the SWIG interface 2021-09-14 17:30:05 +02:00
d04106f72d max_str_len should be int32_t to properly check for negative values 2021-09-13 13:35:45 +02:00
1589995775 do not use warnings for an attempt to overwrite in the Python API 2021-09-13 11:46:31 +02:00
2bd4ef9bfd add has_ functions to the Python API 2021-09-13 11:29:00 +02:00
77e3f1ac11 print UserWarning instead of raising Error for an attempt to overwrite data
following suggestion of Vijay G.C.
2021-09-12 14:24:50 +02:00
d060808467 do not reveal paths to trexio (security concerns) 2021-09-12 13:36:24 +02:00
12dd1fd8dc apply some suggestions from cppcheck 2021-09-12 13:25:03 +02:00
40d5fc31fc check that the data object exists before reading it from the file 2021-09-10 09:38:26 +02:00
67e59f156c explicitly provide __version__ attribute of the trexio module 2021-09-08 19:28:18 +02:00
96678fea2e adapt write functions to receive multidimensional arrays or lists 2021-09-07 17:14:23 +02:00
3e82fd9ae8 FIX: a bug that was leading to Python and valgrind errors 2021-08-31 12:11:22 +03:00
74c69bb293 better Exception handling with custom exception class 2021-08-30 18:04:35 +03:00
5a2b4d96a7 reshape output arrays by default when reading from the file 2021-08-27 16:08:39 +03:00
7b5ebf6272 implement TREXIO File class and change import of pytrexio module 2021-08-26 17:01:53 +03:00
4c28a4cac8 add type converters for numerical arrays in read/write Python functions 2021-08-26 13:14:46 +03:00
1dcd32ef7d add SWIG typemaps for safe API calls in single and double precision 2021-08-25 13:31:17 +03:00
ed7e3902e2 add memory-safe functions in single or double precision 2021-08-24 13:32:01 +03:00
2911e91941 make dim an optional argument in read_ functions
if dim is None - the function read all necessary dimensions from the TREXIO file
2021-08-24 12:51:43 +03:00
6f7c23aa11 add missing annotations 2021-08-21 13:13:55 +03:00
4fe86ee980 add Python docstrings for API functions
+ move definition of Fortran and Python back ends from Constant Prefixes to Back Ends section
2021-08-21 12:47:36 +03:00
5d5025ae1d get rid of _safe suffix and add dimension to read_dset_str functions 2021-08-20 13:43:15 +03:00
831973fc8e better python compilation 2021-08-18 16:28:43 +03:00
902147b45b better structure of the python directory 2021-08-18 15:40:42 +03:00
9cc552409f rename the front-end Python module 2021-08-18 13:30:03 +03:00
f0bccee32d single top-level import of pytrexio resolves bug with caching 2021-08-18 13:28:37 +03:00
0b223b9d6e return type cast of exit codes and back ends in C
add top-level string_of_error function in Python
2021-08-14 12:27:11 +03:00
721352cb89 add missing support for reading single string attributes 2021-08-11 16:01:36 +03:00
209f4506c8 update gitignore 2021-08-11 16:01:04 +03:00
2be1abd571 add Python front end 2021-08-11 15:59:58 +03:00