Unix reminder
Basis commands
pwd : Where I am ?
[intellimac4:~] aurelie% pwd /Users/aurelie
So I am in aurelie's directory.
ls : What are the file in this folder/directory ?
[intellimac4:~] aurelie% ls Movies Sites g03 Desktop Images Music Tutorial gaussian03 Documents Library Pictures Public work
So you can see all the folder that were in aurelie directory.
cd : Can not be use alone, need the name of a directory because this command indicate that you want to go to a directory
Go to Documents/ and display the files in the folder.
[intellimac4:~] aurelie% cd Documents/ [intellimac4:~/Documents] aurelie% ls AppleWorks User Data courbe_rc.jpeg Microsoft User Data
Now get out of Documents, for this use cd .. command
[intellimac4:~/Documents] aurelie% cd .. [intellimac4:~] aurelie%
You can notice that the last line indicate that you really have quit the Documents folder.
vi : Can not be use alone, need the name of a file, because this command indicate that you want to read the file Example
[intellimac4:~/g03] aurelie% vi aurelie_pyridine_iefpcm_water.log
and it will open the file in the window of the Terminal.
Be careful
You have to use cd to go to a directory and vi to open a file, if you do not do this you will get some error message.
less is an other way to open a file, with this way you can push on space to take down of one window and push B to go up.
But if you can just open a file or a folder you will be very quickly bored... So learn to create a folder first. For creating a folder you have to use the command mkdir. Let's try to create phony. And have a look at your folder in your directory.
[intellimac4:~] aurelie% mkdir phony [intellimac4:~] aurelie% ls Movies Sites g03 Desktop Images Music Tutorial gaussian03 Documents Library Pictures Public work phony
mkdir : create a folder
rm : remove a file rm -r : remove a folder and all the file inside
mv : move a file in an other folder. Example: I created an other folder phonybis in Documents, and I have a file test.com in the folder phony. To move this file from phony to phonybis :
[intellimac4:~] aurelie% mv phony/test.com phonybis/
Now verify that the file is in phonybis :
[intellimac4:~] aurelie% cd phonybis/ [intellimac4:~/phonybis] aurelie% ls test.com [intellimac4:~/phonybis] aurelie%
cp : copy the file
[intellimac4:~/phonybis] aurelie% ls test.com [intellimac4:~/phonybis] aurelie% cp test.com test1.com [intellimac4:~/phonybis] aurelie% ls test.com test1.com [intellimac4:~/phonybis] aurelie%
So here I gave a new name to the new file. But you can copy and send in an other folder too.
[intellimac4:~/phonybis] aurelie% cp test.com ../phony/ [intellimac4:~/phonybis] aurelie% cd .. [intellimac4:~] aurelie% cd phony [intellimac4:~/phony] aurelie% ls test.com [intellimac4:~/phony] aurelie%
My ../phony/ indicates that : .. I want to quit phonybis, so I am back in Doccuments (in fact . indicates taht you are here and .. indicate the previous folder), phony I want to go to phony folder, and / I want that in this folder my file keep the same name (if I want to rename I have to indicate the new name after the /.
Advice break
To rename a file, use mv command. Just indicate the old name and the new and your file will be rename.
[intellimac4:~/phony] aurelie% ls test.com [intellimac4:~/phony] aurelie% ls test.com [intellimac4:~/phony] aurelie% mv test.com test2.com [intellimac4:~/phony] aurelie% ls test2.com [intellimac4:~/phony] aurelie%
Use Mike's program
When you run calculations you always need to copy some file to run an other calculations for example, that's why Mike Bearpark created a UNIX program to make it automatically for you, thus there are less errors possible. So ask him for this program and then read the following lines to learn how to use it.
There are two main commands. The first consists to copy the files .com, .log, .chk and it does not matter which directory they are saved in, it is cpcomchk. Use this command will copy all the file (.com, .log, .chk in the same time) and ask what new name you want to give to this new file.
cpcomchk nameofyourfile(without.com) newnameofthefile(without.comtoo)
Example
cpcomchk aurelie_stable_int_dftuccpvdz_intchk1 aurelie_opt+freq_int_dftuccpvdz_intchk1
-bash-3.00$ cpcomchk aurelie_stable_int_dftuccpvdz_intchk1 aurelie_opt+freq_int_dftuccpvdz_intchk1 aurelie_stable_int_dftuccpvdz_intchk1 aurelie_stable_int_dftuccpvdz_intchk1 /work/alasoro/12march
So my files are renamed. Now I can work on the new file without change anything in the previous but getting all the information of my previous calculation.
And now the second command!
You have done it for the script and now you can do it with the jobscript.
cpsub jobscript_nameofyourfile jobscript_newnameofyourfile
Example
cpsub jobscript_aurelie_stable_int_dftuccpvdz_intchk1 jobscript_aurelie_opt+freq_int_dftuccpvdz_intchk1
And have a look inside the jobscript : the name is changed for the file .com and .log.
#PBS -l ncpus=1 #PBS -l mem=1700mb #PBS -l walltime=01:09:00 #PBS -joe module load gaussian g03 < /home/alasoro/12march/aurelie_opt+freq_int_dftuccpvdz_intchk1.com > /work/alasoro/12march/aurelie_opt+freq_int_dftuccpvdz_intchk1.log
Link Mac <---> Cluster
Go to the cluster
ssh -Y username@login.cx1.hpc.ic.ac.uk
Username = name give by Imperial College (email account)
[intellimac4:~] aurelie% ssh -Y alasoro@login.cx1.hpc.ic.ac.uk alasoro@login.cx1.hpc.ic.ac.uk's password:
Then type your Imperial College password, and you should go to the cluster.
Copy a file from your mac to your account on the cluster
It is really usefull to export a file from a computer to the cluster
scp absolute_link_to_the_file_on_your_mac username@login.cx1.hpc.ic.ac.uk:/home(or work, it depends on which directory you want to put the file)/username/
Example :
So send our file test2.com to the directory home on the cluster
[intellimac4:~] aurelie% pwd /Users/aurelie [intellimac4:~] aurelie% cd phony [intellimac4:~/phony] aurelie% ls test2.com [intellimac4:~/phony] aurelie% scp ./test2.com alasoro@login.cx1.hpc.ic.ac.uk:/home/alasoro/ alasoro@login.cx1.hpc.ic.ac.uk's password: test2.com 100% 650 0.6KB/s 00:00 [intellimac4:~/phony] aurelie%
So the file was good sent to the directory home.
Copy a file from your account on the cluster to your mac
Obviously you can do it in the other side.
scp username@login.cx1.hpc.ic.ac.uk:/home(or work, it depends on which directory you want to put the file)/username/ absolute_link_to_the_file_on_your_mac
Run a calculation
To run a calculation in the cluster you need first a file .com, which contain the informations concerning the molecule (coordinates, type of calculation require, spin...).
And to be able to start a calculation you need a jobscript file. This file resume where is the file .com on the cluster, where you want that the file .log would be written, and the time of calculation that you estimate.
So for example :
#PBS -l ncpus=1 #PBS -l mem=1700mb #PBS -l walltime=00:09:00 #PBS -joe module load gaussian g03 < /home/alasoro/16march/aurelie_stable_int_dftuccpvdz_intchk1.com > /work/alasoro/16march/aurelie_stable_int_dftuccpvdz_intchk1.log
When Gaussian will run the calculation, as in your mac, it will create a file .log where all the informations that you can interpret are, and a file .chk which contains a binary resume of the results, in this aim of being able to use again this informations in an other calculation.
Advice break Because the files .log and .chk are the biggest files, save their in the directory WORK, in which you belong the more place.
Cancel a calculation
If you want to cancel a calculation which is running or queueing :
-bash-3.00$ qstat Job id Name User Time Use S Queue ---------------- ---------------- ---------------- -------- - ----- 2745894.cx1 jobscript_couma alasoro 0 Q p1mem -bash-3.00$ qdel 2745894.cx1 -bash-3.00$ qstat -bash-3.00$
qdel name_of_the_file_in_the_queue
Best websites
For everybody this website group together the most classical command of UNIX : Basis UNIX commands
For the French (the lucky guy!!), or people who can good understand french, there is really a marvellous website : Le Site du Zero, where you can find a tutorial about UNIX, about XHTML, LATEX... If you need something, first go to the website and if you do not find your answer do not hesitate to ask the question on the Forum you will have a quickly response for sure.
And because this website had really a huge success in France, they begin to translate the website, but for the moment there is nothing concerning UNIX, but have a look because they may add it : Newbies Paradise.
Back to Resgrp:comp-photo-c3h6-tutorial