Comments (9)
Not sure why that would be, those are just wrappers around a call to the h5
library:
ITensor/itensor/util/h5/wrap_h5.hpp
Lines 43 to 47 in 167aaff
@emstoudenmire (or @Wentzell), any idea?
from itensor.
That's very strange. I have adjusted the example to use https://github.com/TRIQS/h5 directly
#include <h5/h5.hpp>
int main(int argc, char *argv[]) {
auto ofHandle0 = h5::file("test_0.h5",'w');
ofHandle0.close();
std::cout << "cout 0" << std::endl;
std::cerr << "cerr 0" << std::endl;
auto ofHandle1 = h5::file("test_1.h5",'w');
ofHandle1.close();
std::cout << "cout 1" << std::endl;
std::cerr << "cerr 1" << std::endl;
auto ofHandle2 = h5::file("test_2.h5",'w');
ofHandle2.close();
std::cout << "cout 2" << std::endl;
std::cerr << "cerr 2" << std::endl;
return 0;
}
Both for the release branch 1.0.x
and the development branch unstable
do I get the expected output
cout 0
cerr 0
cout 1
cerr 1
cout 2
cerr 2
@brendenroberts Could you try the example above in your build environment?
The steps would be
- clone https://github.com/TRIQS/h5 to e.g. h5_src
- Add the example above in
h5_src/test/c++/stream_issue.cpp
- Build and run the example with
mkdir h5_src/build && cd h5_src/build
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install && make stream_issue
./test/c++/stream_issue
from itensor.
Your direct example works as expected for me also.
from itensor.
Your direct example works as expected for me also.
Ok. In that case the issue should be related to either the TRIQS/h5 version
that is currently part of ITensor, or to how ITensor wraps the TRIQS/h5 functionality.
I would suggest to first update the version within ITensor and see if the problem persists.
from itensor.
@mtfishman @emstoudenmire Would you agree? If so, could either of you look into that?
from itensor.
Thanks @Wentzell. The issue seems to be with the calls to close()
. It solves the problem if instead I use the member function h5_object.close()
(or whatever class it is). I think I got this io pattern from the unit test?
from itensor.
Ok. h5::object.close()
should properly close the file handle. In the end it simply invokes the desctructor of the h5::object
which internally will do the H5Idec_ref
. I am not sure about what the close(..)
in ITensor does.
from itensor.
Yeah, I'm trying to search the source code for the free function close(...)
and I can't even find it. @emstoudenmire do you know its origin?
from itensor.
I guess we should remove it from the unit tests and docs in favor of h5::object.close()
until we track down the issue with the free version.
from itensor.
Related Issues (20)
- range1 not working like python HOT 2
- (no)prime not working appropriately with <keyword arguments> HOT 1
- Add stracktraces to error messages
- configure/cmake HOT 3
- Introduce `apply` and `contract` MPS/MPO functions
- extract dense ITensor storage HOT 4
- .position() of MPS does not preserve the link index of the MPS HOT 1
- Typo in sample/Makefile
- subscript out of range in itensor/util/autovector.h HOT 2
- Reading input from a .tns file HOT 2
- Should QDense constructor error if zero blocks? HOT 6
- Two issues in installing ITensor c++ on Windows HOT 10
- fatal error: itensor/config.h: No such file or directory HOT 3
- compile error when using OpenBLAS in Ubuntu 22.04 HOT 1
- Losing QN information when reading from HDF5 HOT 1
- Bug: unexpected returning order of indexes HOT 3
- Unexpected behaviour: elt(T) doesn't raise out-of range error HOT 5
- Failure to compile with gcc-13: call of overloaded 'format(..)' is ambiguous HOT 2
- Fixing a bug in Unitttest SECTION("arnoldi (multiple eigenvectors)") HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itensor.