Cubietruck cluster WRFCHEM
2014-10-25
####cubie truck cluster for WRF CHEM####
This note explains the steps in creating Cubietruck cluster for WRF CHEM modeling.
#####Installing debian#####
1. Cubietruck is having Android OS preinstalled as its main os for its inbuilt nand storage of 8 GB hard disk. To change this into Debian os following steps were followed.
1. Made several attempts for running Debian or ubuntu os image in Cubietruck. Later found a tweaked image from here at first sight shows promising for WRF CHEM.
1. The image from here was copied into 4GB SD card using this command dd if=/home/swl-sacon-dst/Documents/GISE_2013/LAB/Cubietruck/CT_Debian_2.7_wheezy/CT_Debian_2.7_wheezy.raw of=/dev/sdb bs=4096; sync
. The system tool gpart was used for foramting the sd card.
1. Aftre writing, loaded the sd card into cubietruck(CT) and booted. It is by default CT is primed for SD card boot than nand, so it booted and the Debian was running from the SD card. To write the SD card os into NAND flash, following attempts were made
1. The first attempt: used the provided script with sd card to flash the nand. Though the script ended without any error but failed to boot without sd card.
1. Second attempt: based on this page the SD card os image was copied into NAND flash by formating and rsync. This also ends in non bootable NAND flash. Followed this note also, but no actual output.
1. The third attempt: followed as per the used os image page instruction. It is instructed to flash lubuntu os on the nand image using All winner supplied tool LiveSuit, then use the nand_flash.sh script. For this live suit was used based on thsi page but ended in the problem of not recognized by the laptop for the allwinner USB of cubietruck attached to it. Later it is found that from here it is of the problem with kernel version. So started livesuit in another ubunut 12.04 with kernel version 3.02, it recognized cuibetruck usb and flashed its nand with lubuntu os.
1. In the lubuntu os, then used the sd card Debian image and flashed, this time the nand was flashed and cubietruck was running without sd card os, Debian wheezy in NAND flash.
####Compile WRF CHEM#### 1. Choosing the right gcc and gfortran based on update-alternatives, and it chose gcc 4.7 and gfortran 4.7. With different gcc and gfrotran version as of GSI compilation, it ends in gcc, gfortran testing of wrf compilation an erroneous. The same version of gcc and gfortran cleared the test without any error.
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
sudo update-alternatives --config gcc
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-4.7 60
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-4.4 10
sudo update-alternatives --config gfortran
Following GSI compilation Openmpi 1.6.1 was compiled in cubietruck Debian wheezy. It was based on this. Earlier openmpi 1.8.1 compilation fails.
wget http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.tar.bz2 tar xvf openmpi-1.6.tar.bz2 cd openmpi-1.6/ sudo mkdir /opt/openmpi/ sudo chown ${USER} /opt/openmpi/ ./configure --prefix=/opt/openmpi/1.6/ --with-sge make make install export PATH="$PATH:/home/.openmpi/bin" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/.openmpi/lib/"
netcdf compile
export DIR=/home/wrf_libs export CC=gcc export CXX=g++ export FC=gfortran export FCFLAGS=-g export F77=gfortran export FFLAGS=-g export CXXFLAGS=-g
export PATH=$DIR/netcdf363/bin:$PATH
export NETCDF=$DIR/netcdf363
mpif90 -c 02fortran+c+netcdf+mpif.f
mpicc -c 02fortran+c+netcdf+mpic.c
mpif90 02fortran+c+netcdf+mpif.o
02fortran+c+netcdf+mpic.o
-L${NETCDF}/lib -lnetcdf
mpirun ./a.out
- wrfchem compile
sh nand-install.sh
# # ## ##### # # # # # ####
# # # # # # ## # # ## # # #
# # # # # # # # # # # # # #
# ## # ###### ##### # # # # # # # # ###
## ## # # # # # ## # # ## # #
# # # # # # # # # # # ####
This script will NUKE / erase your NAND partition and copy content of SD card to it
Proceed (y/n)? (default: y): nand-install.sh: 45: [: unexpected operator Formatting and optimizing NAND rootfs … up to 30 sec mke2fs 1.42.5 (29-Jul-2012) e2fsck 1.42.5 (29-Jul-2012) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/nand2: 11/468640 files (0.0% non-contiguous), 66302/1871872 blocks Creating NAND bootfs … few seconds Creating NAND rootfs … up to 5 min All done. Press a key to power off, then remove SD to boot from NAND