Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7857129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:56:20+00:00 2026-06-02T20:56:20+00:00

I am having some trouble with using a parallel version of map ( ppmap

  • 0

I am having some trouble with using a parallel version of map (ppmap wrapper, implementation by Kirk Strauser).

The function I am trying to run in parallel runs a simple regular expression search on large number of strings (protein sequences), which are parsed from the filesystem using BioPython’s SeqIO. Each of function calls uses their own file.

If I run the function using a normal map, everything works as expected. However, when using the ppmap, some of the runs simple freeze, there is no CPU usage and the main program does not even react to KeyboardInterrupt. Also, when I look onto the running processes, the workers are still there (but not using any CPU anymore).

e.g.

/usr/bin/python -u /usr/local/lib/python2.7/dist-packages/pp-1.6.1-py2.7.egg/ppworker.py 2>/dev/null

Furthermore, the workers do not seem to freeze on any particular data entry – if I manually kill the process and re-run the execution, it stops at a different point. (So I have temporarily resorted to keeping a list of finished entries and re-started the program multiple times).

Is there any way to see where the problem is?

Sample of the code that I am running:

def analyse_repeats(data):
    """
    Loads whole proteome in memory and then looks for repeats in sequences, 
    flags both real repeats and sequences not containing particular aminoacid
    """    
    (organism, organism_id, filename) = data

    import re
    letters = ['C','M','F','I','L','V','W','Y','A','G','T','S','Q','N','E','D','H','R','K','P']

    try:
        handle = open(filename)
        data = Bio.SeqIO.parse(handle, "fasta")

        records = [record for record in data]
        store_records = []
        for record in records:
            sequence = str(record.seq)
            uniprot_id = str(record.name)
            for letter in letters:
                items = set(re.compile("(%s+)" % tuple(([letter] * 1))).findall(sequence))     
                if items:
                    for item in items:
                        store_records.append((organism_id,len(item), uniprot_id, letter))
                else:
                    # letter not present in the string, "zero" repeat
                    store_records.append((organism_id,0, uniprot_id, letter))
        handle.close()
        return (organism,store_records)
    except IOError as e:
        print e
        return (organism, [])


res_generator = ppmap.ppmap(
    None, 
    analyse_repeats, 
    zip(todo_list, organism_ids, filenames)
)

for res in res_generator:  
    # process the output

If I use simple map instead of the ppmap, everything works fine:

res_generator = map(
    analyse_repeats, 
    zip(todo_list, organism_ids, filenames)
)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:56:22+00:00Added an answer on June 2, 2026 at 8:56 pm

    You could try using one of the methods (like map) of the Pool object from the multiprocessing module instead. The advantage is that it’s built in and doesn’t require external packages. It also works very well.

    By default, it uses as many worker processes as your computer has cores, but you can specifiy a higher number as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some trouble trying to checkout the BitSharp source code using SVN.
I'm having some trouble using the std container classes (list, map etc.) in C++.
I´m having some trouble implementing a dynamic tree structure using the primefaces tree implementation.
I am using the.load function and I am having some trouble: <form id=register_frm method=post
I'm having some trouble using trying to determine if a mouse click is occurring
I'm having some trouble using the jQuery BlockUI plugin. What I'm trying to do
Ive been having some trouble using Plot to graph a complicated composite function. I
i'm trying to create a flow layout and i'm having some trouble using float:left
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I'm having some trouble using regular expression to get date in a string. Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.