---+!! !How-To Guides %TOC% ---++ Using R _Apr 6, 2011_ ---+++ Installing R and RServe ---++++ Installing R _see_ [[http://www.r-project.org/]] ---++++ Installing packages * Installing packages can be done from the R interpreter with the line => install.packages(c('perm','boot'))= * Installed packages must be loaded using => library(boot)= ---+++ Running RServe _see_ [[http://rosuda.org/Rserve/doc.shtml]] 1. Command line: =R CMD Rserve --RS-conf <config file>= * config file must have the following line: =remote enable= ---++ Running !ExperimentRunner _Mar 28, 2011_ 1. If you have access, clone the git repository located at *ssh://[name]@okanagan.cs.ubc.ca/ubc/cs/project/arrow/git/smac.git* - the experiment runner is currently only located in the *[smac working copy]* branch. The files are temporarily available from /ubc/cs/project/arrow/mavc/halspace/ 1. You will want to have a directory with the following directories or links: * *algorithms/* containing algorithm executables/wrappers. * *features/* containing .csv instance feature files. * *instances/* containing instances. * *scenarios/* containing JSON scenario files. * *targetalgs/* containing target algorithm wrappers. * These are temporarily available from /ubc/cs/project/arrow/mavc/halspace 1. Set the db name. * If you used a MySQL Database, you will need to get the MySQL plugin from the !HAL Website *ssh://[name]@okanagan.cs.ubc.ca/ubc/cs/project/arrow/git/mysql-hal.git* 1. a. *Running locally*: See [[#RunL][Running Locally]] a. *Running on Arrow*: See [[#RunA][Running on Arrow]] a. *Running on Westgrid*: See [[#RunW][Running on Westgrid]] 1. The Experiment Runner requires classes from !HAL. You can grab !HAL from *ssh://[name]@okanagan.cs.ubc.ca/ubc/cs/project/arrow/git/hal.git* 1. Export jar to the directory structure, from right-click -> export -> Runnable Jar. This requires a _Run Configuration_, which you can create by running !CmdLineExperimentRunner.java from Eclipse. Alternatively, run it from Eclipse with the appropriate Run Configuration. 1. Run the .jar with the command *java -jar <name>.jar [options]*. Running with no options provided will print a usage statement. #RunL ---+++ Running Locally * The MCR library must be on the java library path. * With bash: *export LD_LIBRARY_PATH = /cs/local/lib/pkg/matlab-7.10/runtime/glnxa64/* (or the appropriate path for your installation). * With csh : *setenv LD_LIBRARY_PATH /cs/local/lib/pkg/matlab-7.10/runtime/glnx86/* * Note that the MCR is _version-dependent_. It will not work with alternate versions of matlab. #RunA ---+++ Running on Arrow * We don't support this directly. See Frank's script */ubc/cs/project/arrow/hutter/hal/runOnCluster.rb* for an example of how to do this. #RunW ---+++ Running on Westgrid * There are some special considerations for running on Westgrid a. Installing ruby (for !ParamILS and wrapper scripts) a. Installing MCR (for SMAC). The MCR installer can be located in the following locations: i. */cs/local/lib/pkg/matlab-7.10/toolbox/compiler/deploy/glnx86/MCRInstaller.bin* i. */cs/local/lib/pkg/matlab-7.10/toolbox/compiler/deploy/glnxa64/MCRInstaller.bin* a. Setting up Directory Structure - see above. * Mathworks recommends the following for linux: <pre> * setenv LD_LIBRARY_PATH <MCR_ROOT>/bin/glnx86: <MCR_ROOT>/sys/os/glnx86: <MCR_ROOT>/sys/java/jre/glnx86/jre1.4.2/lib/i386/client: <MCR_ROOT>/sys/java/jre/glnx86/jre1.4.2/lib/i386: <MCR_ROOT>/sys/opengl/lib/glnx86:${LD_LIBRARY_PATH} * setenv XAPPLRESDIR <MCR_ROOT>/X11/app-defaults</pre> ---+++ Monitoring with !Hal 1. Start !HAL with the command *java -jar hal.jar*. This will create a hal.json file. 1. Modify the JSON file and change the database name if necessary. 1. Add the necessary plugins to the *plugins/* folder. a. *MySQL*: a. *SMAC*: 1. After you start !HAL with the right database, you can monitor your jobs through http://localhost:8080/hal/ ---++ Westgrid Quick Start ---+++ Getting a Westgrid account ---+++ Getting files onto Westrid ---+++ Submitting jobs to Westgrid ---++ Matlab Builder JA Quick Start _See attached [[%ATTACHURL%/javabuilder.pdf][user guide]]_ ---+++ Hello World A "Hello World" example is described below. We will describe how to call the following Matlab function from Java. <pre><code> function hello % Hello world example % hello.m fprintf(1, 'Hello World\n'); </code></pre> ---++++ Exporting JAR 1. *MCR* must be installed and its directory added to the system's path variable. 1. Create a new deployment project by entering =deploytool= into the Matlab command window. <img src="%ATTACHURL%/java_t1.png" style="display:block;margin-left:auto;margin-right:auto;margin-top:10px;margin-bottom:10px" /> 1. In the Deployment Tool window, create the necessary classes by clicking *[Add Class]*. For each class, add the matlab function (_*.m_) files that belong to the class by selecting *[Add files]*.<img src="%ATTACHURLPATH%/java_t2.png" alt="Add classes and matlab functions" width="768" height="215" style="display:block;margin-left:auto;margin-right:auto;margin-top:10px;margin-bottom:10px" /> 1. Create the Java Package by selecting the *build* button. This will create src and distrib folders containing your *[project].jar* file. The name of the jar file may be specified from Settings. ---++++ Calling code from Eclipse 1. Add *[project].jar* and *javabuilder.jar* to the build path. The *javabuilder.jar* should be located in =/toolbox/javabuilder/jar/javabuilder.jar= inside your Matlab folder. 1. Any code that calls code from these java classes must also import =com.mathworks.toolbox.javabuilder.*=. 1. Call the function like a normal Java method from an instance of the class. Conversion between Java and Matlab types may be handled either automatically or explicitly (see [[#MatlabDataTypes][next section]]). #MatlabDataTypes ---++++Data Types and Conversion Data conversion classes are available in the following hierarchy: * !MWArray * !MWNumericArray * !MWLogicalArray * !MWCharArray * !MWCellArray * !MWStructArray Matlab Builder will perform conversion from native types automatically, and constructors can be used with Java types and arrays. Pass by reference is available with the !MWJavaObjectRef wrapper, a subclass of !MWArray. ---++++ Javadoc Location * Javadocs for !JavaBuilder are located: [[http://www.mathworks.com/help/toolbox/javabuilder][here]], after registering for a free account. * You can read Mathwork's DMCA notice that took down mirrors of the site [[http://www.chillingeffects.org/notice.cgi?sID=24892][here]]. ---++++ Turning off display. * Sometimes, you might see a message about the display. The matlab display can be turned off with the "-nodisplay" option: =MWApplication.initializeApplication(MWMCROption.NODISPLAY);= ---++ !HAL quick start guide _see_ [[http://hal.cs.ubc.ca/]] * [[%ATTACHURL%/javabuilder.pdf][javabuilder.pdf]]: Matlab Builder JA User Guide
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
pdf
javabuilder.pdf
r1
manage
1402.6 K
2011-01-06 - 21:59
UnknownUser
Matlab Builder JA User Guide
This topic: BETA
>
HowToGuides
Topic revision: r16 - 2011-04-07 - mavc
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback