Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
software:matlab:mills [2018-12-03 11:25] – [Matlab License Information] anita | software:matlab:mills [2019-08-29 16:05] (current) – [Matlab script] anita | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Matlab on Mills ====== | ||
+ | |||
+ | On Mills, MATLAB projects should be developed using a Desktop installation of MATLAB and then copied to the cluster | ||
+ | to be run in batch. | ||
+ | consider an extended MATLAB example involving two simple MATLAB functions, and two MATLAB scripts to execute | ||
+ | the first function in a loop, and to using the Parallel Toolbox. | ||
+ | |||
+ | Details on how to run these two scripts in batch are given with the resulting output files. | ||
+ | section with UNIX commands you can use to watch your jobs and gather [[# | ||
+ | You will need to know how much memory and how many cores you should request for your jobs. | ||
+ | |||
+ | Even though it easier to develop on a desktop, MATLAB can be run interactively on Farber. | ||
+ | Two interactive jobs are demonstrated. | ||
+ | second example shows an interactive session, which starts multiple MATLAB pool of workers to execute the function as a parallel toolbox loop, **'' | ||
+ | The Parallel toolbox gives a faster time to completion, but with more memory and CPU resources consumed. | ||
+ | |||
+ | Many MATLAB research projects fall in the the "high throughput computing" | ||
+ | Thus we have a | ||
+ | final example that gives the recommended workflow to scale your job to multiple nodes. The second MATLAB function has added logic to enabled it to be deployed as a compiled MATLAB code. Then it is deployed as a single threaded grid engine array job. | ||
+ | |||
+ | <note important> | ||
+ | The MATLAB distributed computing server (MDCS) is not installed on Mills. | ||
+ | an array job of compiled MATLAB is recommended for large jobs. | ||
+ | </ | ||
+ | |||
+ | ==== Matlab License Information ==== | ||
+ | |||
+ | Matlab licenses are pushed into consumable (global, per-job) integer complexes in Grid Engine and can be checked using | ||
+ | |||
+ | < | ||
+ | qhost -h global -F | ||
+ | </ | ||
+ | |||
+ | to list number of unused license seats for each product. | ||
+ | |||
+ | Below is an example representing a snapshot of unused licensed seats for Matlab products on the cluster. | ||
+ | < | ||
+ | [traine@mills ~]$ qhost -h global -F | ||
+ | HOSTNAME | ||
+ | ------------------------------------------------------------------------------- | ||
+ | global | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | gc: | ||
+ | </ | ||
+ | |||
+ | Matlab jobs can be submitted to require a certain number of license seats to be available before a job will run. If there are inter-license dependencies for toolboxes, then you should specify all the licenses including Matlab and/or Simulink. | ||
+ | |||
+ | For example, if a Matlab job requires the Financial toolbox, then you will also need to specify all the inter-related toolbox licenses required by the Financial toolbox such as the Statistics and Optimization toolboxes as well Matlab itself. See [[http:// | ||
+ | ]] for complete details. | ||
+ | |||
+ | < | ||
+ | qsub -l MLM.MATLAB=1, | ||
+ | </ | ||
+ | |||
+ | Naturally, this isn't a to-the-moment mapping because the license server is not being queried constantly. | ||
+ | |||
+ | This will be most helpful when submitting many Matlab jobs that require a toolbox with a low-seat count. They will wait for a toolbox seat to become available rather than trying to run and having many getting the " | ||
+ | |||
+ | ===== Matlab function ===== | ||
+ | |||
+ | Sample Matlab function: | ||
+ | <file matlab maxEig.m> | ||
+ | % maxEig | ||
+ | % Input parameters | ||
+ | % sd - seed for uniform random generator | ||
+ | % dim - size of the square matrix (should be odd) | ||
+ | % | ||
+ | % maxe - maximum real eigenvalue | ||
+ | function maxe = maxEig(sd, | ||
+ | rng(sd); | ||
+ | ev = eig( randn(dim) ); | ||
+ | maxe = max( ev(imag(ev)==0) ) | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | The examples will be using a Matlab function to illustrate using Matlab in batch and interactively. | ||
+ | |||
+ | |||
+ | ==== Matlab script ==== | ||
+ | First, write a Matlab script file. It should have a comment on the first line describing the purpose of the script and have the '' | ||
+ | |||
+ | <file matlab script.m> | ||
+ | % script to run maxEig function 200 times | ||
+ | |||
+ | count = 200; | ||
+ | dim = 5001; | ||
+ | sumMaxe = 0; | ||
+ | tic; | ||
+ | for i=1:count; | ||
+ | sumMaxe = sumMaxe + maxEig(i, | ||
+ | end; | ||
+ | toc | ||
+ | avgMaxEig = sumMaxe/ | ||
+ | |||
+ | quit | ||
+ | </ | ||
+ | |||
+ | This is a detailed script example, which calls the maxEig function. | ||
+ | |||
+ | <note tip> | ||
+ | Several MATLAB commands could be added to the beginning of this script to set the maximum number of computational threads to the number of slots assigned to your job. If the scheduler using CGROUPS to limit your job core count, then these commands are not necessary. | ||
+ | < | ||
+ | [compThreads, | ||
+ | if count == 1 | ||
+ | warning(' | ||
+ | autoCompThreads = maxNumCompThreads(compThreads); | ||
+ | disp(sprintf(' | ||
+ | end | ||
+ | </ | ||
+ | See [[maxNumCompThreadsGridEngine|Setting maximum number of computational threads]]</ | ||
+ | |||
+ | <note tip> | ||
+ | This script ends in a **__quit__** command (equivalent to MATLAB **__exit__**). | ||
+ | terminates MATLAB when done. If you run this from the bash command line with the '' | ||
+ | |||
+ | Without the **__quit__** you will come back to the MATLAB prompt on completion for a interactive job. If this is the last line of a batch queue script, then the only difference will be the MATLAB prompt ''>>'' | ||
+ | </ | ||
+ | |||
+ | ==== Grid Engine script ==== | ||
+ | |||
+ | Second, write a shell script file to set the Matlab environment and start Matlab running your script file. The following script file will set the Matlab environment and run the command in the [[# | ||
+ | |||
+ | <file bash batch-simple.qs> | ||
+ | #$ -N script-simple.m | ||
+ | #$ -m ea | ||
+ | #$ -M traine@gmail.com | ||
+ | #$ -pe threads 12 | ||
+ | |||
+ | vpkg_require matlab/ | ||
+ | matlab -nodisplay -nojvm -r script | ||
+ | </ | ||
+ | |||
+ | <file bash batch-catcherr.qs> | ||
+ | #$ -N script-catcherr.m | ||
+ | #$ -m ea | ||
+ | #$ -M traine@gmail.com | ||
+ | #$ -pe threads 12 | ||
+ | |||
+ | vpkg_require matlab/ | ||
+ | matlab -nodisplay -nojvm -r 'try; script; catch err; disp(err.getReport); | ||
+ | </ | ||
+ | |||
+ | Ths '' | ||
+ | The '' | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | This list of commands is the '' | ||
+ | there is an error in the script. | ||
+ | </ | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | * Do not include the '' | ||
+ | * Do set paper dimensions and print each figure to a file. | ||
+ | |||
+ | The text output will be included in the standard Grid Engine output file, but not any graphics. | ||
+ | |||
+ | We suggest setting the current figure' | ||
+ | |||
+ | <code matlab> | ||
+ | set(gcf,' | ||
+ | print(' | ||
+ | </ | ||
+ | |||
+ | will set the current figure to be 4 x 3 inches with no margins, and then print the figure as a 400x300 resolution '' | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Submit job ==== | ||
+ | Third, from the directory with both '' | ||
+ | |||
+ | < | ||
+ | qsub batch-simple.qs | ||
+ | </ | ||
+ | |||
+ | or | ||
+ | |||
+ | < | ||
+ | qsub batch-catcherr.qs | ||
+ | </ | ||
+ | |||
+ | <note warning> | ||
+ | |||
+ | In this example you will need a license for the base Matlab, and the parallel toolbox needs one license. | ||
+ | </ | ||
+ | ==== Wait for completion ==== | ||
+ | Finally, wait for the mail notification, | ||
+ | |||
+ | After waiting for about 5 hours, a message was receive with subject line "Grid Engine Job Scheduler": | ||
+ | |||
+ | < | ||
+ | Job 236214 (script.m) Complete | ||
+ | User = traine | ||
+ | Queue = it_css.q+@n017 | ||
+ | Host = n017.mills.hpc.udel.edu | ||
+ | Start Time = 03/27/2013 16:17:30 | ||
+ | End Time = 03/27/2013 21:11:46 | ||
+ | User Time = 1:10:47:28 | ||
+ | System Time = 00:30:04 | ||
+ | Wallclock Time = 04:54:16 | ||
+ | CPU = 1:11:17:33 | ||
+ | Max vmem = 1.976G | ||
+ | Exit Status | ||
+ | </ | ||
+ | |||
+ | ==== Gather results ==== | ||
+ | The results for Job 236214 are in the file | ||
+ | <code text> | ||
+ | Adding dependency `x11/ | ||
+ | Adding package `matlab/ | ||
+ | |||
+ | < M A T L A B (R) > | ||
+ | Copyright 1984-2013 The MathWorks, Inc. | ||
+ | R2013a (8.1.0.604) 64-bit (glnxa64) | ||
+ | | ||
+ | |||
+ | |||
+ | To get started, type one of these: helpwin, helpdesk, or demo. | ||
+ | For product information, | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | ''' | ||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | Elapsed time is 17651.125420 seconds. | ||
+ | |||
+ | avgMaxEig = | ||
+ | |||
+ | | ||
+ | </ | ||
+ | |||
+ | ==== Timing and core count ==== | ||
+ | |||
+ | While the batch job was running on node '' | ||
+ | every second | ||
+ | |||
+ | <code text> | ||
+ | $ ssh n017 top -H -b -d 1 -n 2 | egrep ' | ||
+ | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | ||
+ | 2158 traine | ||
+ | 2166 traine | ||
+ | 2167 traine | ||
+ | 2171 traine | ||
+ | 2173 traine | ||
+ | 2174 traine | ||
+ | 2175 traine | ||
+ | 2176 traine | ||
+ | 2168 traine | ||
+ | 2169 traine | ||
+ | 2170 traine | ||
+ | 2172 traine | ||
+ | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | ||
+ | 2158 traine | ||
+ | 2172 traine | ||
+ | 2166 traine | ||
+ | 2167 traine | ||
+ | 2168 traine | ||
+ | 2169 traine | ||
+ | 2170 traine | ||
+ | 2171 traine | ||
+ | 2173 traine | ||
+ | 2174 traine | ||
+ | 2176 traine | ||
+ | 2175 traine | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ ssh n017 mpstat -P ALL 1 2 | ||
+ | Linux 2.6.32-279.19.1.el6.x86_64 (n017) 03/27/2013 _x86_64_ (24 CPU) | ||
+ | |||
+ | 04:46:56 PM CPU %usr | ||
+ | 04:46:57 PM all | ||
+ | 04:46:57 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 04:46:57 PM 1 8.08 0.00 0.00 0.00 0.00 0.00 0.00 0.00 91.92 | ||
+ | 04:46:57 PM 2 | ||
+ | 04:46:57 PM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 04:46:57 PM 4 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 99.00 | ||
+ | 04:46:57 PM 5 | ||
+ | 04:46:57 PM 6 | ||
+ | 04:46:57 PM 7 | ||
+ | 04:46:57 PM 8 | ||
+ | 04:46:57 PM 9 | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | 04:46:57 PM | ||
+ | |||
+ | 04:46:57 PM CPU %usr | ||
+ | 04:46:58 PM all | ||
+ | 04:46:58 PM 0 100.00 | ||
+ | 04:46:58 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 04:46:58 PM 2 | ||
+ | 04:46:58 PM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 04:46:58 PM 4 0.00 0.00 2.00 0.00 0.00 0.00 0.00 0.00 98.00 | ||
+ | 04:46:58 PM 5 | ||
+ | 04:46:58 PM 6 100.00 | ||
+ | 04:46:58 PM 7 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 04:46:58 PM 8 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 04:46:58 PM 9 | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | 04:46:58 PM | ||
+ | </ | ||
+ | |||
+ | ==Conclusions== | ||
+ | The main computation task for this batch job is finding all 5001 eigenvalues. | ||
+ | |||
+ | We have the correct Grid Engine options '' | ||
+ | |||
+ | [[software: | ||
+ | |||
+ | ===== Batch parallel example ===== | ||
+ | |||
+ | The Matlab parallel toolbox uses JVM to manage the workers and communicate while you are running. | ||
+ | need to setup the Matlab pools in your '' | ||
+ | |||
+ | ==== Matlab script ==== | ||
+ | Here are the slightly modified MATLAB script and qsub script files. | ||
+ | |||
+ | Add two '' | ||
+ | <file matlab pscript.m> | ||
+ | % script to run maxEig function 200 times | ||
+ | mypool=parpool(20); | ||
+ | |||
+ | count = 200; | ||
+ | dim = 5001; | ||
+ | sumMaxe = 0; | ||
+ | tic; | ||
+ | parfor i=1:count; | ||
+ | sumMaxe = sumMaxe + maxEig(i, | ||
+ | end; | ||
+ | toc | ||
+ | avgMaxEig = sumMaxe/ | ||
+ | |||
+ | delete(mypool); | ||
+ | quit | ||
+ | </ | ||
+ | |||
+ | ==== Grid engine script ==== | ||
+ | Take out '' | ||
+ | <file bash pbatch.qs> | ||
+ | #$ -N pscript | ||
+ | #$ -m ea | ||
+ | #$ -M traine@gmail.com | ||
+ | #$ -l m_mem_free=3.1G | ||
+ | #$ -l MLM.Distrib_Computing_Toolbox=1 | ||
+ | #$ -pe threads 20 | ||
+ | |||
+ | vpkg_require matlab/ | ||
+ | |||
+ | ls | ||
+ | matlab -nodisplay -r ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Interactive example ===== | ||
+ | |||
+ | This example is based on being in your workgroup environment, | ||
+ | ==== Scheduling exclusive interactive job ==== | ||
+ | |||
+ | < | ||
+ | $ qlogin -l exclusive=1 | ||
+ | Your job 2493 (" | ||
+ | waiting for interactive job to be scheduled ... | ||
+ | Your interactive job 2493 has been successfully scheduled. | ||
+ | Establishing / | ||
+ | </ | ||
+ | |||
+ | ==== Starting a command mode matlab session ==== | ||
+ | |||
+ | < | ||
+ | $ vpkg_require matlab/ | ||
+ | Adding package `matlab/ | ||
+ | </ | ||
+ | < | ||
+ | $ matlab -nodesktop -nosplash | ||
+ | MATLAB is selecting SOFTWARE OPENGL rendering. | ||
+ | |||
+ | < M A T L A B (R) > | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | To get started, type one of these: helpwin, helpdesk, or demo. | ||
+ | For product information, | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Using help as the first command ==== | ||
+ | |||
+ | < | ||
+ | >> help maxEig | ||
+ | | ||
+ | Input parameters | ||
+ | sd - seed for uniform random generator | ||
+ | dim - size of the square matrix (should be odd) | ||
+ | Output value | ||
+ | maxe - maximum real eigvalue | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==== Calling function once ==== | ||
+ | |||
+ | Use the tic and toc commands to report the elapsed time to generate the random matrix, find all eigenvalues and report the maximum real eigvalue. | ||
+ | |||
+ | < | ||
+ | >> tic; maxEig(1, | ||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | Elapsed time is 86.564581 seconds. | ||
+ | </ | ||
+ | |||
+ | ==== Finishing up ==== | ||
+ | |||
+ | < | ||
+ | >> exit | ||
+ | $ exit | ||
+ | Connection to n036 closed. | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ===== Interactive parallel toolkit example ===== | ||
+ | |||
+ | When you plan to use the parallel toolbox, you should logon the compute node with the command | ||
+ | |||
+ | qlogin -pe threads 12 | ||
+ | | ||
+ | This will effectively reserve 12 slots for your Matlab workers. | ||
+ | |||
+ | Same example function called from 12 matlab workers (the maximum allowed for the local profile.) | ||
+ | Here we start 12 workers with the matlabpool, and then use parfor to send a different seed to each worker. | ||
+ | |||
+ | It took about 150 seconds to start all 12 workers, and this is no reflected in the total elapsed time. | ||
+ | |||
+ | < | ||
+ | >> matlabpool(12); | ||
+ | Starting matlabpool using the ' | ||
+ | >> tic; parfor sd = 1:12; maxEig(sd, | ||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | maxe = | ||
+ | |||
+ | | ||
+ | |||
+ | Elapsed time is 207.531791 seconds. | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== MCR (Matlab Compiler Runtime) array job ===== | ||
+ | |||
+ | Most Matlab functions can be compiled using the Matlab Compiler (MCC) and then deployed to run on the compute nodes in the MATLAB Compiler Runtime (MCR). | ||
+ | |||
+ | There are two ways to run compiled MATLAB jobs in a shared environment, | ||
+ | - Compile to produce and executable that uses a single computational thread - MATLAB option ' | ||
+ | - Submit the job to use the nodes exclusively - Grid engine option '' | ||
+ | |||
+ | You can run more jobs on each node when they compiled to use just one core (Single Comp Thread). | ||
+ | you higher throughput for an array job, but not higher performance. | ||
+ | |||
+ | ==== Example function ==== | ||
+ | |||
+ | As an example, consider the Matlab function with one parameter: | ||
+ | < | ||
+ | function maxe = maxEig(lam) | ||
+ | if (isdeployed) | ||
+ | lam=str2num(lam); | ||
+ | end | ||
+ | |||
+ | dim=10000; | ||
+ | M=rand(dim); | ||
+ | D=diag(rand(dim, | ||
+ | |||
+ | maxe = max(eig( M + lam*D )) | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | The MATLAB function '' | ||
+ | We should get different '' | ||
+ | </ | ||
+ | |||
+ | ==== Example compiler commands ==== | ||
+ | |||
+ | We can convert this function into a single computational executable by using the Matlab compiler '' | ||
+ | < | ||
+ | prog=maxEig | ||
+ | opt=' | ||
+ | version=' | ||
+ | |||
+ | vpkg_require matlab/ | ||
+ | mcc -R " | ||
+ | </ | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | <note tip> | ||
+ | options you want to use at run time. The '' | ||
+ | using MCR. The '' | ||
+ | |||
+ | |||
+ | ==== Example queue script file ==== | ||
+ | |||
+ | The '' | ||
+ | < | ||
+ | #$ -N maxEig | ||
+ | #$ -t 1-200 | ||
+ | # | ||
+ | # Parameter sweep array job to run the maxEig compiled MATLAB function with | ||
+ | # lambda = 1,2. ... 200 | ||
+ | # | ||
+ | date " | ||
+ | echo "Host $HOSTNAME" | ||
+ | |||
+ | let lambda=" | ||
+ | |||
+ | source / | ||
+ | vpkg_require mcr/ | ||
+ | export MCR_CACHE_ROOT=$TMPDIR | ||
+ | |||
+ | ./maxEig $lambda | ||
+ | |||
+ | date " | ||
+ | </ | ||
+ | |||
+ | The two '' | ||
+ | |||
+ | ==== Compiled MATLAB in owner queues ==== | ||
+ | |||
+ | To test the example compiled Matlab job on the three '' | ||
+ | < | ||
+ | #$ -t 1-6 | ||
+ | #$ -l exclusive=1 | ||
+ | </ | ||
+ | This will do 6 tasks with exclusive access to the node. That is, each node will do 2 tasks consecutively. | ||
+ | |||
+ | Next, we compile two copies of the program | ||
+ | - multiply computational threads (default). | ||
+ | - Single computional thread (-SingleCompThread) | ||
+ | |||
+ | **Times for two runs** | ||
+ | |||
+ | Multiple computational threads used a total of 16929.669 CPU seconds over 2226 seconds of elapsed time | ||
+ | on 3 nodes | ||
+ | ^ Array job started Tue 26 Feb 2013 07:59:48 PM EST ^^^^^^ | ||
+ | ^ Node ^^ Real Clock Time ^^^ | ||
+ | ^ Name ^ | ||
+ | | n015| | ||
+ | | n016| | ||
+ | | n017| | ||
+ | Single computational thread used a total of 8568.438 CPU seconds over 3351 seconds of elapsed time | ||
+ | on 3 nodes | ||
+ | ^ Array job started Mon 25 Feb 2013 08:46:29 PM EST ^^^^^^ | ||
+ | ^ Node ^^ Real Clock Time ^^^ | ||
+ | ^ Name ^ | ||
+ | | n015| | ||
+ | | n016| | ||
+ | | n017| | ||
+ | |||
+ | **Predicted times for 200 tasks** | ||
+ | |||
+ | In the multiple computational threads case, all the cores are being used by one Matlab job. So for 200 jobs we can continue to run 3 at a time. The median time for one job is 737.63, so the expected elapsed time for 200 tasks. | ||
+ | Time 737.63 * 200 /3 = 49175.33 seconds > 13 hours | ||
+ | |||
+ | In the multiple computational threads case, only one of the cores is being used. So for 200 jobs we can remove the exclusive access and run 72 jobs at a time on the the 3 nodes. The median time for one job is 1345.98, so the expected elapsed time for 200 tasks. | ||
+ | Time = 1345.98 * 200 /72 = 3738.83 seconds ≈ 1 hr | ||
+ | |||
+ | === SGE array job started Fri 22 Feb 2013 11:57:07 AM EST === | ||
+ | |||
+ | Command to submit 200 jobs. | ||
+ | < | ||
+ | |||
+ | All 200 jobs used a total of 680420.993 CPU seconds over 10916 seconds of elapsed time | ||
+ | on 3 nodes: | ||
+ | ^ Node ^^ Real Clock Time ^^^ | ||
+ | ^ Name ^ | ||
+ | | n015| 62| | ||
+ | | n016| 70| | ||
+ | | n017| 68| | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Compiled MATLAB standby queue ==== | ||
+ | === SGE array job started Fri 22 Feb 2013 04:05:28 PM EST === | ||
+ | Command to submit 200 jobs. | ||
+ | < | ||
+ | |||
+ | All 200 jobs used a total of 613305.888 CPU seconds over 5388 seconds of elapsed time | ||
+ | on 9 nodes: | ||
+ | ^ Node ^^ Real Clock Time ^^^ | ||
+ | ^ Name ^ | ||
+ | | n073| 24| | ||
+ | | n075| 24| | ||
+ | | n092| 24| | ||
+ | | n133| 24| | ||
+ | | n161| 24| | ||
+ | | n162| 24| | ||
+ | | n167| 24| | ||
+ | | n179| 24| | ||
+ | | n187| | ||
+ | |||
+ | {{: |