Skip to content
Snippets Groups Projects
Commit 4285c16c authored by Jan Frenzel's avatar Jan Frenzel
Browse files

Merge branch 'issue213' into 'preview'

Resolves issue regarding prompts

Closes #213

See merge request !406
parents 24f0cc68 3dd798a6
No related branches found
No related tags found
2 merge requests!412Manual attempt to merge preview into main,!406Resolves issue regarding prompts
...@@ -21,9 +21,9 @@ font manager. ...@@ -21,9 +21,9 @@ font manager.
You need to copy the fonts from ZIH systems to your local system and expand the font path You need to copy the fonts from ZIH systems to your local system and expand the font path
```bash ```console
localhost$ scp -r taurus.hrsk.tu-dresden.de:/sw/global/applications/mathematica/10.0/SystemFiles/Fonts/Type1/ ~/.fonts marie@local$ scp -r taurus.hrsk.tu-dresden.de:/sw/global/applications/mathematica/10.0/SystemFiles/Fonts/Type1/ ~/.fonts
localhost$ xset fp+ ~/.fonts/Type1 marie@local$ xset fp+ ~/.fonts/Type1
``` ```
#### Windows Workstation #### Windows Workstation
...@@ -93,29 +93,29 @@ interfaces with the Maple symbolic engine, allowing it to be part of a full comp ...@@ -93,29 +93,29 @@ interfaces with the Maple symbolic engine, allowing it to be part of a full comp
Running MATLAB via the batch system could look like this (for 456 MB RAM per core and 12 cores Running MATLAB via the batch system could look like this (for 456 MB RAM per core and 12 cores
reserved). Please adapt this to your needs! reserved). Please adapt this to your needs!
```bash ```console
zih$ module load MATLAB marie@login$ module load MATLAB
zih$ srun -t 8:00 -c 12 --mem-per-cpu=456 --pty --x11=first bash marie@login$ srun --time=8:00 --cpus-per-task=12 --mem-per-cpu=456 --pty --x11=first bash
zih$ matlab marie@compute$ matlab
``` ```
With following command you can see a list of installed software - also With following command you can see a list of installed software - also
the different versions of matlab. the different versions of matlab.
```bash ```console
zih$ module avail marie@login$ module avail
``` ```
Please choose one of these, then load the chosen software with the command: Please choose one of these, then load the chosen software with the command:
```bash ```bash
zih$ module load MATLAB/version marie@login$ module load MATLAB/<version>
``` ```
Or use: Or use:
```bash ```console
zih$ module load MATLAB marie@login$ module load MATLAB
``` ```
(then you will get the most recent Matlab version. (then you will get the most recent Matlab version.
...@@ -126,8 +126,8 @@ zih$ module load MATLAB ...@@ -126,8 +126,8 @@ zih$ module load MATLAB
If X-server is running and you logged in at ZIH systems, you should allocate a CPU for your work If X-server is running and you logged in at ZIH systems, you should allocate a CPU for your work
with command with command
```bash ```console
zih$ srun --pty --x11=first bash marie@login$ srun --pty --x11=first bash
``` ```
- now you can call "matlab" (you have 8h time to work with the matlab-GUI) - now you can call "matlab" (you have 8h time to work with the matlab-GUI)
...@@ -138,8 +138,9 @@ Using Scripts ...@@ -138,8 +138,9 @@ Using Scripts
You have to start matlab-calculation as a Batch-Job via command You have to start matlab-calculation as a Batch-Job via command
```bash ```console
srun --pty matlab -nodisplay -r basename_of_your_matlab_script #NOTE: you must omit the file extension ".m" here, because -r expects a matlab command or function call, not a file-name. marie@login$ srun --pty matlab -nodisplay -r basename_of_your_matlab_script
# NOTE: you must omit the file extension ".m" here, because -r expects a matlab command or function call, not a file-name.
``` ```
!!! info "License occupying" !!! info "License occupying"
...@@ -160,7 +161,7 @@ You can find detailed documentation on the Matlab compiler at ...@@ -160,7 +161,7 @@ You can find detailed documentation on the Matlab compiler at
Compile your `.m` script into a binary: Compile your `.m` script into a binary:
```bash ```bash
mcc -m name_of_your_matlab_script.m -o compiled_executable -R -nodisplay -R -nosplash marie@login$ mcc -m name_of_your_matlab_script.m -o compiled_executable -R -nodisplay -R -nosplash
``` ```
This will also generate a wrapper script called `run_compiled_executable.sh` which sets the required This will also generate a wrapper script called `run_compiled_executable.sh` which sets the required
...@@ -172,41 +173,35 @@ Then run the binary via the wrapper script in a job (just a simple example, you ...@@ -172,41 +173,35 @@ Then run the binary via the wrapper script in a job (just a simple example, you
[sbatch script](../jobs_and_resources/slurm.md#job-submission) for that) [sbatch script](../jobs_and_resources/slurm.md#job-submission) for that)
```bash ```bash
zih$ srun ./run_compiled_executable.sh $EBROOTMATLAB marie@login$ srun ./run_compiled_executable.sh $EBROOTMATLAB
``` ```
### Parallel MATLAB ### Parallel MATLAB
#### With 'local' Configuration #### With 'local' Configuration
- If you want to run your code in parallel, please request as many - If you want to run your code in parallel, please request as many cores as you need!
cores as you need! - Start a batch job with the number `N` of processes, e.g., `srun --cpus-per-task=4 --pty
- start a batch job with the number N of processes --x11=first bash -l`
- example for N= 4: `srun -c 4 --pty --x11=first bash` - Run Matlab with the GUI or the CLI or with a script
- run Matlab with the GUI or the CLI or with a script - Inside Matlab use `matlabpool open 4` to start parallel processing
- inside use `matlabpool open 4` to start parallel
processing
- example for 1000*1000 matrix multiplication !!! example "Example for 1000*1000 matrix-matrix multiplication"
!!! example
```bash ```bash
R = distributed.rand(1000); R = distributed.rand(1000);
D = R * R D = R * R
``` ```
- to close parallel task: - Close parallel task using `matlabpool close`
`matlabpool close`
#### With parfor #### With parfor
- start a batch job with the number N of processes (e.g. N=12) - Start a batch job with the number `N` of processes (,e.g., `N=12`)
- inside use `matlabpool open N` or - Inside use `matlabpool open N` or `matlabpool(N)` to start parallel processing. It will use
`matlabpool(N)` to start parallel processing. It will use
the 'local' configuration by default. the 'local' configuration by default.
- Use `parfor` for a parallel loop, where the **independent** loop - Use `parfor` for a parallel loop, where the **independent** loop iterations are processed by `N`
iterations are processed by N threads threads
!!! example !!! example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment