miércoles, 22 de septiembre de 2010

Turn Vim into a bash IDE

http://www.linux.com/archive/articles/114359

Turn Vim into a bash IDE
By Joe 'Zonker' Brockmeier on June 11, 2007 (9:01:00 PM)

By itself, Vim is one of the best editors for shell scripting. With a little tweaking, however, you can turn Vim into a full-fledged IDE for writing scripts. You could do it yourself, or you can just install Fritz Mehner's Bash Support plugin.



viernes, 4 de junio de 2010

How To Set Environment Variables in PBS Batch Scripts?

In order to use certain software packages on the Shared Computing Clusters, it is necessary to set one or more environment variables. This is accomplished automatically with the module command. It is often necessary, however, for these environment variables to be visible from within a PBS batch script, yet the module command does not work from within a batch script on a compute node. The following document describes the preferred way of setting environment variables inside a PBS batch script:
Inheriting Environment Variables
The preferred way of setting environment variables in a PBS batch script is to simply have the script inherit the environment of the parent shell from the login node. For example, you might execute the following command on a login node: module load mpich. This will set the necessary environment variables to use the mpich package. In order for these variables to be inherited in the PBS batch script that will execute on a compute node, include the #PBS -V option in the batch script as follows:
#!/bin/bash
#PBS -N Test
#PBS -l nodes=2:ppn=1
#PBS -S /bin/bash
<u><strong>#PBS -V</strong></u>
#PBS -m abe
#PBS -o /home/username/workingdir
#PBS -e /home/username/workingdir
echo "I ran on:"
cat $PBS_NODEFILE
mpiexec ./myjob.exe
When the job is submitted it will inherit all environment variables that were set in the parent shell on the login node, not just those set by the module command . Care should be taken to make sure that there are no other environment variables in the parent shell that could cause problems in the batch script.

jueves, 3 de junio de 2010

Script to launch MOLCAS in a MVAPICH/Torque/Maui env.

***********************************************************
#!/bin/bash

#PBS -l nodes=1:ppn=8
#PBS -l walltime=00:10:00
#PBS -q batch
#PBS -j oe
#PBS -o err.out

echo execution host: $PBS_O_HOST
echo Your user ID where you ran qsub ID: $PBS_O_LOGNAME
echo Your home directory where you ran qsub HOME: $PBS_O_HOME
echo The working directory where you ran qsub: $PBS_O_WORKDIR
echo The original queue you submitted to: $PBS_O_QUEUE
echo The queue the job is executing from: $PBS_QUEUE
echo The jobs PBS identifier: $PBS_JOBID
echo The jobs name: $PBS_JOBNAME
echo The contents of nodefile is:
cat $PBS_NODEFILE
NP=`(wc -l < $PBS_NODEFILE) | awk '{print $1}'`
echo numero de procesadores para ejecutar la tarea
echo $NP
export Project=CH4
export MOLCAS=/data1/aldo/Source-Code/molcas/molcas74
echo ' ---------------------------------------'
echo ' Job:' $Project
echo ' ' `cat $MOLCAS/.molcashome`
echo ' MolCASMem=' $MOLCASMEM
echo ' Date:' `date`
echo ' ---------------------------------------'
export MOLCAS_PROJECT=CH4
echo "Molcas MOLCAS_PROJECT = " $Project export MOLCAS_WORKDIR=$PBS_O_WORKDIR/tmp_$Project
echo "Molcas MOLCAS_WORKDIR = " $MOLCAS_WORKDIR
# Number of processors the job is going to run on
NP=`(wc -l < $PBS_NODEFILE) | awk '{print $1}'`
export CPUS=$NP
cd $PBS_O_WORKDIR $MOLCAS/sbin/molcas.driver $Project.input
echo ' ---------------------------------------'
echo ' Job done: ' $Project
echo ' Date: ' `date`
echo ' ---------------------------------------' ************************************************************

Improved script to launch MOLCAS in a MVAPICH/NoPBS env.

#!/bin/bash
export Project=project_name
export MOLCAS=/data1/aldo/Source-Code/molcas/molcas74

#An example for using /scratch area as a parent for WorkDir, keep(NO)/remove(YES)
#WorkDir before a calculation, and keep/remove it when calculation finished
#generated for the the name of the input file:
CurrDir=`pwd`
export MOLCAS_WORKDIR=$CurrDir/scr_$Project
export MOLCAS_NEW_WORKDIR=YES
export MOLCAS_KEEP_WORKDIR=YES
echo ' ---------------------------------------'
echo ' Job:' $Project
echo ' ' `cat $MOLCAS/.molcashome`
echo ' MolCASMem=' $MOLCASMEM
echo ' Date:' `date`
echo ' ---------------------------------------'
export PBS_NODEFILE=$CurrDir/nodelist
export CPUS=8
cd $CurrDir
$MOLCAS/sbin/molcas.driver $Project.input > $Project.out 2> $WorkDir/$Project.err
echo ' ---------------------------------------'
echo ' Job done: ' $Project
echo ' Date: ' `date`
echo ' ---------------------------------------'


miércoles, 2 de junio de 2010

MOLCAS script to launch MVAPICH/NoPBS job

This script will launch molcas on N cpus (depending on the variable $CPUS)  using the MVAPICH/parallel paradigm.
Used to test molcas installation in a totally occupied cluster!!

*************************************************************************
#!/bin/bash
MOLCAS=/data1/aldo/Source-Code/molcas/molcas74
export MOLCAS

#crates the temporary output files inside the working directory
MOLCAS_WORKDIR=
export MOLCAS_WORKDIR

#How many CPUS do you want for the calculation?
CPUS=2
export CPUS

# As I'm not using the PBS queue system at this time I've to write a file with
# the name of the hosts which will be used for the calculation (nodelist)
# and put it inside the working area, so molcas can find it !
PBS_NODEFILE=/data1/aldo/molcas/test-ch4/nodelist
export PBS_NODEFILE

#Execute the application by calling the driver script, here specifying the whole path
# because is not in a user wide available location...yet !

/data1/aldo/Source-Code/molcas/molcas74/sbin/molcas.driver molcas-input

# Ready to rock !!
***************************************************************

MOLCAS command line " molcas help basis XX"

** type  molcas help basis A  to list basis set for the element A
*********************************************************************
$> molcas help basis Pd
Recommended basis sets for  Pd
Pd.ANO-RCC-MB                            Pd.ANO-RCC...5s4p2d.                   
Pd.ANO-RCC-VDZ                           Pd.ANO-RCC...6s5p3d.                   
Pd.ANO-RCC-VDZP                          Pd.ANO-RCC...6s5p3d1f.                 
Pd.ANO-RCC-VTZP                          Pd.ANO-RCC...7s6p4d2f1g.               
Pd.ANO-RCC-VQZP                          Pd.ANO-RCC...8s7p5d3f2g1h.               

 Other basis sets for  Pd
Pd.ECP.HW.5s6p4d.3s3p2d.18e-LANL2DZ.
Pd.ANO-DK3.Tsuchiya.23s19p12d.4s3p2d.
Pd.ano-rcc.Roos.21s18p13d6f4g2h.10s9p9d6f4g2h.
Pd.ECP.Dolg.8s7p6d.6s5p3d.18e-MWB.                                                    
Pd.ECP.Barandiaran.11s8p7d.1s2p2d.16e-CG-AIMP.                                
Pd.ECP.Barandiaran.11s8p7d3f.1s2p2d1f.16e-CG-AIMP.                            
Pd.ECP.Barandiaran.11s8p7d.1s2p2d.16e-NR-AIMP.                                
Pd.ECP.Rakowitz.11s8p7d3f.5s4p4d1f.18e-NP-AIMP.                               
Pd.ECP.Stoll.8s7p6d.6s5p3d.18e-MWB.
Pd.Raf-r.Wahlgren.17s13p9d2f.7s6p4d2f.                                   
Pd.ECP.Hay-Wadt.5s6p4d.3s3p2d.18e-LANL2DZ.
*******************************************************************

MOLCAS command line " molcas help"

Useful Commands
******************************************************************
$> molcas help
Welcome to molcas help!

type  molcas help module  to get the list of keywords
type  molcas help module keyword  to get the description of keyword
type  molcas help -t text  to locate text
type  molcas help ENVIRONMENT  to list ENV variables
type  molcas help EMIL  to list EMIL commands
type  molcas help basis A  to list basis set for the element A

Installed modules:
ALASKA CASPT2 CASVB CCSDT CHCC CHECK CHT3 CIISCMNG CPF EMIL ESPF ESPF
EXPBAS FFPT GATEWAY GENANO GRID_IT GUESSORB GUGA LOCALISATION LOPROP M2SO
MBPT2 MCKINLEY MCLR MOTRA MRCI MULA NUMERICAL_GRADIENT PARALLELTEST RASSCF
RASSI SCF SEWARD SLAPAF VIBROT

Utilities:
edit verify installpkg help find copy install timing defdoc snooper revert
getpatch uninstallpkg checksum uninstall gv
*********************************************************************

lunes, 24 de mayo de 2010

Copy single file to multiple directories

Parent_Directoy
Filename1
Child_Directory1
Child_Directory2
Child_Directory3
Child_Directory4
....
So I need to copy Filename1 to all of the Child_Directories.

<!--ntstart--><b>find <parent directory> -type d -exec cp <parent directory>/<Filename1> {}/ \;</b><!--ntend-->

or in a bourne/shell script :
If you have other junk in the parent dir but a pattern that matches all subdirs (eg Child_Directory*), you can do this (bourne/ksh/bash):
<!--ntstart--><b>for subdir in <parent directory>/<pattern> ; do cp <parent directory>/<Filename1> ${subdir}/ ; done</b><!--ntend-->


viernes, 21 de mayo de 2010

Delete Multiple Jobs

* Delete jobs with qdel*

>qdel 1908.titan.physics.umass.edu

or do it with a qselect to pick all of your jobs

> qdel `qselect -u bbrau`

Changing Node State (Torque)

A common task is to prevent jobs from running on a particular node by marking it offline with pbsnodes -o nodename. Once a node has been marked offline, the scheduler will no longer consider it available for new jobs. Simply use pbsnodes -c nodename when the node is returned to service.

Also useful is pbsnodes -l which lists all nodes with an interesting state, such as down, unknown, or offline. This provides a quick glance at nodes that migth be having a problem.

http://www.clusterresources.com/torquedocs21/3.3nodestate.shtml



viernes, 20 de noviembre de 2009

Latex: Fancyhdr package error \headheight is too small

Latex: \headheight is too small

You never know what you will meet when you use Latex, luckily, we can search Google or Yahoo to find the answer. However, it cannot help all the times. There is a problem you may come across using package fancyhdr:

Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 14.49998pt.
We now make it that large for the rest of the document.

It was not easy to find the answer via either Google or Yahoo. Here is the solution. Insert

\setlength{\headheight}{15pt}

in the preamble, i.e. before \begin{document}.

Tips:

  • \headheight defines the height of the header.

  • \setlength{len-cmd}{length}
The \setlength command is used to set the value of a length command, len-cmd, which is specified as the first argument. The length argument can be expressed in any terms of length LaTeX understands, i.e., inches (in), millimeters (mm), points (pt), etc.

From: http://nw360.blogspot.com/2006/11/latex-headheight-is-too-small.html


Latex: Fancyhdr package error \headheight is too small

Latex: \headheight is too small

