mhtess / rwebppl

RWebPPL, an R interface to Webppl http://webppl.org
22 stars 7 forks source link

Model output occasionally returns Null #48

Closed mhtess closed 7 years ago

mhtess commented 7 years ago

Sometimes rwebppl is returning a NULL object to R. This may be due to multiple chains finishing at the same time.

hawkrobe commented 7 years ago

This has been happening to me quite a bit, too (although I'm not running multiple chains...)

mhtess commented 7 years ago

@hawkrobe and I discussed today that this is probably due to our dumb trigger for when to read from file, which is some number of seconds after the output file was created. It seems like we may want to address this and #22 in the same swoop, possibly by replacing our system2 call with something from the subprocess package

mhtess commented 7 years ago

alternatively, we can create a shell script wrapper for the system2 call, which runs webppl and then writes a file to signal the end.

hawkrobe commented 7 years ago

Related to my comment on issue #45, I believe the issue is that we're currently using the asynchronous versions of fs functions: in particular, fs.writeFile() and fs.rename() are non-blocking, so that the finally block where the finish file is written doesn't wait for the output file to be written or renamed.

hawkrobe commented 7 years ago

I propose we switch to the synchronous versions since we're not really getting anything from the asynchrony

hawkrobe commented 7 years ago

Closed by PR #52