Reading 1022nd files in Linux

I came across this problem again, haha.

I was running a program that requires opening 8000+ files at the same time. But I had trouble while reading the 1022nd file, just like before. This time I decided to solve it permanently.

Add this into /etc/security/limits.conf:

*      soft    nofile   9000
*      hard    nofile   9000

And you are all set. Alternatively, if you just want a one-time violation, then use this:

ulimit -n 9000

I have seen a post before talking about this problem, and it is said by default CentOS has the limit of 1024. Within these 1024 file descriptors, 2 are reseved by the system (stdout and stderr). In my case, another descriptor was occupied by the script, therefore we had problem around 1022nd file.

Set up Java in CentOS 7

I have long been interested in Android application development, but I have not studied Java before. I was told that I can run Java on Windows using NetBeans, but now I would like to get this done on Linux, as in Linux world I can use my favorite VI, and not bothered with bulky IDE.

By default CentOS 7 has some version of Jave installed. I tried it, and while I was able to use javac to create class file, I was not lucky in running java. So I decided to switch to Sun Java. Continue reading

Installing WRF on CentOS 7

WRF (Weather Research and Forecasting) is a powerful numerical simulation tool in atmospheric science. It is maintained by UCAR, and has been under continuous development. There has been a lot of official (ARW user guide)/ unofficial installation guides, but not so much information for CentOS 7 system. There are some minor differences in CentOS 7 that we have to configure manually. This, however, is pretty straightforward if you are familiar with Linux. Here I will show how to set up the basic dependencies, and how to compile WRF, as well as the related WPS and RIP4. Also here I will give out the steps for GNU compiler installation and Intel compiler installation.

Continue reading

Climate Data Operator (CDO) installation on Linux

CDO (Climate Data Operator) is a powerful tool for handling NetCDF files. It is also able to process other formats like HDF5, GRIB2, and so on. In my research (WRF) I only use NetCDF format, so here I install CDO only with NetCDF support.

1. Get the latest version of CDO

Go to the official website of CDO, and download whatever version is there. By the time I am writing this post, the newest version is 1.6.8.

$ wget code.zmaw.de/attachments/download/10030/cdo-1.6.8.tar.gz
$ tar -zxf cdo-1.6.8.tar.gz
$ cd cdo-1.6.8

Continue reading

Software installation in CentOS 7 for scientific computation

I am recently setting up a Linux workstation in my lab, for my WRF simulation. Also, this workstation is used as my main processing powerhouse, so I am installing other useful tools that I have used, or I plan to learn/use in the near future.

I have been using Ubuntu before, so I am pretty familiar with “apt-get” manager and the software names in this system. But now with consideration for system stability, I am switching to CentOS. I installed CentOS 7.0 on the machine, and the installation below is based on it. Sometimes the software libraries are slightly different for different versions/distributions of Linux. For example, I can use “apt-get install acroread” to install Adobe Reader in Ubuntu 12.04, but up to now I have not been able to make it in Ubuntu 14.04. So if any of the following command does not work for you, please find other approaches, or just compile it from the source code. Please keep in mind that nothing is impossible in Linux world. Now let’s get started.
Continue reading

Network configuration in VM workstation

This is my second time running into this problem, so I think it would help to put the solution here.

I am using VM workstation to run Windows and Linux simultaneously. I have used Ubuntu virtual machine before, and everything was smooth. But I ran into problem when running CentOS virtual machine with host machine using wired Internet connection. My environment is Windows 8.1 + VM workstation 11. Here is my solution:

1. Make sure the network adapter for CentOS virtual machine was “NAT”;

2. Check the host connection, and set the actual network connection. Then set it to allow connection sharing. The “Home network connection” is set to be the NAT adapter in VM workstation (it looks like the default one is VMnet8). Here is the correct setting.

vm_network

 

3. Now the CentOS vm should be able to get connected to Internet.

Citation and reference

Working around citation and reference during paper preparation is sometimes a headache. A good literature manager software (like RefWorks I am using) would make life so much better!

A good way to utilize RefWorks is to have it generate the reference list with the style we want. RefWorks has a huge library for these styles, but it needs some time to get what you want. Here is a step by step instruction. I was working on reference list for Biogeoscience recently. We go to the online account page, and choose “Bibliography” tab (shown below).

Figure 1

Continue reading