tungwaiyip.info

 

home

about me

links

my software

Media

Yucatán Photos

St Lucia Photos

Photo Album

Videos

Blog

< July 2009 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

Exploring parallel programming

When I first started blogging, I have a lot of geeky posting about software development. The idea of blogging is to write on short subjects frequently. It is different from writing a long article, which is so burdensome many people end up not doing it at all. But in practice, I have not lived up to expectation of a prolific blogger. Sometimes the gap between postings can be a few months.

Anyway this is the quick posting on geeky subject that I think I should do more. Recently I am working on high performance computing and number crunching task. I have dipped into writing C extension for Python for performance. I got spectacular result from the exercise. It is the best of both world. Programming in Python supplement by C is still very agile and iterative. On the other hand C is giving the performance unachievable with pure Python.

I am started to look into the multiprocessing module introduced in Python 2.6. It is a library to run multiple python processes. With an interface similar to the threading module, it is positioning itself as an alternative approach to threading to circumvent the limitation of Python's GIL. I haven't give much thought to it initially. But looking closer, I find it is really more than just an alternative to threading. It is really a parallel programming framework. For example, the method Pool.map() is really a prototype of a mapreduce framework. I am quite excited to explore this module in the coming days.

Another module I am looking at is the ctypes module. It allows Python code to call C functions directly. Again I haven't thought much about it when it was introduced in Python 2.5. That's because I haven't have a use case of it. Now that I am writing C module, I begin to realize how revolutionary it is. C module delivery great performance. But writing one is a pain. Just the need to keep track of reference count may double the number of lines of your code. For me I am not building a reusable module for other people. It is one off function for me to do number crunching. Using ctypes may allow me easier access to C without the burden of actually writing a Python module.

2009.07.12 [, ] - comments (0)

 

 

Comments (0)

past articles »

 

BBC News

 

Pakistan trio hit by ICC charges (02 Sep 2010)

 

Middle East talks 'constructive' (02 Sep 2010)

 

School lottery 'failed in aim' (02 Sep 2010)

 

Earl weakens as it nears US coast (03 Sep 2010)

 

Alcohol drinking 'continues fall' (02 Sep 2010)

 

Compost sparks Legionnaire's fear (02 Sep 2010)

 

Bone drug linked to cancer risk (02 Sep 2010)

 

Openness urged on UK's emissions (03 Sep 2010)

 

Explosion on Gulf of Mexico rig (02 Sep 2010)

 

Europe agrees finance watchdogs (02 Sep 2010)

more »

 

Slashdot News for nerds, stuff that matters

 

Harvard Ditching Final Exams? (2010-09-03T00:37:00Z)

 

Video Appliance For a Large Library On a Network? (2010-09-02T23:21:00Z)

 

Canon Develops 8 X 8 Inch Digital CMOS Sensor (2010-09-02T22:39:00Z)

 

Flash On Android Is 'Shockingly Bad' (2010-09-02T21:59:00Z)

 

GameStop Pulls Medal of Honor From Military Bases (2010-09-02T21:03:00Z)

 

GameStop Pulls Medal of Honor From Military Bases (2010-09-02T21:03:00Z)

 

DNA-Less 'Red Rain' Cells Reproduce At 121 C (2010-09-02T20:11:00Z)

 

Hawking Picks Physics Over God For Big Bang (2010-09-02T12:54:00Z)

more »

 

TechPsychic Tech Rumors and Invented News

 

TechPsychic: AT&T: more money, says it's disruptive in funding from. (08 May 2010)

 

TechPsychic: I know that Apple is close to Apple Dominates, Hires ex-Googler - Yes, Android phones. (08 May 2010)

 

TechPsychic: AT&T says: Facebook Connect. (08 May 2010)

 

TechPsychic: Google's Nexus One of Google Chrome Release Adds Support subscriptions accounted for Amazon: Apple. (08 May 2010)

 

TechPsychic: Another stat: Twitter's Design of this is giving rise of BlackBerry Foursquare Map App store end. (07 May 2010)

 

TechPsychic: Like educational sales Up around Apple iPad makes money Plan costs half an Apple. (07 May 2010)

 

TechPsychic: Instead added extensions, social Networks than double, everyone jumps in Silicon Valley? (07 May 2010)

 

TechPsychic: So why iTunes App lets Social Networks Verizon Wireless Internet. (07 May 2010)

more »

 

SF Gate

 

Steel exec feared dead in Peninsula plane crash (2010-09-02T21:35:12UTC)

 

No sign of oil spill after Gulf platform fire (2010-09-02T21:25:11UTC)

 

Immigration agency ponders S.F. opt-out request (2010-09-02T07:42:17UTC)

 

Foreclosures can make you sick, report says (2010-09-02T16:43:37UTC)

 

Earl threatens East Coast with a pounding (2010-09-02T21:32:27UTC)

 

Muni drivers fight restoring service cuts (2010-09-02T12:22:46UTC)

 

Michela Alioto-Pier loses bid to seek new term (2010-09-02T16:43:13UTC)

 

Barbara Boxer, Carly Fiorina debate taxes, jobs (2010-09-02T18:06:36UTC)

 

Rapper T.I. comeback could be derailed with arrest (2010-09-02T21:35:41UTC)

 

Con man could get life under Calif. 3-strikes law (2010-09-02T21:35:32UTC)

 

Funk band War tells PepsiCo they're not friends (2010-09-02T21:35:10UTC)

 

Ex-US air base in Iceland considered for war games (2010-09-02T21:35:07UTC)

 

Stocks move higher following jobs, housing reports (2010-09-02T21:32:28UTC)

 

Presented By: (02 Sep 2010)

more »

 

Asia Times Online

 

China makes its North Korea move (2 Sep 2010)

 

Al-Qaeda presses a point with Lahore attack (2 Sep 2010)

 

LIFE IN TALIBANISTAN : The degree zero of culture (2 Sep 2010)

 

Clawing back credibility in Kyrgyzstan (2 Sep 2010)

 

Iraqis uneasy over what happens next (2 Sep 2010)

 

Hiroshima's poisonous past (2 Sep 2010)

 

Sheen wearing off Indian growth (2 Sep 2010)

 

Pakistan mulls 'flood taxes' (2 Sep 2010)

 

Malaysia reaps reform benefits (2 Sep 2010)

 

THE MOGAMBO GURU : Secret path to riches (2 Sep 2010)

more »

 


Site feed Updated: 2010-Sep-02 19:00