Skip to content
ARCHIE-WeSt Logo
ARCHIE-WeSt
  • Information
    • ARCHIE Fees
    • ARCHIE-West Specification
    • Contact
  • For Academia
    • Acknowledging ARCHIE
    • Apply
      • ARCHIE-WeSt AI Showcase
      • Evaluation Project
      • MD Training
      • New Project Application
      • Project Extension
      • Undergraduate Student Access
      • Scaling Test Request
    • Research Publications
      • Glasgow Caledonian University
      • University of Glasgow
      • University of Stirling
      • University of Strathclyde
      • University of the West of Scotland
    • Terms and Conditions for Academic Users
  • For Industry
    • ARCHIE-WeSt for Industry Users
    • Apply
      • Evaluation Project
      • New Project Application
    • Knowledge Exchange
    • Terms and Conditions for Industrial Users
  • Projects
    • Astrophysics
      • Understanding the Dynamic Magnetic Field in the Solar Atmosphere
    • Bioinformatics
      • Acoustic Receivers: From Insect Ear to Next-Generation Sensor
      • Bioinformatics of Evolution, Microbiome Communities and Transcriptome Assembly
      • Coevolution of Host-Phages System
      • The genetic epidemiology of liver disease
    • Computational Chemistry
      • Biological Minimalism
      • Computationally Guided Ir(I) Catalyst Design for Hydrogen Isotope Exchange Reactions of Amino Acid and Peptide Molecules
      • Developing physics-based methods for predicting physico-chemical properties required in pharmaceutical drug discovery and manufacturing
      • Iridium-catalysed C-6 hydrogen isotope exchange of pyridines
      • Main Group Metal-Metal Bonds
      • Mechanistic Studies of Transition-Metal Mediated Catalysis
      • Mechanistic Studies on the Pauson-Khand Reaction
      • New Iridium-catalysed Methods for the Direct Preparation of Isotopically-labelled Compounds of Pharmaceutical Importance
      • Production of biofuels and bio-chemicals from solid waste
      • Reducing Molecular Search Spaces
      • Structure and Dynamics of Polystyrene Films Between Gold Surfaces: Effect of Tacticity
      • Studies of PVDF on surfaces
    • Computational Fluid Dynamics
      • An Investigation on Drag Reduction Capabilities of Dimpled Surfaces
      • Combustion Sub-Model Development Using High-Fidelity DNS Data
      • Complex Multi-Phase Fluid Dynamics Study in Micro-Scale Systems
      • Helicopter Multi-Block Code
      • High Resolution Compressible CFD simulations
      • High Speed Flow Chemistry Modelling
      • Meta-Modelling Approaches for Expensive Models
      • Multi-Scale Modeling of Heart Post-MI
      • Scalability and Applications of a DSMC Code
      • Ultra-lean and low NOx Hydrogen Combustion
    • Computational Fluid Dynamics in Marine Engineering
      • A CFD study on the narrow gap phenomenon at wind turbine docking operation
      • CFD Modelling of Fouling and Biofouling Effect on Ship Hydrodynamic Performance
      • CFD Simulation for the Analysis of Ships Operating in Extreme Trim
      • CFD Simulations to Investigate the Effect of Retrofitting Technologies to Improve the Energy Efficiency of Bulk Carrier
      • Computational Marine Hydrodynamics
      • Control and / or Mitigation of the Turbulence Generated by Marine Control Surfaces
      • Crashworthiness Analysis of Ship Collisions and Groundings for Horizon 2020 FLARE Project WP3
      • Design of a Novel Riser System for Deep-water
      • Evaluating the Structural Flexibility Effect on Ocean Energy Structures: A Study on Floating Offshore Wind Turbines (FOWTs) and Wave Energy Converters (WECs)
      • Hydrodynamic Effect of Restricted Waters on Ships
      • Hydroacoustic Modelling of Underwater Noise
      • Hydrodynamics of High Performance Vessels Operating in Shallow Water
      • Hydrodynamic Properties of Complex Subsea Structures
      • Investigation of Fishing Vessel Operability for Various Loading Conditions
      • Path-Following Control Problem Using CFD
      • Re-Designing of Modern Propellers with Biomimetic Leading-Edge Profiles
      • The Effects of Fouling Control Coatings and Heterogeneous Hull Roughness on Ship Resistance
      • The application of Biomimetic Tubercles on a Ship Hull
      • Unsteady RANS CFD simulations of ship maneuverability in waves
    • Computational Fluid Dynamics in Mechanical Engineering
      • CFD Simulation of Surge Onset in Centrifugal Compressors
      • Characterization of solid-liquid mixing in a continuous oscillatory baffled crystallizer using CFD
      • The CFD Development of Non-premixed Dual Fuel Combustion Diesel Engine injected by High-pressure Gas in the Cylinder Chamber
      • Transient Analysis of Safety Valves Using Fluid Structure Interaction Techniques
      • Improving Heat Transfer Performance Through Advanced Simulation Methods
      • Valve leak tightness
    • Computing Science
      • CAD-CFD Seamless Integration
      • FAIME: A Feature based Framework to Automatically Integrate and Improve Metaheuristics via Examples
      • Intelligent Decision Support and Control Technologies for Continuous Manufacturing and Crystallisation of Pharmaceuticals and Fine Chemicals – ICT-CMAC
      • Object Detection
      • Towards an Adaptive SBSE Based Approaches for Cloud Elasticity
      • Understanding Problem Difficulty in Heuristic Search
    • Digital Rendering
      • The Battle of Bannockburn
    • Earth Science
      • Computational Thermochronology
      • Quantifying the Thermal Histories of Rocks Using the Helfrag Technique
    • Materials Science
      • Biocomposite Design for Food Packaging
      • Chitosan Films
      • Computational Solid Mechanics
      • Damage Prediction in Ships and Offshore Structures
      • Effect of carbon fibres on polymer network formation
      • Integrated Modelling and Simulation of Laser Metal Deposition (LMD) for Additive Manufacturing
      • Inverse Design in Metal Oxides
      • Investigation of Dynamic Behaviour of Structures with Heterogeneous Materials
      • MD Simulation Study on Nanometric Cutting of Single Crystal Silicon at Elevated Temperatures
      • Mechanical Analysis of Cancellous Bone Architecture
      • Micro-Fracture of Cementitious Material
      • Numerical Modelling of the Friction Stir Welding Process
      • Optimization of Manufacturing Processes Through Multi-Scale Physics-Based Models
      • The Spreading Dynamics of Water Droplet on Textured Surfaces
      • Theoretical Investigation of the Electronic and Optical properties of Solar Cells Mater
    • Molecular Simulation of Biological Systems
      • Beta-Amyloid Adsorption
      • Fast and Accurate Predictions of Physical-Chemical Properties of Drug-Like Molecules
      • Interaction of Proteins with Solid Surfaces
      • MD Trajectory Pocket Analysis
      • Molecular Modelling of Complex Aqueous Brine Solutions
      • Spontaneous Membrane-Translocating Peptide Adsorption
      • The Effect of an Oil/Water Interface on the Nucleation Kinetics and Polymorphism of Glycine
      • The Effect of Surface Chemistry on Protein Adsorption – an Experimental and Simulation Study
    • Molecular Simulation for Engineering Applications
      • Interfacial Properties of Room-Temperature Ionic Liquids: Electrical Double Layer, RTILs&Nanomaterials and Applications
      • Molecular Dynamics of Thermocapillary flows
      • Reverse Osmosis Membrane Design Using Molecular Dynamics
      • Temperature Effects on Thermal Conductivity and Viscosity of Aqueous Solutions
    • Photonics, Plasma and Quantum Physics
      • ALPHA-X : Plasma Wakefield Acceleration
      • Magnetic Field Topology
      • Many-body Dynamics in Quantum Simulators
      • New Twists in the Diffraction of Intense Laser Light
      • Novel Methods for Short Wavelength Free Electron Lasers
      • Photoacustic Imaging
      • Relativistic Plasma Physics: Laser-Driven Radiation Sources and Ultra-High Field Physics
      • Semi-classical Monte-Carlo Simulations of Sub-Doppler Cooling in 40K
      • Ultra-intense Laser-Solid Interactions: Ion Acceleration and High Field Physics
    • Renewable Energy
      • A fully Automated Optimisation of a Fully Parametric Vessel for Real World Conditions
      • Fluid-Structure Interaction Analysis of a Multi-Bladed Tidal Turbine
      • Improving WEC Power Performance through Wave Channel Optimisation Approaches
      • Numerical Simulation of a Cylindrical Oscillating Water Column Type Wave Energy Device
      • Robust Design of Wind Turbines
      • SgurrEnergy
      • Simulation and Experimental Study of Wave-Passing and Seakeeping for Seatrains
      • The Application of the Gate Rudder to Small High Speed Craft within the Wind Farm Industry
    • Transportation in the Air-Space
      • Design and trajectory optimisation for space access systems
      • Low-Order Modelling of Unsteady Aerofoil and Wing Flows
      • Modelling and Optimisation of Aircraft Operations
      • Optimisation Algorithm for Space Trajectory Problems
      • Optimisation of a Ship Wind Assisted Propulsion System
      • Reduced Basis Modelling for Aircraft Aerodynamics
      • Rocket Plumes
      • StarDust
      • Trajectory Optimisation for Single-Stage-to-Orbit Vehicles
      • Transient CFD of flow physics and flow control in convoluted ducts
  • Documentation
