MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Manuale Utente Pagina 9

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 22
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 8
Distributing Your MATLAB Code
Example: Deploying a Compiled MATLAB Application
Two Approaches: Direct and Compiled
You can invoke a MATLAB executable from a GenePattern module using one of two approaches: the direct approach
or the compiled approach. Following are brief descriptions of each approach, including its advantages and
disadvantages:
Direct approach. In the direct approach, the GenePattern task directly invokes the MATLAB executable, which
executes your M-code. This approach is best suited for use on a standalone GenePattern server, where you
already have a MATLAB license and you will not redistribute the MATLAB-based GenePattern modules to other
users who do not have their own MATLAB licenses. The advantages to this approach are: it is the simplest way
to getting your M-code running on GenePattern, it can be used for any MATLAB and GenePattern supported
platform, and it allows for easier modification of the M-code files as you modify your analysis. The disadvantages
of this approach are: it requires a MATLAB license for each concurrent user on the GenePattern server machine
and, if you change platforms, you must change the command line because different platforms have different
methods of passing arguments to MATLAB.
Compiled approach. In the compiled approach, you use the MATLAB Compiler to generate a standalone
executable; the GenePattern task then invokes that executable. The advantages to this approach are: it allows
redistribution of the module to other GenePattern users who do not have their own MATLAB license and it can
be run on a shared server without needing to get a MATLAB license for each concurrent user. The
disadvantages are: it requires you to have a MATLAB Compiler license, it can be used only on platforms
supported by the MATLAB Compiler, it must be compiled separately for each platform, and the GenePattern
server must have the MATLAB Component Runtime (MCR) installed before it can run the compiler-generated
executable.
If you are simply using your M-code on your standalone GenePattern server, the direct approach is simpler; however,
if you want to give copies of your M-code to other people or deploy your M-code on a shared GenePattern server, the
compiled approach is preferred. The compiled approach may provide slightly better performance for fast running
tasks since the startup delay will be shorter, but the actual execution time will be approximately the same for either
approach.
MATLAB Versions
The instructions in this section are based on the following MATLAB versions:
MATLAB 7.1 (part of Release 14). Earlier versions of MATLAB use a different (deprecated) mechanism for
deployment, which is not compatible with the instructions provided in this guide. For Mac OS X, these
instructions were tested using MATLAB 7.2.
MATLAB Compiler 4.0 or later. The MATLAB Compiler is currently available on Windows, Unix, and Mac OS X;
therefore, these are the only platforms on which you may deploy a compiled MATLAB-based task. For Mac OS
X, these instructions were tested using the MATLAB Compiler 4.4.
The MATLAB Compiler generates executables only for the platform on which it is executing. For example, if you
create a MATLAB executable on Windows, the MATLAB-based module that invokes that executable can only be
deployed on a GenePattern server running under Windows. Therefore, you need a MATLAB (and MATLAB
Compiler) license for each platform on which you wish to deploy your executable.
Adapting Your MATLAB Code
When you create a task in GenePattern, you specify the command line that invokes the program that performs the
desired function. Generally, the command line includes arguments, such as the parameters for the algorithm and the
data file to analyze.
Calling script M-code from a command line is possible, but generally not useful because you cannot pass arguments
to the script. To pass arguments to your M-code, create a no-return entry function to serve as the top level call into
MATLAB. The following example defines a no-return entry function that accepts two parameters:
function analyzeThis ( filename, whatToWrite )
... (your M-code here)
Writing Modules for GenePattern provides additional guidelines for writing code that will run as a GenePattern task.
9
Vedere la pagina 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 21 22

Commenti su questo manuale

Nessun commento