Tuesday, April 10, 2012

Install Lammps on Ubuntun

Reference list:
1. http://lammps.sandia.gov/doc/Section_start.html
2. http://ubuntuforums.org/showthread.php?p=10512875
3. http://ubuntuforums.org/showthread.php?t=1390490
4. http://ubuntuforums.org/showthread.php?t=1038282&highlight=LAMMPS

After install lammps successfully, next step is to install lammps tools.
1. go to the folder "tools"
2. $ make

Sunday, April 8, 2012

How to set share folders in Virtualbox (host: ubuntun, guest: windows 7)

Check website:

http://news.softpedia.com/news/How-to-Fix-Windows-7-Sharing-in-VirtualBox-123021.shtml

Goodluck

Friday, April 6, 2012

Backup data to USB hard disk driver

1. sudo fdisk -l (find where is your USB hd driver and it's name, here, we suppose it's /dev/sdh1)
2. mkdir /media/sdh1
2. mount /dev/sdh1 /media/sdh1
3. cp xxxyourfile /media/sdh1

Wednesday, April 4, 2012

Easily increase your VirtualBox VDI hard disk size

1.Create a new Virtual Machine in VirtualBox. Make sure that you set hit General -> Advanced and duplicate your original machine’s settings here. For me, the key was setting the same IDE controller type, such as PIIX3, and setting the same OS. Just used this to increase the size of my Windows 7 disk from 20 to 100 GB.

For example, my original Machine is Win7, system size is 20G, my new Machine is Win7-2, system size is 100G

2. Clone the original machine to new machine, using command :
$: VBoxManage clonehd /...path.../Win7.vdi /...path.../Win7-2.vdi --existing

3. Now Login your new machine Win7-2, you will find the disk size c: is still 20G, but not 100G.
You should use disk management tool to increase the size of C: partition. All Control Panel Items --> Administrative Tools --> Computer Management --> Storage --> Disk Management --> Choose C: partition --> Click Right key of mouse, and choose "Extend Volume", now you can add unallocated 80G to your C: Partition.

Good luck.

Adding New Hard Disk Drive onto Ubuntu 10.10

http://essayboard.com/2010/12/19/adding-new-hard-drive-onto-ubuntu-10-10/

Adding a second hard drive or additional hard drive to Ubuntu 10.10 or any other Linux flavor (distribution) can be frustrating sometimes. So here I present you the information of how to do it. Just to be clear, within this post, I do not show you how to physically install second hard drive or additional hard drive to your computer, but it’s rather of how to make your Ubuntu 10.10 system or other Linux flavor to be able to recognize your second hard drive or additional hard drive. So let get started!

Open up a terminal and type in the command [sudo fdisk -l] without the square brackets. Your first hard drive is obviously going to be listed in the standard output printout (i.e., your terminal), and usually the first hard drive should be listed as something of /dev/sda. Linux lists hard drives in the directory which is known as dev. Also, inside dev directory, other partitions of your hard drive may look like /dev/sda1, /dev/sda2, /dev/sda3 and so on. Just like how Windows lists its hard drives such as C:\, D:\, E:\, and so on. Linux is also doing the same thing (i.e., pattern) but with different combination of letters. With that in mind, the second hard drive within Ubuntu 10.10 or any other Linux should be /dev/sdb (i.e., partitions of drive sdb should be sdb1, sdb2, and so on). When you typed in the command [sudo fdisk -l] earlier, you should see /dev/sdb or in the case of a third hard drive you should see /dev/sdc and so on. The whole idea is if you see the new hard drive is on the list of fdisk’s standard output printout, then you can mount the drive permanently or temporary.

There is another scenario when you can’t find your new hard drive on the list of fdisk’s standard output printout, because your new hard drive isn’t yet formatted into the right type of partition table. Another way to clearly explain that is your hard drive won’t be recognized by your operating system such as Ubuntu 10.10 unless the hard drive has been changed into a file system that can be recognized by your operating system. This is not that hard really! For Ubuntu 10.10, go toSystem > Administration > Disk Utility, highlight the new hard drive on the left side panel, and on the right side panel, just click onFormat Drive. Make sure you have backed up all important files on the new hard drive, because format a drive will delete everything on it. Make sure you choose GUID partition table type so it can be recognized by many other operating systems in case you have to switch to another operating system and still wanting to keep the same partition table and files on this specific hard drive. One additional step must be taken care of before your new hard drive can be mounted is to create a partition for it. So after you have format the drive, creating a partition is simply to click on Create Partition button on the right panel of Disk Utility. Make sure you choose the ext4 or ext3 file-system, but I prefer ext4 file-system. Choose the size of the new volume or using the whole drive for the new partition. Label it if you want such as BackupStorage. Check the box which states “Take ownership of filesystem.” ClickCreate button and there you have it, a brand new volume that can be mounted.