ARCHIE-WeSt Logo
ARCHIE-WeSt

Running Matlab

Running Matlab on ARCHIE-WeSt

.
This is a simple example of Matlab which should run on ARCHIE-WeSt and take 2 minutes. The input files and job script are downloadable below.
This example contains code and jobs scripts to execute 120,000 hands of blackjack in serial and in parallel.
.

1. Load the appropriate environment modules

.
To run MATLAB load the appropriate module:

module load apps/bin/matlab/R2017a
.

2. Running MATLAB in parallel

.
Built-in Multithreading
By default, MATLAB will attempt to use all available cores on the host computer on which it is run. Many internal routines are multi-threaded (e.g. linear algebra and fft routines) and will run automatically on multiple cores. Therefore, it may be the case that you can run your MATLAB program on ARCHIE and achieve some increased performance for no additional effort.

.
Parallelism Using MATLAB Workers

You can, however, run multiple MATLAB workers (MATLAB computational engines) explicitly to execute applications in parallel, with Parallel Computing Toolbox. This approach allows you more control over the parallelism than with built-in multithreading, and is often used for coarser grained problems such as running parameter sweeps in parallel.
For example, be replacing a for loop with a parfor loop in your code allows that block of code to be parallelised over the available workers. You can run on up to 12 workers on a standard ARCHIE node. This type of parallelism first requires a matlab paralell pool to be initialised. For more information, see: http://www.mathworks.co.uk/help/distcomp/index.html .

