stan-dev / stan-dev/rstan

Rstan stopped working with multiple cores

Open
#492 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

I was using Rstan with multiple cores on my laptop and it worked just fine. It suddenly stopped working and now continues to be broken. I've restarted the computer, R, re-installed Rstan and its dependencies, but the error persists.

Description:

The code works fine if I set

options(mc.cores = 1)

but breaks for multiple cores, e.g.,

options(mc.cores = 2)
options(mc.cores = parallel::detectCores())

Reproducible Steps:

Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.

If you have a reproducible example, please include it.

Current Output:

fit_gen_lognormal_shift_constrained <-

  • stan(file = 'LogNormalShiftConstrained_ReadingTimes_stationary_gen.stan',
  •    data = ReadingTimes_data,
    
  •    chains = 4,
    
  •    iter = 2000)
    

starting worker pid=841 on localhost:11528 at 14:13:31.618
Error in socketConnection(master, port = port, blocking = TRUE, open = "a+b", :
cannot open the connection
Calls: ... doTryCatch -> recvData -> makeSOCKmaster -> socketConnection
In addition: Warning message:
In socketConnection(master, port = port, blocking = TRUE, open = "a+b", :
localhost:11528 cannot be opened
Execution halted

Expected Output:

If applicable, the output you expected from RStan.

RStan Version:

rstan (Version 2.17.3, GitRev: 2e1f913d3ca3)

R Version:

platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 4.3
year 2017
month 11
day 30
svn rev 73796
language R
version.string R version 3.4.3 (2017-11-30)
nickname Kite-Eating Tree

Operating System:

Mac OS 10.13.3 (17D47)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported stan(...) call using options(mc.cores = 1), 2, and parallel::detectCores(), then compare the socketConnection error and worker startup output. Check the reported RStan 2.17.3, R 3.4.3, and macOS 10.13.3 environment; the issue is done when multi-core execution works while the single-core case remains working.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, r
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.