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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:21:54+00:00 2026-06-13T16:21:54+00:00

Possible Duplicate: Parallel processing in R limited I’ve written some code in R multicore,

  • 0

Possible Duplicate:
Parallel processing in R limited

I’ve written some code in R multicore, and I’m running it on a 24-core machine. In fact there are only 12 cores, but they are hyperthreaded, so it looks like there are 24.

Here’s what’s strange: all the threads run on the same single core! So they each only use a tiny amount of cpu, instead of each running on a single core, and chewing up all available cores.

For simplicity, I’m just running 4 threads:

mclapply( 1:30, function(size) {
    # time consuming stuff that is cpu bound (think "forecast.ets" et al)
}, mc.cores = 4, mc.preschedule = F )

Prior to running this, there is already an R process running on one core, using 100% of that core’s capacity:

enter image description here

Next, I launch the “multicore process”, and 4 extra threads fight for the same core!:

enter image description here

… so, they each get 12% of one core, or about 1% of the available processing power, when they should each be able to get 100% of one core. Also, the other R process now only get 50% of the core.

OS is Ubuntu 12.04 64-bit. Hardware is Intel. R is version 2.15.2 “trick or treat”

Thoughts? (I know I could just use snowfall, but I have a ton of variables, and I really don’t want to have to sfExport all of them!)

Edit: oh, I guess there’s some global lock somewhere? But still, why would there be a conflict between two completely separate R processes? I can run two R processes in parallel just fine, with each taking 100% of a core’s CPU.

Edit2: Thanks to Dirk’s pointer, I rebuilt openblas, and it’s looking much healthier now!:

enter image description here

  • 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-13T16:21:56+00:00Added an answer on June 13, 2026 at 4:21 pm

    A possible issue is a possible side effect of the OpenBLAS package which sets CPU affinity such that processes stick to one core. See Parallel processing in R limited for a discussion and link to more discussion on the r-sig-hpc list which has a fix.

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

Sidebar

Related Questions

Possible Duplicate: Convert some code from C++ to C I've got some code that
Possible Duplicate: Is there some ninja trick to make a variable constant after its
Possible Duplicate: Coordinating parallel execution in node.js First, hands on pseudo-code: forEach(arrayelements) { asyncQueryFunction(function(qres)
Possible Duplicate: Why doesn't JavaScript support multithreading? Is there some way to spawn new
Possible Duplicate: How to most elegantly iterate through parallel collections? Is there an accepted
Possible Duplicate: Running junit tests in parallel? I found the test cases inside jUnit
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
Possible Duplicate: How to check if socket is closed in Boost.Asio? Is there an
Possible Duplicate: Can a Bash script tell what directory it's stored in? Is there

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.