Category Archives: Tech

20″ iMac, Windows XP, and games

My 20″ 2.4GHz Core 2 Duo does a lot of things really well, especially now that it has 4GB of memory. I almost always have a Windows XP VMWare running in one of my Spaces windows (which is awesome, BTW). It runs compiles plenty fast, X-Plane runs like a champ, yadda yadda. However, I’ve had sub-par results with certain games when running Windows XP under boot camp — namely Starcraft and Microsoft Flight Simulator X. I’ve finally found a solution, and it wasn’t all that hard after some searching on Apple’s support forums.

With Starcraft, the problem is that the game is too old, really. It runs full screen 640×480 256 colors. The iMac runs 1680×1050 32-bit color. The drivers provided by Apple for the ATI Radeon HD 2600 don’t support 640×480 in any color depth or any resolution at 256 colors. I was able to kind of fix the problem by creating a hardware profile that disabled the Radeon video driver, falling back to the default VESA driver. But that rendered Windows pretty much useless for anything but Starcraft when booted in that profile.

With Flight Simulator, it just didn’t go fast enough. FS is pretty demanding on the card, particularly when flying a plane with a G1000. Frame rates would quickly drop below 15FPS, which is pretty much unflyable.

This discussion on Apple’s forum got me started down the path to upgrading the video drivers to ATI’s latest greatest. The drivers won’t install by default due to a weird part number on the iMac chips, but they will work. Here is a post with instructions on how to install the video driver. I’d recommend downloading the Catalyst Control Center package for the drivers, then follow his instructions. After the driver is loaded (and you’ve rebooted), go to C:\ATI\SUPPORT\\CCC and run the Setup application in there to install the Catalyst Control Center, which allows you to tweak various settings. One of the more important settings is in the monitor properties, where you can set the card to “Preserve Aspect Ratio”. Now, I get better frame rates in Flight Simulator, don’t have to do anything special to run Starcraft, and the aspect ratio for Starcraft is correct (I get black bars on the right/left of screen, but it’s better than everything being stretched). Much happier now — should have figured this out months ago.

Leopard Thoughts

I upgraded my iMac to 10.5 this weekend, since it arrived after Apple pulled the Boot Camp beta from their web page and one of the main reasons I bought an iMac instead of a Mac Mini was so that I could use MS Flight Simulator running in Windows. My initial thoughts on the newest release are a mixed bag.

The good:

  • Spotlight seems to scale much better. I initially loved Spotlight on 10.4, but once it indexed my entire mail archives, it got too slow to be useable. The new spotlight appears to have indexed all my mail and is still snappy quick. I had let it archive my inbox and played around prior to upgraded, just to make sure that it wasn’t just the jump from the Power Book to the iMac.
  • Spaces works almost as expected. It’s very nice, but will jump to dialog boxes that pop up, which is a bit annoying.
  • Carbon emacs, Quicken, Log Ten Pro (my pilot logbook software), and X-Plane all seem to work out of the box.
  • System Preferences sanity — no more secondary, semi-duplicate applications for printing or vpn/wireless. Everything is ordered in a much more sane way.
  • X11 integration. DISPLAY is now automagically set and when X11 is needed (such as you starting an xterm), X11 automagically starts. This even works when you start an xterm/emacs on a remote machine using ssh tunnels.

The bad:

  • Translucent menus. The menubar isn’t too bad, but the menus themselves are hard to read if you have too many windows open and things are busy on the screen.
  • The 3-D dock. It’s ugly. Thankfully, it can be turned off: defaults write com.apple.dock no-glass -boolean YES killall Dock
  • X11. They don’t document that you shouldn’t start X11.app at login like you used to do in Tiger. They also don’t document that /Applications/Utilities/X11.app is essentially just an xterm starter and not the “real” X11.app that launchd starts when needed. X11 doesn’t play well with spaces. I also like having the X11 icon next to the Finder icon in my dock (dunno why, but it’s always there on my machines). I couldn’t figure out how to make that happen, but finally did — Add /usr/X11/X11.app to your Dock. Don’t have it started at login. It’ll all work out. There’s some other oddities with X11 — it appears that the upgrade from XFree to X.org codebase was not as smooth as it could have been, but sounds like Apple’s working on it.
  • Bloody linker. The Open MPI configure script causes the linker to bus error during the assembly tests if -g is used as a CFLAG. Stupid linkers.
  • iCal/iSync. I can’t seem to get iSync to sync my calendars between a machine running tiger and a machine running leopard. iSync seemed to have synced everything else quite well.