Get back into your terminal, type in the command [sudo fdisk -l] to see your new hard drive is on the fdisk list or not. After you confirm that it’s visible on fdisk’s standard output printout, then it’s time to create a mount point. What’s a mount point? It’s a virtual location on your main hard drive (i.e., first hard drive), and your operating system will look at your first hard drive first to see if it can find the list of the partitions. By creating a virtual location of a mount point on the first hard drive, you’re one step closer to permanently mounting your new hard drive. To do this, go to the terminal again, and type in the command [sudo mkdir /media/BackupStorage], and I try to name the new hard drive’s mount point label similar to the new hard drive’s label when we had formatted the drive earlier. Again, inside terminal, type the command [sudo chmod 755 /media/BackupStorage] to ensure correct permission is applying to the new mount point of the new hard drive. Again, inside terminal, type the command [sudo chown -R user:user /media/BackupStorage], but make sure that you replace the user:user part with the real user you want to have control over the new hard drive and mount point. Obviously, don’t try to enter the square brackets inside the commands that you’re going to enter into the terminal since I place the square brackets in this post so the commands would stand out.

Now you have the mount point for the new hard drive or volume. The obvious next step is to do a temporary mount! Remember when you use the command [sudo fdisk -l]? You should have seen the /dev/sdb1 or something of sort as your new hard drive’s newest partition. Let mount that to the new mount point! Inside a terminal, type in the command [sudo mount /dev/sdb1 /media/BackupStorage]. To check to see if your new hard drive is really mounting to /media/BackupStorage mount point, all you have to do is type in the command [sudo df -l]. If you see /dev/sdb1 or something of sort resides on the same row with /media/BackupStorage, then you have successfully mounted your new hard drive.

What we did above is to only temporary mount the hard drive as if we had tested to see how we are doing so far with the process of adding a new hard drive to your system. The last step would be permanently making your new hard drive available after every boot or reboot of your computer. To do this, you need to be inside your terminal, type in the command [gedit /etc/fstab]. An editor will pop up with a file which has the list of all mounting partition tables. Now, go to the very last line (i.e., empty line at the bottom of the file) and type in [/dev/sdb1 /media/BackupStorage ext4 defaults,noexec,nosuid,rw 0 0]. Save the file and exit out of the editor. Obviously, make sure you replace /dev/sdb1 with your actual drive number such as /dev/sdc1 or /sdb2 or whatever; replace /media/BackupStorage with actual label of your mount point; replace ext4 with actual filesystem that you had formatted the hard drive with; make sure 0 0 is not letter o(s) but actual two number zeros with a space in between. Lastly, just reboot the computer and you should be able to use the brand new hard drive. To check to see if everything is alright, you can do this by go toPlaces > Computer. Creating a test file or a test folder inside the new hard drive to see if you can actually do that. There you have it, a brand new hard drive that is working with Ubuntu 10.10 or any Linux flavor that you’re using!

Tuesday, April 3, 2012

Installing Gamess on UBUNTU 64 bit (ZZ)

File is based on:
http://gamess-linux.blogspot.ca/2010/08/installing-gamess-on-ubuntu-6-bit.html

and small changes were made.

For installing Gamess, you need to install a few programs before; like fortran compiler, c-shell, math libraries and so on.
For 64 bit Linux (Ubuntu 10.04) do this:
In bash write (or copy and paste; for pasting in bash press ctrl + shift + v):

sudo apt-get install tcsh gfortran

this command will install c-shell and gfortran compiler.

You need to install math libraries too. I prefer to use Intel's MKL (Math Kernel Library). You can download free academic version of it from here (https://registrationcenter.intel.com/RegCenter/AutoGen.aspx?ProductID=1280&AccountID=&EmailID=&ProgramID=&RequestDt=&rm=NCOM&lang= ). You need a password to install it. While you are downloading the MKL, in the page you will see a password; save it.
Installing is easy and straight forward. It will guide you step by step.
To install it, in bash go to the place which you saved and unzipped the MKL. Then write:

