<<

module add openmpi/gcc/64/1.6.5 qdel Delete batch job with given job ID. Using the Queuing System example: qdel 673615 qsub Submit job to queuing system. Useful Commands example: qsub submission-script / Basics BlueCrystal 3 Reference Card List directory contents. Advanced Computer Research Centre where the following submission script contains the examples: https://www.bris.ac.uk/acrc minimal information required to submit ls -ltr Long listing, recently modified last. hpc-@bristol.ac.uk ls -h File sizes in readable format e.g. 1K, 234M. a serial program to the veryshort queue Logging In (wallclock limit 2hrs): Print working directory. ssh Secure . #!/bin/bash Change current directory. options include: a #PBS -l nodes=1:ppn=1,walltime=02:00:00 examples: -X Enables X11 forwarding. cd .. Change to directory above. example: cd $PBS_O_WORKDIR cd /path/to/dir Change to directory given in path. ssh user@bluecrystalp3 ./my-serial-program multi-threaded program: files and directories. Transferring Files examples: or an cp file1 file2 create a copy of file1 called file2. #!/bin/bash scp Secure copy. MPI cp -r dir1 dir2 recursively copy dir1. options include: #PBS -l nodes=1:ppn=4,walltime=02:00:00 -r Recursively copy entire directories. cd $PBS_O_WORKDIR (rename) files and directories. examples: ./my-multi-threaded-program examples: scp local..gz user @bluecrystalp3:~ (distributed memory parallel) program: mv file1 file2 Rename file1 as file2. scp -r user @bluecrystalp3:/remote/path . mv dir1 /new/path Move dir1 to a new location. winscp scp/sftp GUI for windows. #!/bin/bash Remove files or directories. #PBS -l nodes=2:ppn=4,walltime=02:00:00 examples: cd $PBS_O_WORKDIR Checking Your Quota rm -i file1 Prompt before deleting file1. $PBS_NODEFILE > machine.file.$PBS_JOBID rm -rf dir1 Recursively & forcefully remove dir1. BCp3: pan_quota numnodes=` $PBS_NODEFILE | '{print $1}'` mpirun -np $numnodes -machinefile \ directories. Configuring Your Environment machine.file.$PBS_JOBID./my-mpi-program Remove empty directories. Ensure that you have the appropriate module add module Interface to modules package. commands in your shell start-up file (e.g. ~/.bashrc). Make links between files and directories. options include: examples: avail List all available modulefiles. qstat Show status of batch jobs. ln -s /path/to/dir1 ./dir1 Symbolically to dir1. add Load modulefile into shell environment. options include: Remove modulefile from shell environment. -u user Show only user's jobs. list List loaded modulefiles. -n List nodes allocated to a job. whatis Display the modulefile information. showq Show status of batch jobs—alternative format. example: Viewing & Manipulating Text Files gedit Text editor. example: Output the first part of files. emacs Text editor. -sh . Summarize (in readable format) total example: usage of file- rooted in current dir. head -7 file.txt View first 7 lines of file.txt. Redirection and Pipelines > Redirect stdout. Report disk space usage. Output the last part of files. example: example: example: cat file1 file2 > file1-and-2 df -h . Report usage (including available space) for tail -7 file.txt View last 7 lines of file.txt. file system holding current dir. < Redirect stdin. cat Concatenate files and print to stdout. Searching For Things example: >> Redirect stdout and append. Print lines matching a pattern. cat file1.txt file2.txt Append file2.txt to file1.txt. example examples: cat file1-and-2 file3 >> file-1-and-2-and-3 grep -n 'foo' file.txt Print all lines (prefixing the wc file.txt Print line, word and byte counts. line number) containing 'foo' in file.txt. file1.txt file2.txt Compare files, line by line. | Pipe stdout from one cmd to stdin of another. grep -i 'foo' * Print all lines containing 'foo' (case example: insensitive) from all files in current dir. Print selected parts from each line of files. head -7 file1 | tail -1 view 7th line of file1 example: Search for files in a directory hierarchy. cut -d',' -f1,2 file.csv Print first two columns of file.csv. Viewing Other Files files in octal and other (e.g. binary) a command. Merge lines of files. formats. example: example: List symbols from object (& ) files. which gcc Report location of gcc compiler. paste file1.txt file2.txt Concatenate each line of file1.txt example: and file2.txt, in turn, and print. nm mylib.a | view symbols in mylib.a, one Print effective userid. page a . man An interface on on-line reference manuals. Sort lines of files. Read Info documents. examples: ldd Report shared library dependencies. ? Wildcard: matches a single character. sort -d file1.txt Print contents of file1.txt in dictionary example: * Wildcard: matches any sequence of characters. order. ldd myprog.exe View myprog.exe's dependencies. sort -nr file1.txt Print contents in reversed (descending) numerical order. Compressing and Combining File Properties tar Archiving utility. file Determine file . Report or omit repeated lines. example: example: tar -xzf archive.tar.gz Unpack compressed archive. Change file timestamps. uniq file1.txt Print only unique lines of file1.txt. example: gzip Compress files. touch file1 Updates access and modification times Stream editor for filtering and transforming. example: of file1 to the present time. examples: gzip file.txt Compress file.txt. sed 's/cat/bat/g' file1.txt replace all instances of 'cat' in gunzip files. file1.txt with 'bat'. Change file mode bits (change permissions) sed 's/*//g' file1.txt replace all words in file1.txt ending example: Management with 'ed' with the empty string. chmod a+r file.txt Allow all to read file.txt. Display Linux tasks. Send a signal to a process. awk Pattern scanning and processing language. Change file owner and group. fg Place a job in the foreground. example: Compute/check MD5 message digest. bg Place a job in the background. awk '{print $2}' file1.txt Print second column of file1.txt. du Estimate file space usage.