This gist, together with https://gist.github.com/jherskovic/8222898 will read a MEDLINE base distribution and create a journal->MeSH term count dictionary, and then pickle it.  It will use all CPUs in a system to process MEDLINE files in parallel.