Closed jaymwin closed 3 years ago
Dear Jay,
your code is quite hard to read, you probably lost a couple of ` somewhere.
So, just to clarify:
install.packages('unixtools', repos = 'http://www.rforge.net/')
unixtools::set.tempdir("/bsuscratch/jwiniarski/nlrx/temp")
as suggested in #10 did not work?
Best, Sebastian
Hi Sebastian,
My apologies, the code is tidied up now. On the 2nd point I was able to install unixtools successfully on the cluster, but regardless of the path in unixtools::set.tempdir
we've gotten similar errors as the one shown above.
Hmm, I don't see anything super obvious here - so, I am poking around a bit in the dark: can you login to your cluster frontend node and double-check that you have the correct permissions for the temp folder?
# check permissions of the temp folder
ls -lad /bsuscratch/jwiniarski/nlrx/temp
# are there files in there?
ls -la /bsuscratch/jwiniarski/nlrx/temp
Dear @jaymwin,
thank you for reporting this issue. And thanks @bitbacchus for handling it.
I had a look at your example code and it looks fine to me. I think the main problem here is the unspecific error message that I implemented into nlrx. Let me explain, the error message you see is printed whenever the nlrx simulation tries to collect the output results of a simulation but does not find the file. Of course, this can have many different reasons. One of the reasons is the temp folder problem, which is currently mentioned in the error message.
However, by the time I realized that this error message might also be somehow misleading, because there are many other problems that can lead to this error which are way more common than the temp folder issue. However, it is also not possible to list all potential failures here in the error message, because it would be to much stuff to print to the console.
Thus, I decided to change the error message in the upcoming version of nlrx (I already implemented and pushed some changes today to the github version). So instead of suggesting the tempfolder approach, the error now only tells you that:
a) some simulation output was not found and b) that the two possible reasons are that either the simulation did not start or the simulation crashed. c) It also suggests to look at ??run_nl_all()
for further help.
I added the following tips on debugging this error message to ??run_nl_all():
Debugging "Temporary simulation output file not found" error message:
Whenever this error message appears it means that the simulation did not produce any output. Two main reasons can lead to this problem, either the simulation did not even start or the simulation crashed during runtime. Both can happen for several reasons and here are some hints for debugging this:
Missing software: Make sure that java is installed and available from the terminal (java -version). Make sure that NetLogo is installed and available from the terminal.
Wrong path definitions: Make sure your nlpath points to a folder containing NetLogo. Make sure your modelpath points to a *.nlogo model file. Make sure that the nlversion within your nl object matches the NetLogo version of your nlpath. Use the convenience function of nlrx for checking your nl object (print(nl), eval_variables_constants(nl)).
Temporary files cleanup: Due to automatic temp file cleanup on unix systems temporary output might be deleted. Try reassigning the default temp folder for this R session (the unixtools package has a neat function).
NetLogo runtime crashes: It can happen that your NetLogo model started but failed to produce output because of a NetLogo runtime error. Make sure your model is working correctly or track progress using print statements. Sometimes the java virtual machine crashes due to memory constraints.
So in summary, the error message appears whenever no output was written by the simulation. This can either happen when NetLogo did not start correctly or NetLogo crashed. In your case, as you are using the wolf sheep model, I would assume the model runs correctly. So probably you have some problems either related to java, netlogo or the modelpath. So please verify that your path definitions are correct (in context of the cluster executing your job).
One thing you could try is to verify that NetLogo runs from the command line on your cluster. Just login to a terminal running on your cluster and try to manually start a NetLogo simulation as explained in the NetLogo User Manual. If this works, chances are good that they also work from nlrx, as long as you define nlpath and modelpath correctly.
Hope this helps to track down the issue. nldoc
Thanks for elaborating on the possible issues underlying the error message, this is all very helpful. I believe paths to NetLogo, java, and the wolf sheep model are all set properly, as I can run simulations from the command line without trying clustermq.
My guess is that the error is specific to the cluster, and maybe the temporary folder we are using there? @bitbacchus I assume I have permissions for the temp folder, but I have not tried to login to the cluster frontend node yet. That is something I could try with the help of the university's research computing folks. If I figure the error out I'll be sure to mention it here.
Thanks, Jay
Complementing this post...
I got the same error when running my model with run_nl_dyn(), but not with run_nl_all(). I circunvented this issue by executing RStudio as admin (Windows 10).
Thanks,
Hello,
I've been trying to get one of the example NetLogo models (Wolf Sheep) to run in parallel on our university's computing cluster before attempting to do the same for my own NetLogo model. I can run models nlrx with no problem, but when I try to follow the clustermq example on the Advanced Configuration page I get errors that look like this when I run the clustermq::Q() function:
I've tried changing the location of the temp directory, but end up with similar errors. I'm connecting to the university's computing cluster and running the following code using the command line (the terminal on my macbook):
I can't seem to figure out why those csvs can't be located...is this a clustermq issue?
Thanks, and thanks for creating this great R package,
Jay