Commit 2af1986f authored by Li's avatar Li Committed by Li Song
Browse files

max_num_mappings_in_mem when using too many temp files

parent cac1ff54
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -457,6 +457,10 @@ void Chromap::MapSingleEndReads() {
              mapping_writer.OutputTempMappings(num_reference_sequences,
                                                mappings_on_diff_ref_seqs,
                                                temp_mapping_file_handles);

              if (temp_mapping_file_handles.size() > 900
                  && temp_mapping_file_handles.size() % 10 == 1) // every 10 temp files, double the temp file size
                max_num_mappings_in_mem <<= 1;
              num_mappings_in_mem = 0;
            }
          }
@@ -1016,6 +1020,9 @@ void Chromap::MapPairedEndReads() {
              mapping_writer.OutputTempMappings(num_reference_sequences,
                                                mappings_on_diff_ref_seqs,
                                                temp_mapping_file_handles);
              if (temp_mapping_file_handles.size() > 900
                  && temp_mapping_file_handles.size() % 10 == 1) // every 10 temp files, double the temp file size
                max_num_mappings_in_mem <<= 1;
              num_mappings_in_mem = 0;
            }
          }  // end of omp task to handle output
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ struct TempMappingFileHandle {
  inline void InitializeTempMappingLoading(uint32_t temp_mapping_block_size) {
    file = fopen(file_path.c_str(), "rb");
    if (file == NULL) {
      std::cerr << "Temporary file " << file_path << " is missing.\n" ;
      std::cerr << "Cannot open temporary file " << file_path << ". This may be caused by creating too many temporary files, please consider using command like \"ulimit -n 32768 -u 32768\" to increase the limit.\n" ;
    }
    assert(file != NULL);
    num_mappings = 0;