I can't open that specific file (got it from here, it is inside the gist.tar.gz), I can however open the query file for example and read it properly. What's wrong? Maybe the problem lies in the fact that the file is too big for me? But I thought that if this was the case I could open it and then receive a bad_alloc
or something.
Here is what happens:
samaras@samaras-A15:~/parallel/rkd_forest/code$ ./rkd_sam
I/O error : Unable to open the file ../Datasets/gist/gist_base.fvecs
samaras@samaras-A15:~/parallel/rkd_forest/code$ cd ../Datasets/gist/
samaras@samaras-A15:~/parallel/rkd_forest/Datasets/gist$ ls
gist_base.fvecs gist_groundtruth.ivecs gist_learn.fvecs gist_query.fvecs
Here is my code (should be OK):
FILE* fid;
fid = fopen(filename, "rb");
if (!fid)
printf("I/O error : Unable to open the file %s\n", filename);
Here are the permissions of the file:
and its size is 3.8 GB (3,844,000,000 bytes) and I know that this dataset is too big for this computer.
As a result I moved to another machine, but I am getting the very same problem.
The memory there (it is 64 bits, while my pc runs on 32 bits):
gsamaras@geomcomp:~/Desktop/code$ free -mt
total used free shared buffers cached
Mem: 3949 3842 106 0 173 3186
-/+ buffers/cache: 483 3466
Swap: 10867 59 10808
Total: 14816 3901 10914
std::cerr << "Error: " << strerror(errno) << std::endl;
gave
Error: Value too large for defined data type
printf("|%s|\n", filename);
gave
|../Datasets/gist/gist_base.fvecs|
and the value is taken from cmd and in the code I am doing this:
readDivisionSpacefvecs<FT>(test, N, D, argv[8]); // in main()
and then
void readDivisionSpacefvecs(Division_Euclidean_space<T>& ds, int& N, int& D, char* filename) {
FILE* fid;
fid = fopen(filename, "rb");
printf("|%s|\n", filename);
if (!fid) {
printf("I/O error : Unable to open the file %s\n", filename);
std::cerr << "Error: " << strerror(errno) << std::endl;
}
...
}
I also tried to move the folder which contains the dataset, but I got the same result!