Skip to content

Instantly share code, notes, and snippets.

@VaughnGH
Last active July 12, 2016 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VaughnGH/dab900d9d0b973e696df845352b28437 to your computer and use it in GitHub Desktop.
Save VaughnGH/dab900d9d0b973e696df845352b28437 to your computer and use it in GitHub Desktop.

NOTES

  • FIX TERMINAL WHEN SSH-ing THROUGH ROHAN:
    • edit .bashrc to have export TERM=xterm-256color
  • Test cluster:
    • Bucephalus - 6 cores
    • node1 - 4 cores
  • NAS benchmarks

Terms

  • MPI - Message Passing Interface
  • NFS - Network Filesystem
  • NIS - Account Credentials

MPI

  • Message Passing Interface
  • Parallel Programming wih MPI - Pacheo
  • Message Passing Interface Standard (V. 2.1)
  • Implementations:
    • OpenMPI
    • Mpich2
  • Book Online by Ian Foster
$ mpirun -np 3 ./program  # start program on 3 processes (0 indexed)
    + `-np {num processors}`
$ rsh node1               # go onto specific node
  or
$ rsh node1 "cat /proc/cpuinfo | grep processor"        # send commands to node without loggin in, in this case it shows the amount of processors

$ cat /proc/cpuinfo       # shows cpu info
$ df                      # shows filesystem info

can put machines available in a file named machines

  $ mpirun -np 4 --map-by node -hostfile ./machines ./hello   # run processes on 4 processors on select machine (in `machines`) and run `hello`

Batch Systems

  • PBS/torque
    • $ qsub {batch file} # runs job
    • pbsnodes # see resources available

    • $ qstat # see stats of processes running
    • run qsub on batch file to run it
  • SLURM
  • Batch Files: batch.progname
    • shell file with special #PBS directivw

###PBS

$ -N {name}  -> names process
$ -q batch   -> submits to batch queue

$ cat prog.o{proc num} -> cat two.o71 #Get batch process output

Fortran Subprogams

Functions y = f(x) Subroutines call fn(x)

##May 31

  • Xming - X11 Env for (windows?)
  • Enable X11 Forwaring [in putty] to allow x11 windows to be used over SSH

Fortran

  • Fortran arrays are 1-indexed
  • Fortran variable are global scope, and when passed in a function are directly mutated by all operations on such.
    • (Acts as if there were passed through as a pointer/reference in c)

Pass-by Conventions

  • C is "pass-by-value" // C mimics pass-by-reference with arrays to keep things effeceint and prevent massive memory duplication
    • value is transferred to function
  • F90 is "pass-by-referece"
    • address is transferred to function
  • C stores data by rows (in 2D matrices) y1 = a11*x1 + a12*x2 + ... + a1n*xn is faster in c
  • F90 stores data by columns (in 2D matrices)

C

In C, it mimic a pointer when passing an array as an argument, and thus an index can change in a function This is because, in C, arrays are treated as a wrapping of a multi-indexed pointer

###Fortran Code:

if (rank .eq. 0) then
  sum = subtotal ( root subtotal )
  do i=1,3
    MPI_Rrev(subtotal, i)  ( from i )
    sum = sum + subtotal
    print *, "The answer is _", sum
    sum(i) = sum(i) + sum(i+1)
else ....

Excercise: 3 ways to communicate integral(sin(x)):

  1. Point-to-point send() and recv()

##June 14

  • --nooversubscribe in mpirun to prevent multiple threads from being initialized if number of requested processes is greater than number of provided processors * cores
  • Lecture notes available here

##July 5

Find memory/processor info of a system/node:

cat /proc/meminfo | grep MemTotal
dmesg | grep interface
ifconfig -a

`hostname` automatically is converted to the server's hostname

/var/??/torque/mom_logs* contains logs, shows batch scheduling errors

##July 12 Find computer host name and specific os information: uname -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment