| 1 | == MATLAB client on Cypress == |
| 2 | With this method, you can submit MATLAB jobs from MATLAB running on an interactive session. See how to run MATLAB interactively [https://wiki.hpc.tulane.edu/trac/wiki/cypress/Matlab#RunningMATLABinteractively here]. |
| 3 | |
| 4 | [[Image(https://docs.google.com/drawings/d/e/2PACX-1vQOfTErIgP29J7ZXKSIj3JbaxJeWm5xHjOXoDUQbN_qfpD95CycAvPGgXbkGw8rQ74XiXMENLr8YKD4/pub?w=755&h=200)]] |
| 5 | |
| 6 | === Configuration === |
| 7 | Login to Cypress and start an interactive session and then start MATLAB (see [https://wiki.hpc.tulane.edu/trac/wiki/cypress/Matlab#RunningMATLABinteractively here]) |
| 8 | Configure MATLAB to run parallel jobs on your cluster by calling '''configCluster''', which only needs to be called once per version of MATLAB. |
| 9 | Please be aware that running '''configCluster''' more than once per version will reset your cluster profile back to default settings and erase any saved modifications to the profile. |
| 10 | |
| 11 | {{{ |
| 12 | >> configCluster |
| 13 | }}} |
| 14 | |
| 15 | Jobs will now default to the cluster rather than submit to the current node. |
| 16 | |
| 17 | When you encounter an error ''Unrecognized function or variable 'configCluster'. '', try |
| 18 | |
| 19 | {{{ |
| 20 | >> rehash toolboxcache |
| 21 | }}} |
| 22 | |
| 23 | |
| 24 | |
| 25 | == INTERACTIVE JOBS - MATLAB client on Cypress == |
| 26 | Note this is for '''MATLAB client on Cypress'''. |
| 27 | |
| 28 | To run an interactive pool job on the cluster, continue to use parpool as you’ve done before. |
| 29 | {{{ |
| 30 | >> % Get a handle to the cluster |
| 31 | >> c = parcluster; |
| 32 | }}} |
| 33 | {{{ |
| 34 | >> % Open a pool of 4 workers on the cluster (works up to 12?) |
| 35 | >> p = c.parpool(4); |
| 36 | }}} |
| 37 | Rather than running local on the local machine, the pool can now run across multiple nodes on the cluster. |
| 38 | {{{ |
| 39 | >> % Run a parfor over 1000 iterations |
| 40 | >> parfor idx = 1:1000 |
| 41 | a(idx) = idx |
| 42 | end |
| 43 | }}} |
| 44 | Once we’re done with the pool, delete it. |
| 45 | {{{ |
| 46 | >> % Delete the pool |
| 47 | >> p.delete |
| 48 | }}} |
| 49 | |
| 50 | *** If you get a pop-up window 'Use identity file to login to cypress.tulane.edu', press 'NO' *** |
| 51 | |