<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def run_sparser(pmid_list, tmp_dir, num_cores, start_index, end_index,
                force_read, force_fulltext, cleanup=True, verbose=True):
    'Run the sparser reader on the pmids in pmid_list.'
    reader_version = sparser.get_version()
    _, _, _, pmids_read, pmids_unread, _ =\
        get_content_to_read(
            pmid_list, start_index, end_index, tmp_dir, num_cores,
            force_fulltext, force_read, 'sparser', reader_version
            )

    logger.info('Adjusting num cores to length of pmid_list.')
    num_cores = min(len(pmid_list), num_cores)
    logger.info('Adjusted...')
    if num_cores is 1:
        stmts = get_stmts(pmids_unread, cleanup=cleanup)
        stmts.update({pmid: get_stmts_from_cache(pmid)[pmid]
                      for pmid in pmids_read.keys()})
    elif num_cores > 1:
        logger.info("Starting a pool with %d cores." % num_cores)
        pool = mp.Pool(num_cores)
        pmids_to_read = list(pmids_unread.keys())
        N = len(pmids_unread)
        dn = int(N/num_cores)
        logger.info("Breaking pmids into batches.")
        batches = []
        for i in range(num_cores):
            batches.append({
                k: pmids_unread[k]
                for k in pmids_to_read[i*dn:min((i+1)*dn, N)]
                })
        get_stmts_func = functools.partial(
            get_stmts,
            cleanup=cleanup,
            sparser_version=reader_version
            )
        logger.info("Mapping get_stmts onto pool.")
        unread_res = pool.map(get_stmts_func, batches)
        logger.info('len(unread_res)=%d' % len(unread_res))
        read_res = pool.map(get_stmts_from_cache, pmids_read.keys())
        logger.info('len(read_res)=%d' % len(read_res))
        pool.close()
        logger.info('Multiprocessing pool closed.')
        pool.join()
        logger.info('Multiprocessing pool joined.')
        stmts = {
            pmid: stmt_list for res_dict in unread_res + read_res
            for pmid, stmt_list in res_dict.items()
            }
        logger.info('len(stmts)=%d' % len(stmts))

    return (stmts, pmids_unread)