def evalCpuNeeds(totLn, algorithm=None, debug=False):
    """
    Estimates the number of needed threads (cores) based on the total lines to be processed
    For the supported algorithms an estimation is given but should be updated when possible
    NOTES: it is very experimental and based on a very few samples
    """
    import multiprocessing
    maxCores = multiprocessing.cpu_count()
    buckets = [2, 4, 8, 12, 16, 24, 32, 48, 64, 96, 128]
    if debug:
        print('\n evalCpuNeeds START:')
        print('TOT LINES ::\t%s' % str(totLn))
        print('ALGORITHM ::\t%s' % str(algorithm))
    chunkDict = {'bwa': 720000, 'map_pct_calc': 400000, 'avg': 560000}
    if algorithm == None:
        algorithm = 'avg'
    chunkSize = chunkDict[algorithm]
    if chunkSize >= totLn:
        if debug:
            print(
                'Chunk size is bigger than the line to be porcessed, 1 core will do just fine...'
                )
        return 1
    cores = int(totLn / chunkSize)
    if debug:
        print('Selected Algorimth for Estimation:\t%s' % algorithm)
        print('CHUNK SIZE FOR %s ALGORITHM:\t%d' % (algorithm.upper(),
            chunkSize))
    if cores >= maxCores:
        return maxCores
    if algorithm != 'map_pct_calc':
        for el in buckets:
            if float(cores / el) <= 1:
                return el
    return cores
