Use the High-Performance Computing Cluster (HPCC)

Body

Use this request form to obtain access to HPCC resources.
 

Install Secure Shell Access Software

  1. Download the PuTTY SSH Client.
  2. Download the Graphical Environment for Xming and Xming fonts.
  3. Download WinSCP for secure file transfers between desktop and cluster.

Log in Using SSH - PuTTY

  1. Open PuTTY Configuration.
  2. Enter the Host Name (or IP address).
  3. Enter the Port number.
  4. Select the SSH option under the connection type.
  5. Select Only on Clean Exit under Close window on exit.
  6. Click Open.

Log in Using SSH Graphics Mode (PuTTY with X11 Forwarding)

  1. Open PuTTY Configuration.
  2. Click Enable X11 forwarding.
  3. Select MIT-Magic-Cookie-1.

Transfer Files Using WinSCP

  1. Open WinSCP.
  2. Drag and drop files between the two available panes.

Find and Use Applications Using the Command Line

  1. Use which <command> to find which command must be in the path.
  • NOTE: Certain items are bolded for your convenience; they do not need to be bolded when executing code.
  1. Use echo $PATH to display the command path.
  2. Use locate somefile to locate a file directory or application.
  3. Use whereis<command> to locate a command.
  4. Use file <somefile> to find the type of file.
  5. Use info <somefile> to get information about a file.
  6. Use module available to find available modules.
  7. Use module load <modulename> to load execution environment.
  8. Use module list to list loaded modules.
  9. Use module unload <modulename> to unload module.

Find and Use Applications with the Scheduler

In order for jobs to be handled effectively and efficiently, the cluster uses the Sun Grid Engine (SGE) Scheduler. This manager queues jobs, assigns compute nodes for execution, and executes jobs in an orderly manner so that all users get fair usage of cluster resources. SGE is user-managed from the Linux command line. Three queues are available: all.qmatlab.q, and vsmp.q.

  • NOTE: All jobs must be submitted using the scheduler!
  1. Use qsub somescript to submit a job.
  • NOTE: The job will run when resources are available.
  1. Use qrsh to run an interactive job.
  2. Use qstat –f to display scheduled jobs.
  3. Use qdel jobid to delete your job from the queue.
  4. Use qacct –j jobid to view a detailed display of job.
  5. Use qconf –sql to show available queues.
  6. Use qconf –spl to show available parallel environments.
  7. Use qsub myscript  to run the job.
  8. Use qstat –f  to check the submission.
  9. Use ls –lat testjob.o* to check the results. 
  • NOTE: The last file run will be at the top of the list.
  1. Use less testjob.oXXXXXX to list the contents of the file.
  2. Use qacct –j XXXXXX | less to check run specifics
  • NOTE: For performance, pay attention to ru_utime (the user instruction execution time) and ru_stime (the OS process execution time).

Use SGE Submission Script – myscript for mpi jobs

Enter the following code:

#!/bin/bash

#$ -N testjob

#$ -M [user email]

#$ -o /work/[username]/testjob.$$.out

#$ -e /work/[username]/testjob.$$.err

#$ -S /bin/bash

#$ -V

#$ -q all.q

#$ -cwd

#$ -pe orte 5

module load openmpi

mpirun -np 5 --mca btl openib,self,sm  --mca btl_tcp_if_exclude lo,eth1,eth0 ./hello1

  • NOTE: The bolded command is used for MPI jobs.
  • NOTE: Anything in brackets is meant to be replaced.

Build the “hello_mpi” MPI Application

Enter the following code:

/* hello.mpi.c */

#include <stdio.h>

#include <mpi.h>

int main (int argc, char *argv[]) {

 int myrank, size;

 MPI_Init(&argc, &argv);

 MPI_Comm_rank(MPI_COMM_WORLD, &myrank);

 MPI_Comm_size(MPI_COMM_WORLD, &size);

 printf("Processor %d of %d: Hello World!\n", myrank, size);

 MPI_Finalize();

}

Compile the Source Code for “hello.mpi.c”

  1. Use module list to check if the mpi module is loaded.
  2. Use mpicc –o hello1 hello.mpi.c to see the compilation.
  3. Use ls –l hello1 to check that the file was built and is executable.
  4. Build SGE submission script and add hello1 to the mpirun line.

Use SGE Submission Script – myscript for MPI Job Submission Script

Enter the following code:

#!/bin/bash

#$ -N testjob

#$ -M [username]

#$ -o testjob.$$.out

#$ -e testjob.$$.err

#$ -S /bin/bash

#$ -V

#$ -q all.q

#$ -cwd                  

#$ -pe orte 5

module load openmpi

mpirun -np 5 --mca btl openib,self,sm  --mca btl_tcp_if_exclude lo,eth1,eth0 ./hello1

  • NOTE: mpirun is the run command for MPI jobs
  1. Use qsub myscript to submit myscript for execution.
  2. Use qstat –f to check submission.
  3. Use less testjob.XXXXXX.out to examine the output files for results.
  4. Use less testjob.XXXXXX.err to examine the error files for errors.

