Recently at my new job I have been doing a fair amount of exploratory coding and writing simulations for various things in Python. However, recently I explored Julia, a new language designed for technical computing. My initial impression is that the language takes the best of Matlab, python, and lisp to create a concise technical programming language. Parallelism is handled through worker processes, which can be either remote or local, thus a program can quickly be tested on a local multicore machine and then deployed onto a cluster without changing the code. This seems like a very nice feature. To me this is not the strongest feature. Any language in isolation might be wonderful, however a good environment is critical to using it. Luckily they have collaborated with the folks working on IPython notebooks to use the same interface and create an IJulia profile. Since I do most of my work in IPython notebooks this is a huge win in my mind. For exploring algorithms the notebooks provide a perfect environment to document the math, as well as write initial versions and display results.
While Julia is promising for doing lots of technical computing and simulation work, it is still young and does not have all of the libraries one might wish for while writing production code. For me this means it will remain a great environment for exploring ideas but most things will be reworked in python for production. Luckily they do have a good python binding so I will be able to incrementally move things over and still use them in my notebooks as imported methods.
For those of you interested in bioinformatics a great resource I came across today is Rosalind. It is similar to Project Euler with puzzles of various difficulty. However the focus of those puzzles isn't pure mathematics but instead bioinformatics. Each puzzle is also accompanied by a short summary of the biological basis of the programming problem. This makes it great for both programmers looking at bioinformatics, as well as biologists looking to learn some informatics.
Saturday, October 5, 2013
Thursday, June 27, 2013
Printrbot upgrades
I have started working on some new upgrades to the printrbot lately. The first thing that I worked on was stabilizing the Z axis, using both a stabilizer for the smooth rods as well as switching the mount for the lead screws to a flex shaft coupler. I am hoping that this gives more consistent results in printing. I still need to switch to better lead screws as well.
In addition to the Z axis mods I have replaced the drive belts with GT2 belts and corresponding drive gears. To accomplish this the calibration must be changed. The following must be placed in the custom gcode for slic3r.
M92 X80 ; calibrate X
M92 Y80 ; calibrate Y
I have also added max speed and acceleration code aswell. This seems very useful for printing faster and precisely.
In addition to the Z axis mods I have replaced the drive belts with GT2 belts and corresponding drive gears. To accomplish this the calibration must be changed. The following must be placed in the custom gcode for slic3r.
M92 X80 ; calibrate X
M92 Y80 ; calibrate Y
I have also added max speed and acceleration code aswell. This seems very useful for printing faster and precisely.
Wednesday, June 19, 2013
Notebooks
With my new job as well as summer I have been pretty busy and obviously not posted in a while. However, one thing that I figured I would share with my fellow math and science friends is what I have been using for exploring at work. We are primarily a python shop doing lots of novel bioinformatics algorithms, and thus I am writing lots of simulations and exploratory programs to try out ideas. Before I would do most of this in the python interpreter, however lately I have switched to using IPython notebooks. In many ways this is similar to a Mathematica CDF document, where you can interlace text, code, and output.
This is extremely helpful for working with lots of math, where I can write notes about it above, and then a code implementation below. Note, the text can be formatted in LaTeX annotation, making math look nice. I also find that I am spending multiple days exploring concepts instead of just a few hours, and having something that is saved and I can go back to without writing a full program is very nice. So if you do lots of heavy algorithms development or math I would recommend checking it out.
This is extremely helpful for working with lots of math, where I can write notes about it above, and then a code implementation below. Note, the text can be formatted in LaTeX annotation, making math look nice. I also find that I am spending multiple days exploring concepts instead of just a few hours, and having something that is saved and I can go back to without writing a full program is very nice. So if you do lots of heavy algorithms development or math I would recommend checking it out.
Wednesday, April 17, 2013
Update
Recently I took a new job at a biotech startup as an informaticist. While it is a dream job for me it means that of late I have not had anything to post as I prepare to move. This may change in the coming months, however until I move and get situated I will be doing much less outside of work. I will be joining the Artisans Asylum in Somerville as a place to work on projects.
Thursday, February 28, 2013
CUDA timing v2
So today I decided that I want to add some timing statements to my test code for some cuda methods. I have posted about timing CUDA code before, however I felt that it would be too cumbersome to add that code to the tests themselves. So as a solution I decided to use a method with a function pointer. The code snippet below demonstrates this.
The method 'timeIt' takes as its input a function pointer and a string with the name of the method to be called. Then the proper cuda events are created, and the method called while the timer runs. While this is straightfoward it is the first time I have actually used function pointers. A more detailed treatment of them can be found here
void timeIt(void (*fn)(), string name){
float elapsedTime=0.0;
cudaEvent_t start, stop;
cudaEventCreate(&start);
cudaEventCreate(&stop);
cudaEventRecord(start,0);
fn();
cudaEventRecord(stop, 0);
cudaEventSynchronize(stop);//remember kernels run asynchronously
cudaEventElapsedTime(&elapsedTime, start, stop);
cout<<"Execution of "<<name<<" took "<<elapsedTime<<" milliseconds."<<endl;
}
The method 'timeIt' takes as its input a function pointer and a string with the name of the method to be called. Then the proper cuda events are created, and the method called while the timer runs. While this is straightfoward it is the first time I have actually used function pointers. A more detailed treatment of them can be found here
Subscribe to:
Comments (Atom)