General Computing Info |
Printers and Shared Drives
Rules and Advice |
Miscellaneous |
SEL Library Resources
Before Writing a Masters Thesis |
For Students who are Leaving
In order to access the CHTC, you will need to register for an account. You can request an account here.
Before running MATLAB on the CHTC, it is important to understand the HTCondor language and run basic code. You can learn how to do this here.
There is a guide available on the CHTC website that show the steps of running MATLAB code on the CHTC. However, the guide here will go into more detail and also address some niche problems.
Basic Instructions to connect to the CHTC can be found here.
Note that you will need to be connected to the UW-Madison VPN to connect to CHTC.
It is recommended that you use a file transfer program to manage the files on the CHTC. I would recommend using WinSCP to manage files and Putty
to access the online command prompt of the CHTC.
The main script file should be converted to function files if multiple inputs or combinations of inputs are to be put in to make use of the parallelism of the CHTC. Make sure to convert input variables from str type to num type with the str2num() function on MATLAB since all inputs will be in str. Also, remove all semicolons for the final output variables as they do not automatically appear in the CHTC output, but rather need to be printed to the command line.
The other requirement to have all the supporting MATLAB functions on a functions/ folder. This can be achieved from the following steps:
To compile everything for the CHTC, follow the steps below:
Note that this is specific for running a main script called ‘ZZvsModel.m’. Change that part of the code as needed.
After exiting, a .sh file will be created. If the main MATLAB script is ‘ZZvsModel.m’, this file will be named ‘run_ZZvsModel.sh’. Open this file and add the following to the file:
tar -xzf r2018b.tar.gz
mkdir cache
export MCR_CACHE_ROOT=$PWD/cache
You should also find that the compiled script file has been created. If your main MATLAB script is called 'ZZvsModel.m', the script will be named 'ZZvsModel'.
For Submission, we require 3 things:
If you are using the CHTC to run many combinations of inputs, an input csv file will allow you to have each input combination running on seperate nodes and make use of the CHTC's parallelism.
Take ZZvsModel.m as an example MATLAB script that is going to be run on the CHTC. The function inputs are shown below:
ZZvsModel(run, A, B)
Where "run", "A", and "B" are all the inputs we want to vary. In this example, we would prepare a csv file that appears as below:
0, 0.1, 0.3
1, 0.2, 0.3
2, 0.1, 0.4
3, 0.2, 0.4
Note that the header information should not be added to the csv file. The input 'run' is something that should be added to your MATLAB main script as a way to keep track of the input combinations later. It is also useful to use the 'run' input as a way to vary the names of the output file or any .mat file generated between each input combination. We will see how this CSV file is used in the next section.
A basic non-MATLAB specific MATLAB submit file can be found here. An example of a submit file tailored for MATLAB can be found here. There are a few things to note about the submit file:
If everything is ready, type in "condor_submit submitfile.sub" to the CHTC terminal. Type in "condor_q" to check the progress of your files.
For the output of your script, you could either save the variables to a .mat file (which you should vary by run number on the MATLAB script itself) or read from the output text file. The first is quite straightforward, but these files are generally magnitudes larger in file size compared output text files. If you decide to use the .mat files, check out this website to transfer files from the CHTC cloud to your computer more efficiently.
If you decide to use the output text files, there are a few things to take note of.
File last updated: September 16, 2009
|