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

  • Home
  • SEARCH
  • 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 8067067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:10:16+00:00 2026-06-05T12:10:16+00:00

I love the setting .progress = ‘text’ in plyr’s llply . However, it causes

  • 0

I love the setting .progress = 'text' in plyr's llply. However, it causes my much anxiety to not know how far along an mclapply (from package multicore) is since list items are sent to various cores and then collated at the end.

I’ve been outputting messages like *currently in sim_id # ....* but that’s not very helpful because it doesn’t give me an indicator of what percentage of list items are complete (although it is helpful to know that that my script isn’t stuck and moving along).

Can someone suggest other ideas that would allow me to look at my .Rout file and get a sense of progress? I’ve thought about adding a manual counter but can’t see how I would implement that since mclapply must finish processing all list items before it can give out any feedback.

  • 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-05T12:10:18+00:00Added an answer on June 5, 2026 at 12:10 pm

    Due to the fact that mclapply spawns multiple processes, one might want to use fifos, pipes, or even sockets. Now consider the following example:

    library(multicore)
    
    finalResult <- local({
        f <- fifo(tempfile(), open="w+b", blocking=T)
        if (inherits(fork(), "masterProcess")) {
            # Child
            progress <- 0.0
            while (progress < 1 && !isIncomplete(f)) {
                msg <- readBin(f, "double")
                progress <- progress + as.numeric(msg)
                cat(sprintf("Progress: %.2f%%\n", progress * 100))
            } 
            exit()
        }
        numJobs <- 100
        result <- mclapply(1:numJobs, function(...) {
            # Dome something fancy here
            # ...
            # Send some progress update
            writeBin(1/numJobs, f)
            # Some arbitrary result
            sample(1000, 1)
        })
        close(f)
        result
    })
    
    cat("Done\n")
    

    Here, a temporary file is used as fifo, and the main process forks a child whose only duty is to report the current progress. The main process continues by calling mclapply where the expression (more precisely, the expression block) that is to be evaluated writes partial progress information to the fifo buffer by means of writeBin.

    As this is only a simple example, you’ll probably have to adapt the whole output stuff to your needs. HTH!

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

Sidebar

Related Questions

I love the Remove unused usings command in VS2008, however when running it on
I'm setting up styles for a stacked bar graph, I would love to use
So Im setting some buttons to slide a carousel. preezer.setActiveItem(this.text, slide); Its working just
hey guys, i love the jquery toggle function. however currently i'm facing a little
I love how the Google UI for setting event start date/time and end date/time
I love LINQ to SQL but it has been bugging me that in using
I love NHibernate's ability to have one table to store multiple types based on
I love Ruby and its framework, but I don't think that Ruby On Rails
I love this shortcut in borne shell, and want to find out if it
I love the idea of Grizzly, but I can't find any good examples to

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.