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

 

Abbas 'refuses talks with Israel' (11 Mar 2010)

 

Greeks stage fresh general strike (11 Mar 2010)

 

Mexican shakes up world rich list (11 Mar 2010)

 

DR Congo mines 'hit by extortion' (11 Mar 2010)

 

Contractors 'divert Somalia aid' (10 Mar 2010)

 

Chile's new leader to be sworn in (11 Mar 2010)

 

Haiti situation 'dire', Obama says (10 Mar 2010)

 

Pakistan drone raid 'kills 12' (11 Mar 2010)

 

Google to scan old Italian books (10 Mar 2010)

 

Israel supermarket uses parody film of Dubai assassins in advert (10 Mar 2010)

more »

 

Slashdot News for nerds, stuff that matters

 

"Mythical Man-Month" Supposedly Busted By MIT Startup (2010-03-11T01:15:00+00:00)

 

Zeus Botnet Dealt a Blow As ISPs Troyak, Group 3 Knocked Out (2010-03-10T23:59:00+00:00)

 

OnLive Remote Gaming Service Launches In June (2010-03-10T23:08:00+00:00)

 

Google Opens Apps Marketplace (2010-03-10T22:27:00+00:00)

 

Digitizing and Geocoding Old Maps? (2010-03-10T21:42:00+00:00)

 

Sweet, Sour, Salty, Bitter, Protein<nobr> <wbr></nobr>... and Now Fat (2010-03-10T21:21:00+00:00)

 

The Lost Film That Accompanied Empire Strikes Back (2010-03-10T21:00:00+00:00)

 

OpenSSH 5.4 Released (2010-03-10T20:40:00+00:00)

more »

 

TechPsychic Tech Rumors and Invented News

 

TechPsychic: Top paid for the FTSE 100, the future. (11 Mar 2010)

 

TechPsychic: Opera Software, Facebook During Apple's iPad Comes along, Windows Vista. (10 Mar 2010)

 

TechPsychic: JB: Why AT&T data plan? (10 Mar 2010)

 

TechPsychic: Apple announced on Twitter search web. (10 Mar 2010)

 

TechPsychic: Bing search, Intel, the end result of CEO of Vevo. (10 Mar 2010)

 

TechPsychic: Tumblr has a product releases was announced that it blows Mint's iPhone Apps. (10 Mar 2010)

 

TechPsychic: Can connect to launch a minor splash by venture market share among Opera Mini. (09 Mar 2010)

 

TechPsychic: Intel Goes to come With Facebook Matures, while. (09 Mar 2010)

more »

 

SF Gate

 

Constituents conflicted over gay legislator (2010-03-10T15:26:44UTC)

 

Oakland mom held in suffocation of girl, 2 (2010-03-10T16:50:00UTC)

 

Presented By: (10 Mar 2010)

 

Man found shot to death on Rodeo porch (2010-03-10T19:42:32UTC)

 

S.F. mayor seeks texting limit at city meetings (2010-03-10T16:34:33UTC)

 

Man, 33, shot to death on North Oakland street (2010-03-10T17:07:38UTC)

 

San Francisco supes vote to extend smoking ban (2010-03-10T14:36:16UTC)

 

Uncontrolled acceleration: Stopping runaway car (2010-03-10T13:44:08UTC)

 

Dollar mixed on economic reports, Chinese exports (2010-03-10T22:41:23UTC)

 

Derivatives debate splits US and Europe regulators (2010-03-10T22:41:22UTC)

 

MoDOT seeks to save over 5 years (2010-03-10T22:35:08UTC)

 

Nebraska upsets Missouri 75-60 in Big 12 (2010-03-10T22:34:05UTC)

 

Summary Box: Tropicana sizes, prices (2010-03-10T22:30:05UTC)

 

Summary Box: OnLive game streaming to come in June (2010-03-10T22:29:05UTC)

more »

 

Asia Times Online

 

China has a Congo copper headache (Wed 10 Mar 2010 19:00:00 +0700)

 

Beijing seeks a shift in geopolitics (Wed 10 Mar 2010 19:00:00 +0700)

 

Marjah fears return of warlords (Wed 10 Mar 2010 19:00:00 +0700)

 

Iran and Israel play cat and mouse (Wed 10 Mar 2010 19:00:00 +0700)

 

SINOGRAPH : Different takes on coping with change (Wed 10 Mar 2010 19:00:00 +0700)

 

A good bet on cash, tourists and crime (Wed 10 Mar 2010 19:00:00 +0700)

 

SPEAKING FREELY : Imam's ghost stalks Arab summit (Wed 10 Mar 2010 19:00:00 +0700)

 

Pakistan risks IMF's .2bn (Wed 10 Mar 2010 19:00:00 +0700)

 

End in sight for Bank Century circus (Wed 10 Mar 2010 19:00:00 +0700)

 

China assesses its gold strategy (Wed 10 Mar 2010 19:00:00 +0700)

 

No exit (Wed 10 Mar 2010 19:00:00 +0700)

 

THE MOGAMBO GURU : Inflation insurance (Wed 10 Mar 2010 19:00:00 +0700)

more »

 


Site feed Updated: 2010-Mar-11 00:15