- FIX TERMINAL WHEN SSH-ing THROUGH ROHAN:
- edit .bashrc to have export TERM=xterm-256color
 
- edit .bashrc to have 
- Test cluster:
- Bucephalus - 6 cores
- node1 - 4 cores
 
- NAS benchmarks
- MPI - Message Passing Interface
- NFS - Network Filesystem
- NIS - Account Credentials
- 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`
- PBS/torque
- $ qsub {batch file} # runs job
- $ qstat # see stats of processes running
 - run qsub on batch file to run it
 
- SLURM
- Batch Files: batch.progname- shell file with special #PBSdirectivw
 
- shell file with special 
###PBS
$ -N {name}  -> names process
$ -q batch   -> submits to batch queue
$ cat prog.o{proc num}  ->  cat two.o71     #Get batch process output
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 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)
 
- 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)
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)):
- Point-to-point send() and recv()
##June 14
- --nooversubscribein- mpirunto 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