Netlogo Benchmarking - installation

I'm a little rusty on running Netlogo from commandline and have never used the benchmarking feature before. It seems promising. =)
I'm totally at the beginning, because it seems NetLogo 6.0 may be a bit different than 5.*.
I'm trying to get the benchmarking suite to run: https://github.com/NetLogo/NetLogo/wiki/Benchmarking
For now, I downloaded some of the files from http://ccl.northwestern.edu/netlogo/models/models/test/benchmarks/
and created 2 directories in my NetLogo 6.0 directory
NetLogo 6.0/models/tests
and
NetLogo 6.0/models/benchmarks
and put the files from http://ccl.northwestern.edu/netlogo/models/models/test/benchmarks/ into my benchmarks directory.
On the website, it says to run ./sbt and then run-main org.nlogo.headless.HeadlessBenchmarker Bureaucrats However, I'm being n00bish and don't have the command ./sbt setup. I saw that this was a general extension installer command thing online, but wasn't sure what to do with it...Sorry. So my question now is, what do I do next in order for me to get this up and running?
From the documentation side of things, I think it may need to be cleared up that there should be a file in /models/test/benchmarks/ named "Bureaucrats Benchmark.nlogo" I didn't realize the driver appends " Benchmark.nlogo" to the name provided. It may be useful to say to provide the <name> to the org.nlogo.headless.HeadlessBenchmarker if the file is called "<name> Benchmark.nlogo"
I didn't get to it yet, but is there any way for us to call all the benchmarks in the benchmarks directory? There was a reference to it in the docs, but I didn't see any command.
Let me know what you think and any help is appreciated!
Edit: After downloading the repo from git, as Bryan suggested, I ran the ./sbt and got the following error.
[error] (run-main-0) java.lang.ClassNotFoundException:
org.nlogo.headless.HeadlessBenchmarker
java.lang.ClassNotFoundException:
org.nlogo.headless.HeadlessBenchmarker at
java.lang.ClassLoader.findClass(ClassLoader.java:530) at
java.lang.ClassLoader.loadClass(ClassLoader.java:424) [trace] Stack
trace suppressed: run last root/compile:runMain for the full output.
java.lang.RuntimeException: Nonzero exit code: 1 at
scala.sys.package$.error(package.scala:27) [trace] Stack trace
suppressed: run last root/compile:runMain for the full output. [error]
(root/compile:runMain) Nonzero exit code: 1 [error] Total time: 2 s,
completed Apr 10, 2017 2:16:21 PM

