{"action":"created","issue":{"url":"https://api.github.com/repos/stan-dev/rstan/issues/243","labels_url":"https://api.github.com/repos/stan-dev/rstan/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/rstan/issues/243/comments","events_url":"https://api.github.com/repos/stan-dev/rstan/issues/243/events","html_url":"https://github.com/stan-dev/rstan/issues/243","id":121951845,"number":243,"title":"Error with \"unserialize(node$con) : error reading from connection\"","user":{"login":"rBatt","id":5630847,"avatar_url":"https://avatars.githubusercontent.com/u/5630847?v=3","gravatar_id":"","url":"https://api.github.com/users/rBatt","html_url":"https://github.com/rBatt","followers_url":"https://api.github.com/users/rBatt/followers","following_url":"https://api.github.com/users/rBatt/following{/other_user}","gists_url":"https://api.github.com/users/rBatt/gists{/gist_id}","starred_url":"https://api.github.com/users/rBatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rBatt/subscriptions","organizations_url":"https://api.github.com/users/rBatt/orgs","repos_url":"https://api.github.com/users/rBatt/repos","events_url":"https://api.github.com/users/rBatt/events{/privacy}","received_events_url":"https://api.github.com/users/rBatt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-12-13T23:21:51Z","updated_at":"2015-12-19T05:37:30Z","closed_at":null,"body":"I only get this error when I'm trying to analyze the full version of my data set using multiple cores. If I analyze the full data set on 1 core (1 chain, 4 iterations), it runs. Similarly, if I run the model for a very small fraction of the data set on multiple cores (4 cores, 4 chains, 4 iterations), it also runs fine.\r\n\r\nBelow are the errors for a remote Linux machine that had ~133 GB RAM available at the time. The schools example runs fine over there (both on 1 core, and 4, and 10). However, I also get similar errors on my local Mac. Sometimes I get the same error message, other times R just crashes (the console just goes away; this is not a 'hang'!). Looking at the resources, neither system appears to be having any trouble lead up to the crash/ error.\r\n\r\n```\r\nstarting worker pid=34649 on localhost:11567 at 17:34:31.565\r\nstarting worker pid=34658 on localhost:11567 at 17:34:31.798\r\nstarting worker pid=34667 on localhost:11567 at 17:34:32.032\r\nstarting worker pid=34676 on localhost:11567 at 17:34:32.268\r\n\r\nSAMPLING FOR MODEL 'msomStatic' NOW (CHAIN 1).\r\n\r\nSAMPLING FOR MODEL 'msomStatic' NOW (CHAIN 2).\r\n\r\nSAMPLING FOR MODEL 'msomStatic' NOW (CHAIN 3).\r\n\r\nSAMPLING FOR MODEL 'msomStatic' NOW (CHAIN 4).\r\nError in unserialize(node$con) : error reading from connection\r\nCalls: stan ... FUN -> recvData -> recvData.SOCK0node -> unserialize\r\n```\r\n\r\nSession info for the Linux:\r\n\r\n```\r\n> sessionInfo()\r\nR version 3.2.2 (2015-08-14)\r\nPlatform: x86_64-redhat-linux-gnu (64-bit)\r\nRunning under: CentOS release 6.6 (Final)\r\n\r\nlocale:\r\n [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C\r\n [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8\r\n [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8\r\n [7] LC_PAPER=en_US.UTF-8       LC_NAME=C\r\n [9] LC_ADDRESS=C               LC_TELEPHONE=C\r\n[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C\r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base\r\n\r\nother attached packages:\r\n[1] rstan_2.8.2            ggplot2_1.0.1          rbLib_0.0.2\r\n[4] trawlDiversity_0.0.0.9 trawlData_0.1.0        data.table_1.9.6\r\n[7] devtools_1.9.1\r\n\r\nloaded via a namespace (and not attached):\r\n [1] Rcpp_0.12.2      magrittr_1.5     MASS_7.3-43      munsell_0.4.2\r\n [5] colorspace_1.2-6 stringr_1.0.0    plyr_1.8.3       tools_3.2.2\r\n [9] grid_3.2.2       gtable_0.1.2     digest_0.6.8     gridExtra_2.0.0\r\n[13] reshape2_1.4.1   numbers_0.6-1    memoise_0.2.1    inline_0.3.14\r\n[17] stringi_1.0-1    ssh.utils_1.0    scales_0.3.0     stats4_3.2.2\r\n[21] chron_2.3-47     proto_0.3-10\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/stan-dev/rstan/issues/comments/165949513","html_url":"https://github.com/stan-dev/rstan/issues/243#issuecomment-165949513","issue_url":"https://api.github.com/repos/stan-dev/rstan/issues/243","id":165949513,"user":{"login":"rBatt","id":5630847,"avatar_url":"https://avatars.githubusercontent.com/u/5630847?v=3","gravatar_id":"","url":"https://api.github.com/users/rBatt","html_url":"https://github.com/rBatt","followers_url":"https://api.github.com/users/rBatt/followers","following_url":"https://api.github.com/users/rBatt/following{/other_user}","gists_url":"https://api.github.com/users/rBatt/gists{/gist_id}","starred_url":"https://api.github.com/users/rBatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rBatt/subscriptions","organizations_url":"https://api.github.com/users/rBatt/orgs","repos_url":"https://api.github.com/users/rBatt/repos","events_url":"https://api.github.com/users/rBatt/events{/privacy}","received_events_url":"https://api.github.com/users/rBatt/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T05:37:30Z","updated_at":"2015-12-19T05:37:30Z","body":"Here's the error along with session info. I don't know why this is cropping up now.\r\n\r\nI had decided to try to just use the sampling() function by itself (rather than in mclapply), and on 1 core, just to make sure I could get it to go. This seems like it's probably unrelated to my core issue of not being able to call `stan()` with multiple cores.\r\n\r\nBut, because I find it puzzling, here it is:\r\n\r\n```{r}\r\n> sessionInfo()\r\nR version 3.2.2 (2015-08-14)\r\nPlatform: x86_64-apple-darwin13.4.0 (64-bit)\r\nRunning under: OS X 10.11.2 (El Capitan)\r\n\r\nlocale:\r\n[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8\r\n\r\nattached base packages:\r\n[1] parallel  stats     graphics  grDevices utils     datasets  methods  \r\n[8] base     \r\n\r\nother attached packages:\r\n[1] rstan_2.8.9            ggplot2_1.0.1          rbLib_0.0.2           \r\n[4] trawlDiversity_0.0.0.9 trawlData_0.2.1        data.table_1.9.4      \r\n[7] devtools_1.9.1        \r\n\r\nloaded via a namespace (and not attached):\r\n [1] Rcpp_0.12.2      magrittr_1.5     MASS_7.3-43      munsell_0.4.2   \r\n [5] colorspace_1.2-6 stringr_1.0.0    plyr_1.8.3       tools_3.2.2     \r\n [9] grid_3.2.2       gtable_0.1.2     digest_0.6.8     gridExtra_2.0.0 \r\n[13] reshape2_1.4.1   numbers_0.6-1    memoise_0.2.1    inline_0.3.14   \r\n[17] stringi_1.0-1    ssh.utils_1.0    scales_0.3.0     stats4_3.2.2    \r\n[21] chron_2.3-47     proto_0.3-10    \r\n> \r\n> ebs_msom_model <- stan_model(file=model_file, auto_write=TRUE)\r\nLoading required package: raster\r\nLoading required package: sp\r\n\r\nAttaching package: ‘raster’\r\n\r\nThe following object is masked from ‘package:rstan’:\r\n\r\n    extract\r\n\r\n> stan_control <- list(stepsize=0.01, adapt_delta=0.95, max_treedepth=15)\r\n> \r\n> t_out <- sampling(\r\n+ \t\tobject=ebs_msom_model,\r\n+ \t\tdata=stanData,\r\n+ \t\tcontrol=stan_control,\r\n+ \t\tpars= c(\"Omega\", \"alpha_mu\", \"alpha_sd\", \"beta_mu\", \"beta_sd\", \"phi_mu\", \"phi_sd\", \"gamma_mu\", \"gamma_sd\", \"phi\", \"gamma\", \"logit_psi\", \"logit_theta\"),\r\n+ \t\tchains=2, iter=4, seed=1337, cores=1, verbose=F, refresh=1\r\n+ )\r\nError in .local(object, ...) : \r\n  no slot of name \"mk_cppmodule\" for this object of class \"stanmodel\"\r\nCalls: sampling -> sampling -> .local\r\nExecution halted\r\n```"}}