Error message

An error message I stumbled upon recently is below. Glad I don’t work for the company that shocks developers when the code breaks :).

Something’s Wrong.

The web page you requested was not generated correctly.

Pertinent diagnostic information has been sent to Quality Control at
webmaster@aeroplanner.com.
A moderate electric shock has been sent to the chair of the responsible developer.

The problem may be temporary, so please wait a moment and hit the Refresh button on your browser.
You may get the page you were seeking. If not – try going back on your browser and try the operation again, or press refresh.
At worst you’ll get to shock a software developer.

Apologies from AeroPlanner.com.

Send e-mail to the above address if you want to be notified when the problem is solved.

Open MPI and Debian

Branden sent me a link from Planet Debian where one of the Debian developers talks about improving the packaging for Open MPI in Debian. Nice to see people outside the core development community get excited about Open MPI.

Now if only we could get people to spell it Open MPI instead of OpenMPI 😉

Open MPI in Mac OS X!

http://www.apple.com/macosx/leopard/technology/multicore.html
Apple finally announced that Mac OS X 10.5 (Leopard) will include Open MPI as part of its developer tools. The discussion to make this happen started over 18 months ago, and it’s great to finally see it announced. I’ve been working on this for a long time and it looks like we’re finally there. Woo hoo!

Sun’s working on adding some DTrace hooks into Open MPI for tracking things like message arrival and the like. Won’t make it into 1.2, but should be nice once they’re in, especially considering the announced support for DTrace on Leopard.

Happiness on the Open MPI front!

Quickies

  • Bought some fun stuff recently:
    • An ICOM IC-A24 handheld nav/com aviation radio. Nice backup to have on long cross-countries, and even on local flights, since Albuquerque International (Class C), Santa Fe (Class D) and Los Alamos (special restrictions) all require a radio to enter their airspace. And with Double Eagle II about to go Class D, a radio out would mean either waving at the tower in one of the Deltas to get lights or going to Belen. Neither are fun when you just want to land. Most of the radio was paid for from gift certificates Mom and Dad gave me for Christmas and my B-Day. Thanks Mom and Dad!
    • A fryer. Somehow it’s Pete’s fault, but it seemed like it would be fun to have and was only $20.00 at Target.
    • One Six Right, in principle a movie about the history of Van Nuys Airport (KVNY) but is just as much about the history of General Aviation in the United States. There’s a lot of beautiful birds in the movie, and it is extraordinarily well done.
  • My car went in for its 60,000 mile service today, as well as a new set of tires. She’s apparently aging well and there’s nothing big that needs to be done in the near future. Woo! We’ll ignore the 60,000 mile service waited until 65,000 miles on the car. Wow, almost 5 years and over 65,000 miles. Doesn’t seem like it’s been that long!
  • Weather has been sucking lately. We didn’t get to fly up once this week and it looks like next week is going to be just as bad. Hopefully we’ll catch up on some squawks while we can’t fly.
  • FInally getting around to some much needed web server maintenance on marvin, the server that hosts bbarrett.org. Trying to setup some of the services like bug tracking that worked at one time or another…

Friday night update

