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 6661281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:15:37+00:00 2026-05-26T02:15:37+00:00

I use iPython’s parallel-processing facility for a big map operation. While waiting for the

  • 0

I use iPython’s parallel-processing facility for a big map operation. While waiting for the map operation to finish, I’d like to display to the user how many of the jobs have finished, how many are running, and how many are remaining. How can I find that information?

Here is what I do. I create a profile that uses a local engine and start two workers. In the shell:

$ ipython profile create --parallel --profile=local
$ ipcluster start --n=2 --profile=local

Here is the client Python script:

#!/usr/bin/env python

def meat(i):
    import numpy as np
    import time
    import sys
    seconds = np.random.randint(2, 15)
    time.sleep(seconds)
    return seconds

import time
from IPython.parallel import Client

c = Client(profile='local')
dview = c[:]

ar = dview.map_async(meat, range(4))
elapsed = 0
while True:
    print 'After %d s: %d running' % (elapsed, len(c.outstanding))
    if ar.ready():
        break
    time.sleep(1)
    elapsed += 1
print ar.get()

Example output from the script:

After 0 s: 2 running
After 1 s: 2 running
After 2 s: 2 running
After 3 s: 2 running
After 4 s: 2 running
After 5 s: 2 running
After 6 s: 2 running
After 7 s: 2 running
After 8 s: 2 running
After 9 s: 2 running
After 10 s: 2 running
After 11 s: 2 running
After 12 s: 2 running
After 13 s: 2 running
After 14 s: 1 running
After 15 s: 1 running
After 16 s: 1 running
After 17 s: 1 running
After 18 s: 1 running
After 19 s: 1 running
After 20 s: 1 running
After 21 s: 1 running
After 22 s: 1 running
After 23 s: 1 running
[9, 14, 10, 3]

As you can see, I can get the number of currently running jobs, but not the number of jobs that have completed (or are remaining). How can I tell how many of map_async‘s jobs have finished?

  • 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-05-26T02:15:37+00:00Added an answer on May 26, 2026 at 2:15 am

    the AsyncResult has a msg_ids attribute. The outstanding jobs are the intersection of that with rc.outstanding, and the completed jobs are the difference:

    msgset = set(ar.msg_ids)
    completed = msgset.difference(rc.outstanding)
    pending = msgset.intersection(rc.outstanding)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I like to use IPython's zope profile to inspect my Plone instance, but a
Use case: user clicks the link on a webpage - boom! load of files
use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
Use Case When a user goes to my website, they will be confronted with
So I'm going through the matplotlib documentation and prepared to use the iPython interactive
I want to use some packages (i.e., IPython or zdaemon ), butI am doing
I want to use IPython under GAE to debug scripts locally: import ipdb; ipdb.set_trace()
Python has IPython .. does OCaml have anything similar? I'd very much like to
I am building xml rpc service using twisted and I would like to use
I would like to use Python to script an application that advertises itself as

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.