$seoHelper.renderFullSimple($sitemeshPage,"{2} - {3}")
Page tree
Skip to end of metadata
Go to start of metadata

Table of Contents

Overview

These are handy one line commands that can be used on most Linux systems.  Areas covered include monitoring and controlling user processes, transferring files, executing commands on multiple machines simultaneously, etc.

Torque/PBS

Alter the Resource Parameter of a Job BEFORE it Starts

We only asked for 80 hours of walltime but need 100.  Let's change that:

qalter -l walltime=100:00:00 <jobid>

How about multiple parameters?:

qalter -l nodes=01:ppn=4,mem=40g,walltime=100:00:00 <jobid>

Making these changes can and likely will, effect your job priority.

Process Monitoring

How many cores do I have?

cat /proc/cpuinfo

A nice visual process monitor:

htop

How much memory is available?

free -g

Inspect active process threading:

ps -eLf

Get the command associated with a process:

cat /proc/<pid>/cmdline

Find out command details, resource utilization and threading by user:

top -c -H -u someUsers

Check swap usage by process, sorted in descending order:

for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less

Run Parallel Commands on Multiple Hosts

Perform an "rsync" to all compute nodes:

pdsh -R ssh -w "compute-0-[0-15]" "rsync -av /mnt/projects/db/uniref100_release_2014_04 /state/partition1/db/ --progress"

The above will sync the  file "uniref100_release_2014_04" to a series of hosts named "compute-0-0" thru "compute-0-15".  Note, in this case, it would be useful to have SSH keys setup so you aren't prompted for passwords on every host.

How about a listing of a common directory on every host:

pdsh -R ssh -w "compute-0-[0-15]" "ls -l /state/partition1/db/"

Secure Transfers Using Ports Other than "22"

Performing an rsync to a machine using a different SSH port than "22" (in this example we use "58122"):

rsync -av -e "ssh -p 58122" somefile user@someserver.com:/somedir/

Now using SCP:

scp -P 58122 somefile user@someserver.com:/somedir/