./sbt is included in the NetLogo repository. It's this file. Running that will install sbt (and scala) itself, if need be. Make sure you're inside the root directory of the NetLogo repository when you run it.
Edit:
Wait, to clarify, are you trying to benchmark your own models or NetLogo itself?
If NetLogo itself (which is what https://github.com/NetLogo/NetLogo/wiki/Benchmarking is talking about), you need to checkout the NetLogo repository from github: https://github.com/NetLogo/NetLogo . The only reason you'd probably want to be doing this is if you're planning on contributing to core NetLogo code or are working on an extension or something.
For just benchmarking your own models, you don't want to do any of that. Typically, it's better to just benchmark from within the NetLogo program, not at the command line. The simplest way of benchmarking is doing things like this:
setup reset-timer repeat 1000 [ go ] print timer
which will tell you how long it takes for your model to do 1000 ticks. So, run that a couple times , modify your model, and then run it a couple more times, and that will give you sense of how your changes affected performance.
For more in depth benchmarking and profiling, use the profiler extension. That will break your program down, telling you how long each procedure is taking and so forth.

I've updated the wiki page with the current correct command. (I changed run-main to headless/runMain.)
is there any way for us to call all the benchmarks in the benchmarks directory?
I think it does that if you don't pass a benchmark name...? Worth a try. (If you figure it out, please update the wiki page.)

Related

FAILURE: Build failed with an exception. Gradle not working on bash on Ubuntu on Windows

I'm trying to figure out how to use gradle on bash on Ubuntu on Windows, but all the tutorials assume that everything goes smoothly and I keep getting this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred starting process 'Gradle build daemon'
I tried to post code from the stacktrace here, but it was impossible to format as code on this form. The "code" button doesn't do anything and I wasn't even able to use 4 spaces in parts of my code to manually format it. I am extremely intelligent, but I have never used gradle successfully before (and this form being wonky is double frustrating) and I've worked dozens of hours to find a useful tutorial for someone like me who has run many complex programs in compilers, but never used a build tool before. Frankly, no one has ever told me what a build tool is useful for (other than basic scripting which I understand) and the information is hidden very well online. My programs run fine without a scripting tool, but I know I'm missing something and gradle seems to be essential for some reason, but nearly impossible to learn without expert guidance since all the tutorials leave out essential information. I assume knowledge of ant and maven are taken for granted, but if gradle is as superior as it is touted to be, it would be counterproductive to learn the inferior build tools. Is there any way to learn gradle without wishing for death? Please help.

Dependency solution when make/compile error from source code

Very often we need to install software from its source code. Most of the time I just hit "make world" or "make all" then it will work like a charm. But some other time we see make errors, and we need to install other packages in order to let the make go through. This is particularly a problem for compiling low-level systems, such as a Linux kernel or Xen hypervisor.
I have one experience with Xen 3.4. Maybe it has been documented in some corner documents, but it depends on udev-125 to work properly. The weird thing is it functions well most of the time when udev version is 160+, it only breaks in certain cases! It took me a few MONTHS to find out it was because of the wrong udev version!
To make developers' life easier, when a source code is made successfully in one machine, is there some tools to record the list of packages and versions of that machine? Such a 'snapshot' should be shipped with the source code as well, so that when someone meets the make error they at least have a successful 'snapshot' for reference.
Is there such a tool already?
If your software depends on a specific version of a dependency, you should write a check for your configure script/cmakefile/etc. that tests the version of the dependency and bails out if the wrong version was found.
Comparing the output of config.log (a file created by a configure script) can also help diagnose problems like you encountered.

process freezes during make on linphone for android

I've been trying to build linphone for android for a few days now but I've come to a point where I'm unable to fix the problem I encounter in the build process.
I've been following the provided readme step by step and also tried several ways explained here in SO questions but non get me passed this current point.
http://pastebin.com/gxmc2gwZ
The above pasbin link shows the output of my mingw32 window when I run make. At the end it just holds. It feels like make just goes into an infinite loop. I've left it running overnight but it stays at that exact spot. The only way to stop it is ctrl-c.
Sofar I've used 3 difirent android NDK builds thinking there might be an incompatability.
r8e, r7c and r7 dont work. r7 doesn't even get this far.
I've also tried running make with SHELL="sh -x" but the resulting output is hardly difirent (as expected).
I've tried searching on google but all hits always show an error in the logs. Mine does not.
If anyone has any idea what can cause it to hang that would be REALLY appriciated.
I fixed the problem by running ndk-build.cmd from the project root directory in a command prompt instead of using make in mingw wich called the linux version. my project is now happely compiling along.

Can't run Informix 4GL Interactive Debugger

I am reading through Informix 4GL By Example. Ex4 is giving a segmentation fault so I am attempting to use the debugger to find out where the program is failing, but the debugger is not working.
From within r4gl, I can compile forms and modules. But when I debug it shows a blank screen with
"Press Return to continue".
From the command line fgldb returns the following error:
fgldb: symbol lookup error: fgldb: undefined symbol: kw__numkws
DB is up and running, I can isql in and run queries.
System details:
OpenSuSE 12.1 32 bit
Informix RDS 7.50 UC6
Informix SQL DEV 7.50 UC6
Informix Growth Edition 11.70 UC5
Informix Interactive Debugger 7.50 UC6
I have searched the net, but have not found anything helpful. Any idea what's wrong?
UPDATE 1:
Thank you again for the assistance. I will be trying to install in a seperate directory and let you know. This is probably blonde but how do I install in a different directory. If I attempt to I get errors:
"INFORMIXDIR and working directory do not match."
"INFORMIXDIR = /usr/informix"
"Current working directory = /usr/informix/i4gl"
Can I edit $INFORMIXDIR to match where I want to install?
Many thanks,
Neill
UPDATE 2:
OK, so I got them both installed in /usr/informix/i4gl.
Set variables to point to that directory, not sure exactly which ones need to though because I still receive errors.
fgldb: -16326: Cannot open file 'fgldb.iem'
The /usr/informix/i4gl does contain a directory msg/en_us/0333, but that file does not exist there, while /usr/informix/msg/en_us/0333 does include the fgldb.iem file.
isql -> Query Language: Says SELECT DATABASE, but none or shown for me to select.
Kind regards
Neill
UPDATE 3:
OK, my blonde momnets are getting crazy now, but after installing into /usr/informix/i4gl, I never changed back the $INFORMIXDIR variable. I did this and then stopped and started the DB.
Now when trying to compile the demo f_custkey.per (using stores_demo db as before) form, I get errors -329 and -2810, which are to do with the database not found.
I am not sure if this is what you were talking about in your last statement. I am unsure if splitting these two into seperate directories has solved my debugger issue because now I can't compile anything, but I sense I am getting close.
Kind regards,
Neill
UPDATE 4 - Final!
OK, so it is working now.
Ran the dbaccessdemo7 command again to recreate the database and all is well in the land of nod.
Compiling and debugging ex4 now works.
Thank you so much for all the information. Learning as I go.
Kind regards
Neill
The kw_numkws issue is fixed post 7.50.UC6. So the next available fixpack will have the fix.
In the interim, IBM Technical Support has posted a "Tech Alert" advising customers to install I4GL (and ISQL) in a separate directory - option #2 suggested by Jonathan Leffler above.
The core dump/crash that you're hitting is an unfortunate bug that we found out about earlier this week. The ESQL/C code is fixed (as of today), but the fixed releases are not yet available, and won't be for a while (read 'until after Thanksgiving at the earliest'). The I4GL and ISQL code still has to be fixed (some separate, but closely related problems).
What's happened is that a structure changed size in the CSDK. I4GL will be compiling the code with the one size and the CSDK libraries are expecting another size; the difference is about 4 bytes.
This leads to hard to track memory overwriting.
The kw__numkws issue is an older problem that I thought was fixed in 7.50.UC6. I'll have to check whether that release did get the fix, and if so, how you are seeing that error still.
There are a couple of short-term options that should get you going until a fixed ensemble is available:
Reinstall I4GL (and ISQL) in the server directory. I've not proved that this will work. The concept is to make sure I4GL is using the CSDK libraries it was built with, rather than the updated 3.70.xC6 version.
Reinstall I4GL (and ISQL) in a separate directory (/opt/IBM/i4gl, perhaps). Have a suitable sqlhosts file in this directory; it might be a symlink to the one in the IDS directory. Point the I4GL programs at this alternative directory, setting LD_LIBRARY_PATH appropriately.
Option 2 ensures that I4GL is using the 'correct' CSDK. Option 1 may achieve the same result, but I'm not ready to guarantee it. Consequently, I suggest option 2.
If your I4GL code needs to run DB-Access or other programs found in the server $INFORMIXDIR, there are ways to deal with that — indicate in a comment and I'll explain, but I'd rather not confound you if there's no need. (It's not dreadfully hard, but it isn't completely trivial either.)
Option 3. is to discover what CSDK was used to create the 4GL tools and install THAT instead of the current one. In the case of 4GL 7.50FC6 it CSDK 3.70FC4.
I had problems splitting up the engine and the tools. This appears to work, so far.

Profile Jekyll build time

I use Jekyll to build my site, and it is starting to take a rather long time (a few minutes) to compile the site (of a bit more than 600 posts). I suspect that some plugins might be responsible, but it seems there must be a better way to profile the performance of the build than to simply toggle on and off different plugins and parsers.
The minimal output during the build doesn't give any hints -- all the time is simply spent in the "building site" step. I thought I could run the jekyll script through ruby-prof to get some idea, so I made a quick local copy of the jekyll script as jekyll.rb in my site root directory and ran
ruby-prof jekyll.rb
The site looks like it builds fine, but the profiler just chokes with an ugly core dump.
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Aborted (core dumped)
Is there a more intelligent way to profile the building process of my site and figure out why it's so slow?
Secondly, are there any tricks to speed up the compile time? (For instance, I see the existence of a _cache directory in _plugins, but don't know exactly what it does. I also see an --auto flag to Jekyll, but don't see how I could configure it such that it always recompiles certain pages wether or not they have changed (e.g. the twitter plugin needs to be re-run each time) while not recompiling the unchanged posts).
If anyone wants to poke around first-hand, the Jekyll source of the site is on Github, with some notes in the readme about additional gem dependencies.
Try Ruby GSL
gem install gsl
http://rb-gsl.rubyforge.org/
Should help speed up the build time.

Resources