| #include "../src/collocatordb.h" |
| #include <sstream> // for ostringstream |
| int main(int argc, char** argv) { |
| array = (uint32_t *)malloc(STOP * 20 * sizeof(uint32_t)); |
| memset(array, 0, STOP * 20 * sizeof(uint32_t)); |
| CollocatorDB cdb = CollocatorDB(argv[1], true); |
| std::cerr << "Database " << argv[1] << " opened\n"; |
| #pragma omp parallel for schedule(dynamic, 1) |
| for(uint32_t i=START; i< STOP; i++) { |
| std::vector<rocksdb::Collocator> cs = cdb.get_collocators(i, STOP); |
| for (rocksdb::Collocator c : cs) { |
| array[i*20+j] = (uint32_t) c.w2; |
| std::cerr <<"\r\033[2K"<<std::flush; |
| std::cerr << "done: " << done * 100.0 / (STOP-START) << "%" << " (todo: " << STOP-START-done << ")" << std::flush; |
| pFile = fopen("file.binary", "wb"); |
| fwrite(array, sizeof(uint32_t), STOP*20, pFile); |