So it’s Friday night, it’s been 6 weeks and 2 days since my last update. Which is a bit pathetic, but I’m sure that everyone will survive without too much difficultly. Anyway, since I don’t remember most of what has happened, we’re going for list format.

  • I now have 99.5 hours of flying time (so close, yet so not 100 hours), including a bunch of flights since my last update:
    • A flight with Branden and Kyle to Taos and back in N80790 just to fly around and log me some cross country time. Branden took some pictures
    • A flight with Laura in early December to Taos for lunch (yummy Mexican) and log me some cross country time. There was still snow on the north sides of the slopes from the November snow storm, so it was really pretty.
    • A bunch of test flights in N813T, Galen’s plane. It’s a blast to fly — very responsive and very quick. The most fun I’ve ever had while flying.
    • A long (~300 nautical mile) cross country flight around Colorado in N813T, solo because it was a test flight. The entire flight was only about 2 hours, since the plane is so fast.
  • Arun, Shelece and I drove down to White Sands in December in hope that Discovery was going to land there (it was looking promising). Just as we arrived at White Sands National Monument, it was announced they were going to land at Kennedy. Good for the NASA budget, not so fun for us. But we did get to run around White Sands, which was fun. We stopped for lunch at a place along the way Arun and Shelece had read about and had one of the best green chili cheeseburgers I’ve ever eaten. Fun trip, but would have been better if there was a shuttle landing overhead.
  • I went home for Christmas break, just barely escaping the giant snow storm in Denver to get to Chicago. Getting home was delayed by yet another snow storm in Denver, but it wasn’t too bad. Just had to spend a boring New Years in South Bend. We spent Christmas afternoon in Detroit, and got to see the Barrett clan, which is always fun. Also got to see Anne while we were in Grand Rapids visiting Cathy and Dan.
  • Rich Graham (the group/team/project leader I was working for) announced that was leaving LANL for Oak Ridge. Adolfy Hoisie took over the group effective January 8th. While a bit scary for a while due to the uncertainty of change, the change should work out pretty well for Galen and I. We’ve been able to re-align what we’re working on to more match our interests (and for me, my thesis work), so that’s happy.
  • I discovered that Pete is still updating his log, so now I have another log to read when I’m wasting time. Yay Pete.
  • It’s ski season! Mary took my skis from B’ton to South Bend and I brought them back from Christmas break with me. Went skiing last Sunday at Ski Santa Fe, which is about an hour drive from my apartment in Los Alamos. My legs remembered what to do much quicker than I expected. Snow wasn’t great, but I won’t complain for such a short drive.
  • I’ve been working with Galen on getting Open MPI to operate properly on heterogeneous environments, particularly using OpenIB between Linux boxes running PowerPC and Opteron processors. This was mostly motivated by the Road Runner machine purchased by Los Alamos, which is a combination of Opteron and Cell blades, likely connected with InfiniBand. It’s been a month long process, with lots of code audits about padding, alignment, and endian swapping. I’ll write a post about the gory details really soon.
  • On Friday, January 19th, I’m moving to Albuquerque. My stuff should show up from Bloomington a week or two after that. I’ll be commuting up to Los Alamos every day in N813T. Woo. One thing this means is more compute time. Another is that I can finally get high speed internet. Working at home with dialup has been interesting and I think I’ve adopted pretty well, but I can’t wait to be able to download stuff *now*, rather than while I sleep.
  • Thesis proposal is going entirely too slowly, but I’m still working on it. Hopefully get the proposal scheduled next week, for sometime in early March. Depends on how travel falls out.

{C++, Objective C, Fortran 77, Fortran} link compatibility with C

A not-unfrequent problem we have with Open MPI is users specifying incompatible compiler flags for the different languages used in Open MPI. This frequently occurs when a user wants to build 64-bit on a system that defaults to 32-bit and provides the right CFLAGS, but skips one of the FFLAGS, FCFLAGS, CXXFLAGS, or OBJCFLAGS. If you’re lucky, you’ll get an amorphous error during configure time saying something completely unrelated to the original problem went wrong. If you’re unlucky, nothing bad will happen until you try to link ompi_info, which is one of the last things that gets built.

I wrote a macro for Open MPI today that tries to link a small C function in a .o file with a main function in either Fortran (either 90 or 77) or one of the C-like languages (C++ / Objective C) to see if they link. The result is not pretty, and I’m hoping there’s a better way to do this, but this is what I came up with (below). The only part I’m really not happy with is all the code to deal with the Fortran calling. I’m sure there’s a better way than defining a particular m4 variable then looking at that for the rest of the function. But such is life…

dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2006      Los Alamos National Security, LLC.  All rights
dnl                         reserved. 
dnl $COPYRIGHT$
dnl 
dnl Additional copyrights may follow
dnl 
dnl $HEADER$
dnl