Building the “hello_smp” vSMP Application

Enter the following code:

 /* hello.smp.c */

#include <omp.h>

#include <stdio.h>

#include <stdlib.h>

int main (int argc, char *argv[])

{

int nthreads, tid;

/* Fork a team of threads giving them their own copies of variables */

#pragma omp parallel private(nthreads, tid)

  {

  /* Obtain thread number */

  tid = omp_get_thread_num();

  printf("Hello World from thread = %d\n", tid);

  /* Only master thread does this */

  if (tid == 0)

    {

    nthreads = omp_get_num_threads();

    printf("Number of threads = %d\n", nthreads);

    }

  }  /* All threads join master thread and disband */

}

Compile MPI Source Code – hello.smp.c

  1. Use gcc -fopenmp hello.smp.c -o hello_smp to compile source into executable.
  2. Use ls –l hello_smp to check if executable was built.
  3. Use ./hello_smp to run executable.

Use SGE Submission Script – myscript2 (vSMP Job Submission Script)

Enter the following code:

#!/bin/bash

#$ -N testjob

#$ -M [user email]

#$ -o testjob.$$.out

#$ -e testjob.$$.err

#$ -S /bin/bash

#$ -V                              

#$ -q vsmp.q

#$ -cwd                  

#$ -pe smp   5                                            

module load openmpi

export OMP_NUM_THREADS=5; ./hello_smp

  • NOTE: Use the vsmp queue for vsmp jobs.
  • NOTE: Use export OMP_NUM_THREADS to run command for vSMP job.

  • NOTE: Change the number in OMP_NUM_THREADS=5 select number of processes.

Use qsub myscript2 – To submit myscript for execution

  1. Use qstat –f to check submission.
  2. Use less testjob.XXXXX.out to examine output files for results.
  3. Use less testjob.XXXXX.err to examine effort files for errors.

Use SGE Submission Script – myscript3 (Mathlab Job Submission)

Enter the following code:

## myscript3 submission script ##

#!/bin/bash

#$ -N testjob

##$ -M [user email]

#$ -m beas

#$ -S /bin/bash

#$ -V

#$ -q matlab.q

#$ -cwd

#$ -pe matlab 12

echo $SGE_STDERR_PATH

echo $SGE_O_MAIL

matlab -nodisplay -nosplash -nodesktop -r mytest

## End myscript ##

  1. Use qsub myscript3 to submit myscript for execution.
  2. Use qstat –f to check submission.
  3. Use less testjob.XXXXX.out to examine output files for results.
  4. Use less testjob.XXXXX.err to examine effort files for errors.

Use Mathlab mytest.m File

Enter the following code:

% mytest.m file %

parpool(4)                

tic;

n = 1000000;

dx = 0.25;

        parfor i = 1 : n

          x(i) = (i-1) * dx;

          disp(num2str(x(i)));

        end

wtime=toc;

fprintf(1, 'Main Comp:\n');

fprintf(1, 'Wall clock time = %f seconds.\n',wtime);

delete(gcp) % release pool

% End mytest.m %

  • NOTE: Change bolded number to select number of workers: max of 12.

Use SGE Submission Script for myscript3

  1. Use qsub myscript3 to submit myscript for submission.
  2. Use qstat –f to check your submission.
  3. Use less testjob.oXXXXX to check for results.
  4. Use less testjob.eXXXXX to check for errors.

Use MatLab m-file mytest.m

Enter the following code:

% mytest.m file %

parpool(6)  

tic;

n = 1000000;

dx = 0.25;

        parfor i = 1 : n

          x(i) = (i-1) * dx;

          disp(num2str(x(i)));

        end

wtime=toc;

fprintf(1, 'Main Comp:\n');

fprintf(1, 'Wall clock time = %f seconds.\n',wtime);

delete(gcp) % release pool

% End mytest.m %

Customize the User Environment

Users can customize their user environment with aliases and other settings.   

  1. Use alias rec=‘ls –alt | less’ to display the latest modified file at the top of the directory listing.
  2. Use alias vf=‘cd’ for no more mistyping of the change directory command.
  3. Use alias cpu=‘grep -i --color "model name" /proc/cpuinfo’ to check the CPU’s.
  4. Use alias loacte=‘locate‘ to locate files, directories, etc.
  5. Use alias moda='module avail‘ to list available modules.
  6. Use alias ml='module load‘ to load a module.
  7. Use alias list='module list' to list loaded modules.
  8. Use alias mu='module unload‘ to unload modules.

Details

Details

Article ID: 75984
Created
Fri 4/12/19 11:00 AM
Modified
Mon 7/22/24 11:16 AM

Related Services / Offerings

Related Services / Offerings (2)

The Office of Faculty and Research Support (OFRS) offers technology consulting services for research projects.
Use this form to request new or additional services from Research IT.