Category Archives: Computer Configurations

Wall Clock Time in Parallel Computing Cluster

If you’re trying to measure the wall clock time on a cluster, either use the library’s getwalltime function (as in OpenMP) or gettimeofday().
Never use clock() as it counts the number of clock cycles of the processors, and if you’re utilizing more than one processor, the number would accumulate and thus producing incorrect (overshoot) results.


Matplotlib on Mac OS 10.5 Leopard

I spent quite a long time trying to get Matplotlib to work, the problem was the dependencies. It somehow couldn’t find Freetype’s headerfiles. To make a long day short, I installed Macports and just to see that it could configures, builds and install packages automatically is such a timesaver and brainsaver. I thought about using Enthought Python Distro (EPD), but it would be an overkill for me, I just need to plot charts from Python scripts.

Using Macports does take away the ‘fun’ and the challenge on hacking Unix systems, but I’ve got studies to do, so I’ll save that for some time in the holidays.

Even after using Macports, it couldn’t find Matplotlib, turns out it was using the old python (2.5) instead of the new one (2.5.5). This happened even though I installed python_select as instructed. Turns out Macport installs to /opt/local/bin instead of the /usr/local, for reasons you could find on their website. Thus, I added /opt/local/bin to the environment variables path (I thought Macports did this already) by this command:

export PATH=$PATH:/opt/local/bin/

notice I put it last so that it would be in the first order. check with env.

Enjoy Matplotlib!

SSH X Window Forwarding

I was using Mac’s X11 terminal to run a GUI application remotely, when suddenly it gave the dreaded:
Tk initialization failed: no display name and no $DISPLAY environment variable.

Why? There’s no way my machine couldn’t handle X Window Forwarding.

Turns out to enable X Window Forwarding, you need to include the -X command line argument:
ssh -X you@server

This is like checking the enable X11 forwarding box in Putty.

Connect Samba Server of Linux/Ubuntu to Windows PC

My Samba server usually have trouble detecting Windows PCs on the network. Instead of restarting the Ubuntu to hard refresh the list, just enter the computer name manually:

smb://<insert computer name>/

No need to wait for a correct list to show up.