You never know what you will meet when you use Latex, luckily, we can search Google or Yahoo to find the answer. However, it cannot help all the times. There is a problem you may come across using package fancyhdr:

Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 14.49998pt.
We now make it that large for the rest of the document.

It was not easy to find the answer via either Google or Yahoo. Here is the solution. Insert

\setlength{\headheight}{15pt}

in the preamble, i.e. before \begin{document}.

Tips:

  • \headheight defines the height of the header.

  • \setlength{len-cmd}{length}
The \setlength command is used to set the value of a length command, len-cmd, which is specified as the first argument. The length argument can be expressed in any terms of length LaTeX understands, i.e., inches (in), millimeters (mm), points (pt), etc.

From: http://nw360.blogspot.com/2006/11/latex-headheight-is-too-small.html


viernes, 22 de mayo de 2009

cp command excluding files

This command copies the files in a given directory to a target-directory excluding a specific file name

cp `find ./Si-IHW-bks-300K/* -not -name HISTORY` NPT/IHW-bks-300K

For example, it copies all files coming from a dl_poly run to another directory excluding the HISTORY file

martes, 21 de abril de 2009

Latex to ODT conversion tips

Conversion of a .tex document to open document format (RTF)

latex2rtf file.tex

Conversion of a .tex document to open document format (ODT)

mk4ht oolatex file.tex

Some notes:

  1. disable hyperref package to prevent odd bug in citation listings
  2. input document should be latex-safe, i.e. eps figures
  3. need a working java installation
  4. commands like \onehalfspacing or begin{singlespace}...end{singlespace} may not work (setspace package)


viernes, 2 de enero de 2009

High Res VMD Rendering

tachyon_LINUX -res 2048 2048 -rescale_lights 0.4 -add_skylight 0.7 '/home/aldo/plot.dat' -o /home/aldo/plot.tga -aasamples 8

viernes, 28 de noviembre de 2008

Angstrom symbol XMGrace

How do I get the Angstrom symbol to show up in labels, titles, text?
ISO Latin encodings were added to the PostScript driver by Przemek Klosowski (przemek@rrdbartok.nist.gov).
You can now print the Angstrom symbol.
There is no onscreen display of the extended characters (something will show, but it won't be right).
3.02 will use the xvertext routines so that it will be a bit more WYSIWYG.
Use \c to go into the upper 128 characters and \C to return to normal.
\cE\C is the Angstrom symbol.

Angstrom Symbol in XMgrace

How do I get the Angstrom symbol to show up in labels, titles, text?

ISO Latin encodings were added to the PostScript driver by Przemek
Klosowski (przemek@rrdbartok.nist.gov).
You can now print the Angstrom
symbol. There is no onscreen display of the extended characters (something
will show, but it won't be right).
3.02 will use the xvertext routines
so that it will be a bit more WYSIWYG.
Use \c to go into the upper
128 characters and \C to return to normal.
\cE\C is the Angstrom symbol routines
so that it will be a bit more WYSIWYG.

lunes, 6 de octubre de 2008

GAUSSIAN 03 KeyWords

#P
Additional output is generated. This includes messages at the beginning and end of each link giving assorted machine-dependent information (including execution timing data), as well as covergence information in the SCF.

RHF
This method keyword requests a Hartree-Fock calculation. Unless explicitly specified, RHF is used for singlets and UHF for higher multiplicities. In the latter case, separate α and β orbitals will be computed [57,58,59]. RHF, ROHF or UHF can also be specified explicitly. SCF single point energy calculations involving basis sets which include diffuse functions should use the SCF=Tight keyword to request tight SCF convergence criteria.

MaxDisk
The MaxDisk keyword specifies the amount of disk storage available for scratch data, in 8-byte words. The value may optionally be followed by a units designation: KB, MB, GB, KW, MW or GB. Normally, this is set for a site in the site-wide Default.Route file.

MP2 calc. PickT4: no shell combinations can fit!

This ERROR typically indicates memory problems. Increase the amount of memory
requested with the %mem keyword.