Friday, December 28, 2007

From OpenSocial's sandbox


I've been playing out with OpenSocial's API from within Orkut's sandbox for a while. This API intends to integrate social sites like Orkut, MySpace, Hi5 and others through a javascript API.
In order to test, I've signed up for a sandbox account and started reading the documentation api .
After creating the Hello Worlds gadgets - by the way, in order to use Orkut's sandbox, Google gadgets need to be created - I've came across the output on the right.
I'm still wondering why so few friends are retrieved... maybe it's a sandbox limitation... I don't know... I've just posted this to find it out.
****
Ooops... they've just answered that... only friends who are also in the sandbox are listed... that's why it only retrieves a couple friends :)

Small ruby script to remotely run a program

In case one needs to remotely run a program from some ruby application, an easy way to do that is using Net-ssh. It remotely runs commands through ssh.
After installing the gem through a simple
gem install net-ssh

the following script can be run in order to call the 'ls' application, used to list directory's contents:

require 'rubygems'
require 'net/ssh'

session = Net::SSH.start('your-host','your-user', 'your-password')

session.process.open("ls") do | ls |
ls.on_stdout do | p, data |
puts "#{data}"
end
end

Tuesday, October 23, 2007

What you should know before diving into GPGPU study

Before choosing your Graduate/Master/PhD thesis subject as something in GPGPU, you should be aware that:

1- A new technology, from NVidia, called CUDA, has been created and you don't need to use Graphics API to make general purpose programming using GPUs. Besides being outdated, confusing and not productive, graphic API code lacks several features available from CUDA, specially the ability to make scatter. Unfortunatelly programs written for CUDA are only going to run in GeForce 8000 series (and later), QuadroFX 5600, 4600 and Tesla C870, D870, S870. Other frameworks as Brook and RapidMind should be checked as well.

2- You need to understand that a GPU, as you'll use it, is a set of SIMD (single instruction multiple data) processors grouped in multiprocessors. It means THEY WILL ALWAYS EXECUTE THE SAME INSTRUCTION during a clock cycle, but in different data. So, you should not think of them as being able to execute threads in a fashion like a dual-core Intel would, or even the Cell processor. Make sure your algorithm can be expressed in such a way.

3- Memory transfers can become potential bottlenecks for your application. Remember that, when programming GPU code, the data you access needs to be located at the global memory space in GPU. In order to load something there, you'll firstly need to download data to the GPU. As a rule of thumb, it takes a GeForce 8600M GT around 6ms to download a 1024x1024 pixels image (around 4MB). And YES, it might be the single detail that will prevent your application from running faster on GPUs.

4- There's some initialization time for the GPU (which is around 100ms). If you need to run only one iteration of your algorithm, and it is supposed to take less than 100 ms... CPU will probably be the best choice.

5- There's very small shared memory for GPUs. CUDA architecture makes available is 16KB per multiprocessor. It means, that if you are running 256 threads in a single multiprocessor (which is what you should be generally doing) you'd have 64 Bytes per thread... which are about 16 integers... if you can solve your problem with such a small amount of memory, your application will be extremely fast, because shared memory access is almost as fast as register access. Else, you'll need to write to global memory... it takes around 300 cycles to retrieve a value from global memory - which has around 256MB depending on your GPU. If you cannot hide this latency processing the retrieved data while other requests are made, your application will really lag in this point. A good strategy is to allow other threads to process the data while others are waiting for memory requests. An application heavily focused on memory requests will suffer dramatically because of this.

6- Only single precision floating point registers are available. It means around 7 digits of mantissa. Of course, future GPU generations will include double precision values.

7- Linear algebra problems will most probably run very fast on GPUs.

8- Large arrays, such as N-Body simulations are also a good fit for GPUs.

Some benchmarks on CPU, Cell and GPUs are included in this paper. It should be noticed, though, that the article hasn't been accepted for the congress, mainly because this application really does not require much processing from Cell or GPUs, as it spends most of the time on memory transfers. For more info, a great article about the subject and a great site www.gpgpu.org.

*Source: NVidia CUDA Programming Guide and personal experience with GPGPU

Monday, October 22, 2007

latex error .sty not found

Hi guys, if you've come into this error:
"latex error your-new-file.sty not found"
while building your .tex files, and you are sure you've just put them in some sort of directory like:
/usr/share/texmf/tex/latex/your-new-directory
you should run the command
$ texhash
and then, latex should be ready to find your style files
:)

Tuesday, October 09, 2007

Saturday, September 08, 2007

Good friends @ Northwestern University - Robert H. Lurie Comprehensive Cancer Center


Well, just for the records, I'd like to leave this picture here, with all the great colleagues I've met in Northwestern University. Special thanks to Simon, Dong, Rhett and Pan Du for the help along the project :)

Friday, September 07, 2007

Summer of Code final project

GeneQuad, an automatic way to describe genes based on their GeneRif (Gene Reference into function) is available through a rails web application, in the following address:
GeneQuad
The other project, GenDex is also available.
Both of them are intended to be useful in cancer research field as well as bio-informatics.
Guess what's the most researched gene in 2007?

Tuesday, June 12, 2007

Rising Stars

I've made some research finding out the genes that had more importance according to published articles in the last years. The findings are reported in these pages http://code.google.com/p/genequad/wiki/RisingStars and http://code.google.com/p/genequad/wiki/DetailsRisingStars

On the other hand, the ones that had less importance are also reported at http://code.google.com/p/genequad/wiki/ShowStoppers

Monday, June 11, 2007

Importing pubMed database with a ruby script using bioruby

If you desire to import pubMed database, a useful library for ruby may be used: bioruby. This post http://code.google.com/p/genequad/wiki/ImportingPubMed shows how to do that.

Zipf's Law in geneRIF

This post http://code.google.com/p/genequad/wiki/ZipfsLaw shows a study about Zipf's law in geneRIF.

Importing geneRIF database to sqlite3

Ok, if someone wants to import the txt file from NCBI to sqlite3, http://code.google.com/p/genequad/wiki/ImportingGenerif tells you how to do that. A procedure just like this may be used to import to other databases as well. Congrats NCBI for geneRIF!

Wednesday, May 30, 2007

Some studies about Zipf's law and genes


Well, actually, I only needed somewhere to upload this picture :)
If you want to check my reports about the genequad project on Summer of Code, you'll get a good clue of what it's about :)

Wednesday, May 23, 2007

Trick to change octave's plot background

Well, I was trying to change octave's plot background, but I found no easy way, so I changed the way gnuplot is called (gnuplot is the program octave calls to plot the graphics). Simply go to /usr/bin, log as root, and backup gnuplot as
cp gnuplot gnuplot.bak

Rename it to gnuplot1:
mv gnuplot gnuplot1

Now create the script gnuplot by typing
emacs gnuplot

Create this script:

#!/bin/bash
/usr/bin/gnuplot1 -background white

Add execution permission through chmod +x gnuplot

It will make a standard call to gnuplot change to gnuplot -background white, which will change your plots background in octave.
If you have a better way to do this, please leave me a comment
Have fun :)

Thursday, January 04, 2007

IVUS Plugin available

In order to make my graduation thesis fully repeatable, I'm making the IVUS plugin available. This ImageJ plugin adds the functionality to slice an image frame sequence in 4 directions, so that longitudinal segmentation may be applied. It is used for Coronary Intravascular ultrasound images.
The download is available here http://sourceforge.net/project/showfiles.php?group_id=171446&package_id=195893&release_id=475672 under the ivussnakes package in IVUS Plugin release.
Enjoy it!