./install.sh

and press Enter key; answer the questions. If your installation encounter any problem, it will give you enough information to solve it. Don't worry about them.

Finally, you are ready to install Gamess.
Download and save Gamess in your home directory. Unzip it. You will see some files and directories in it. In bash, go to Gamess directory. Then write:

./config

answer the questions about your machin and compiler. Your answer should be Linux64, gfortran, MKL, version of MKL and so on. The config script will guide you to answer the questions correctly.
Go to ddi directory and open compddi by using text editor like gedit. In top part of it you will see MAXCPUS=8 and MAXNODES=128; I prefere to change them to MAXCPUS=4 and MAXNODS=1. Because I want to install Gamess in a PC with 1 node and 4 CPUs ( a quad system). (when setting up your network for Linux clusters, and choosing communication library ('sockets' or 'mpi')? I chose "sockets") Then, in bash write (While you are in ddi directory:

./compddi >& compddi.log &

it takes a few minute to compile ddi. When the compiling finished (See the compddi.log file) in bash write:

mv ddikick.x ..

ATTANTION: you need to write ".."; do not delete dots.
Change your directry in bash to gamess directory and in bash write:

./compall >& compall.log &

It take about 10-15 minutes to compile it.
While you are in Gamess directory, in bash write:

./lked gamess 01 >& lked.log &

Now we are going to do the most importante an complicated part of Gamess installation;
ATTENTION: Here I will go to give you an example for configuring of rungms. I have a PC with quad CPU and I installed my gamess in this directory: "/home/alchemist/gamess". You need to change this address with yours. You need to create a directory scr in your home directory. I created it in this address:" /home/alchemist/scr". You need to create another folder inside of it with the your USERNAME inside of it. I created this one: "/home/alchemist/scr/alchemist" Change the alchemist with your username.
Open the rungms with a text editor like gedit.

Find the line:

set SCR=/scr/$USER
and change it to:
set SCR=/home/alchemist/scr/$USER

Find the line:
if (null$VERNO == null) set VERNO=00
and change it to:
if (null$VERNO == null) set VERNO=01

Find the line:
setenv ERICFMT ~mike/gamess/ericfmt.dat
and change it to:
setenv ERICFMT /home/alchemist/gamess

Find the line:
setenv MCPPATH ~mike/gamess/mcpdata
and change it to:
setenv MCPPATH /home/alchemist/gamess

Find the ilne:
if ($os == Linux) set GMSPATH=/cu/mike/gamess
and change it to:
if ($os == Linux) set GMSPATH=/home/alchemist/gamess

Now you need to do some changes to run the gamess in parallel. Find this part:

if (NCPUS == 1) then
set NNODES=1
set HOSTLIST=('hostname')
endif

You need to keep this part. But after it add these lines:

#
if ($NCPUS == 2) then
set NNODES=1
set HOSTLIST=(localhost:cpus=2)
endif
#
if ($NCPUS == 3) then
set NNODES=1
set HOSTLIST=(localhost:cpus=3)
endif
#
if ($NCPUS == 4) then
set NNODES=1
set HOSTLIST=(localhost:cpus=4)
endif
#
if ($NCPUS == 4) then
set NNODES=1
set HOSTLIST=(localhost:cpus=4)
endif
#


Modify file runall:
Find line:
chdir /u1/mike/gamess
and change to
chdir /home/alchemist/gamess

This configuration is for 4 CPUs in 1 Node.
Now rungms is ready; You can youse your Gamess in parellel. To examine the Gamess you should run some test jobs. In bash write:

./runall >& runall.log &

To run Gamess in bash go to your Gamess directory. You should have a copy of your input file in that directory too. In bash write:

./rungms YOURFILENAME.inp >& YOUROUTPUTNAME.log

If you want to run in parallel write like this:

./rungms YOURFILENAME.inp 01 4 >& YOUROUTPUTNAME.log

This will run the Gamess in 4 CPUs. To run ind three CPUs write:

./rungms YOURFILENAME.inp 01 3 >& YOUROUTPUTNAME.log

This is the end of Gamess instalation on LINUX UBUNTU 10.04.

GOOD LUCK