# OMPI_LANG_LINK_WITH_C(language)
# -------------------------------
# Try to link a small test program against a C object file to make
# sure the compiler for the given language is compatible with the C
# compiler.
AC_DEFUN([OMPI_LANG_LINK_WITH_C], [
  AS_VAR_PUSHDEF([lang_var], [ompi_cv_c_link_$1])

  AC_CACHE_CHECK([if C and $1 are link compatible],
    lang_var,
    [m4_if([$1], [Fortran], 
       [m4_define([ompi_lang_link_with_c_fortran], 1)],
       [m4_if([$1], [Fortran 77],
          [m4_define([ompi_lang_link_with_c_fortran], 1)],
          [m4_define([ompi_lang_link_with_c_fortran], 0)])])
     m4_if(ompi_lang_link_with_c_fortran, 1,
       [OMPI_F77_MAKE_C_FUNCTION([testfunc_name], [testfunc])],
       [testfunc_name="testfunc"])

     # Write out C part
     AC_LANG_PUSH(C)
     rm -f conftest_c.$ac_ext
      cat > conftest_c.$ac_ext << EOF
int $testfunc_name(int a);
int $testfunc_name(int a) { return a; }
EOF

     # Now compile both parts
     OMPI_LOG_COMMAND([$CC -c $CFLAGS $CPPFLAGS conftest_c.$ac_ext],
       [AC_LANG_PUSH($1)
        ompi_lang_link_with_c_libs="$LIBS"
        LIBS="conftest_c.o $LIBS"
        ompi_lang_link_with_c_fortran
        m4_if(ompi_lang_link_with_c_fortran, 1, 
          [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
       external testfunc
       call testfunc(1)
])],
             [AS_VAR_SET(lang_var, ["yes"])], [AS_VAR_SET(lang_var, ["no"])])],
          [AC_LINK_IFELSE([AC_LANG_PROGRAM([
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" int testfunc(int);
#else
extern int testfunc(int);
#endif
], 
             [return testfunc(0);])],
             [AS_VAR_SET(lang_var, ["yes"])], [AS_VAR_SET(lang_var, ["no"])])])
        LIBS="$ompi_lang_link_with_c_libs"
        AC_LANG_POP($1)],
       [AS_VAR_SET(lang_var, ["no"])])
     rm -f conftest_c.$ac_ext
     AC_LANG_POP(C)])

  AS_IF([test "AS_VAR_GET([lang_var])" = "yes"], [$2], [$3])
  AS_VAR_POPDEF([lang_var])dnl
])

AC and AM version numbers

I ran into a problem with Open MPI’s build system today and have come up with a reasonable, but sub-optimal solution. The basics of the problem are that we need to support both the combinations of Autoconf 2.59/Automake 1.9.6 and Autoconf 2.60+/Automake 1.10+ in a project using Objective C (only for a very small, optional component). AC 2.59/AM 1.9.6 have basically zero support for Objective C, but AC 2.60+/AM 1.10 have full support for Objective C. I had back-ported in a bunch of macros to get the bare minimum support we needed for Objective C with AC 2.59, but that all conflicted with AC 2.60, so needed to be optionally provided. So there were two problems:

  • How to determine whether to provide compatibility AC_PROG_OBJC or use AC’s macro
  • How to prevent using AC 2.60 with AM 1.9.6

The problem with the first one is that looking at AC_PROG_OBJC seemed to cause all kinds of entertaining things to happen with AC 2.60. So the solution there was to peek at the internal structures for AC and get the version number, then act accordingly. After figuring out all the macros I needed to provide, this worked reasonably well. Look at config/ompi_objc.m4 to see which ones we ended up needing.

Automake doesn’t seem to provide an internal macro with its version number, so I couldn’t do the obvious to find the version number and do all the logic to make sure we never see AC 2.60 used with AM 1.9.6 (which would give us half support for Objective C and be a major pain). So the best I could come up with was to use the version requirement checking feature of AM_INIT_AUTOMAKE:

m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [2.60]), -1,
  [AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define])],
  [AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define 1.10])])

It’s really vile, but it does work…