Forcing MATLAB to run in serial mode

If you plan to run MATLAB programs on the serial queue, you should ensure that you force MATLAB to run in single core mode. This is done by supplying the  -singleCompThread switch, e.g.

  • matlab -nodisplay -nodesktop -singleCompThread -r “blackjack;exit”

If the  -singleCompThread is not supplied, then each instance of MATLAB will run in muti-threaded mode resulting in the nodes becoming oversubscribed.

3. Prepare input files

.
The following files are required to be present in the working directory:

  • blackjack.m
  • parallel_blackjack.m
  • pctdemo_task_blackjack.m
  • job scripts start-matlab-serial.sh and  start-matlab-parallel.sh

These can be downloaded as a tar file from here.
The job script start-matlab-serial.sh will use a single core:

#!/bin/bash
# Simple serial job submission script
# Specifies that all environment variables active within the qsub
# utility be exported to the context of the job.
#$ -V
# Execute the job from the current working directory. Standard output and
# standard error files will be written to this directory
#$ -cwd
# Submit to the queue called serial-low.q
#$ -q serial-low.q
#Specify Project identifier
#$ -P training.prj
# Merges standard error stream with standard output
#$ -j y
# Specifies the name of the file containing the standard output
#$ -o out.$JOB_ID
# Add runtime indication
#$ -l h_rt=1:00:00
matlab -nodisplay -nodesktop -singleCompThread -r "blackjack;exit"

The job script (start-matlab-parallel.sh) will use up to 12 cores:

#!/bin/bash
# ************* SGE qsub options ****************
#Export env variables and keep current working directory
#$ -V -cwd
#Select parallel environment and number of parallel queue slots (nodes)
#$ -pe mpi-verbose 1
#$ -q parallel-low.q
#$ -P training.prj
#Combine STDOUT/STDERR
#$ -j y
#Specify output file
#$ -o out.$JOB_ID
#Request resource reservation (reserve slots on each scheduler run until enough have been gathered to run the job
#$ -R y
#Indicate runtime
#$ -l h_rt=02:00:00
# ************** END SGE qsub options ************
matlab -nodisplay -nodesktop -r "parallel_blackjack;exit"
.

4. Job submission

.
To submit the job, type:

qsub start-matlab-serial.sh
.

or

qsub start-matlab-parallel.sh
.

As a result, the following files will be produced (output files):

  • out.$jobID$

The output files can be downloaded as a tar file from here  for comparison.

 

Apply Now

Apply for free evaluation accounts:
academic user / industry user
Submit new project requests:
Academic / Industry

Latest Videos

CFD of a Energy Harvesting Passive Flexible Foil

RSS Recent Publications

  • The effect of flow stratification on ship performance: a numerical study November 3, 2023
  • Multiple inlet sudden expansion flow of power-law fluids October 31, 2023
  • A hierarchy of ligands controls formation and reaction of aryl radicals in Pd-catalyzed ground state base-promoted coupling reactions September 27, 2023
  • The resistance of a trans-critically accelerating ship in shallow water September 13, 2023
  • Investigation of vibrational changes due to adsorption of glycine on gold September 1, 2023
  • Shallow waters resistance of an accelerating ship September 1, 2023
  • The dynamic response of floating offshore wind turbine platform in wave-current condition August 9, 2023
  • Filler-induced heterogeneous nucleation of polymer crystals investigated by molecular dynamics simulations July 18, 2023
  • Augmentation of FTIR spectral datasets using Wasserstein generative adversarial networks for cancer liquid biopsies July 6, 2023
  • Microfluidic manufacture of peptide nanofibers for targeting glioblastoma multiforme June 19, 2023
©2023 ARCHIE-WeSt | WordPress Theme by SuperbThemes