czar chasm
myrrh made
...
I need to think of more.
22 October 2008
14 October 2008
Trilinos on the mac
My configuration script for Trilinos on Mac OS X 10.5.5, for building without MPI:
I believe that the only software needed to get this to work is the gfortran compiler available at the mac High Performance Computing site.
I found that the with-ldflags line was necessary because otherwise the "pow" check would die from "Undefined symbols: "___gxx_personality_v0", referenced from: __gxx_personality_v0$non_lazy_ptr in ccJ9fzb2.o".
To get a trilinos-base program to compile, run g++ with the Apple compiler with options "-framework vecLib -I/usr/local/trilinos-8.0.8-serial/include -L/usr/local/trilinos-8.0.8-serial/" with the libraries (e.g. "-lepetra").
./configure \
--cache-file=config.cache \
--prefix=/usr/local/trilinos-8.0.8-serial \
CC=/usr/bin/gcc CXX=/usr/bin/g++ F77=/usr/local/bin/gfortran \
--with-libs="-framework vecLib" \
--with-ldflags="-Wl,-multiply_defined -Wl,suppress" \
--enable-amesos \
--enable-epetra \
--enable-anasazi \
--enable-aztecoo \
--enable-examples \
--enable-didasko \
--enable-teuchos \
--enable-triutils \
--enable-galeri
I believe that the only software needed to get this to work is the gfortran compiler available at the mac High Performance Computing site.
I found that the with-ldflags line was necessary because otherwise the "pow" check would die from "Undefined symbols: "___gxx_personality_v0", referenced from: __gxx_personality_v0$non_lazy_ptr in ccJ9fzb2.o".
To get a trilinos-base program to compile, run g++ with the Apple compiler with options "-framework vecLib -I/usr/local/trilinos-8.0.8-serial/include -L/usr/local/trilinos-8.0.8-serial/" with the libraries (e.g. "-lepetra").
08 October 2008
Word movement in terminal
This is a handy tip that I've wanted to do for months (since by default, on UNIX machines ctrl-left and ctrl-right move between words, but the mac terminal didn't).
Also, this inputrc modification (which makes the up arrow complete to the last occurrence of everything before the cursor) is even better than ctrl-r reverse search.
Also, this inputrc modification (which makes the up arrow complete to the last occurrence of everything before the cursor) is even better than ctrl-r reverse search.
30 September 2008
Publication-quality plots in MATLAB
I've done something similar (but much more simple), but this article has some interesting points. Now if only MathWorks would fix that stupid bug that showed up with the latest Java update.
Here's what I do: it scales the fonts and figures (using hgexport) and markers so that they show up as not to small a size when included as 3-inch figures, changes the font to Times, makes the minimum line width 0.5 points, exports to EPS, and uses the epstopdf tool to convert it to a pdf (since Matlab's pdf export is buggy and always puts the image on an 8.5 x 11 page). The results look consistent and very clean.
exportNiceFig.m
UPDATE 11/30/2008: I fixed the behavior of some of the resizing when there are multiple axes on a single figure.
UPDATE 01/21/2009: For future updates, see the projects page
Here's what I do: it scales the fonts and figures (using hgexport) and markers so that they show up as not to small a size when included as 3-inch figures, changes the font to Times, makes the minimum line width 0.5 points, exports to EPS, and uses the epstopdf tool to convert it to a pdf (since Matlab's pdf export is buggy and always puts the image on an 8.5 x 11 page). The results look consistent and very clean.
exportNiceFig.m
UPDATE 11/30/2008: I fixed the behavior of some of the resizing when there are multiple axes on a single figure.
UPDATE 01/21/2009: For future updates, see the projects page
24 September 2008
Random number generators
I spent a good deal of time today -- way more than I should have -- looking at random number generators, specifically the ones in Boost (which are aliased by its std::tr1 deal). It turns out, based on my limited testing, that they're incredibly slow. The Mersenne Twister here is up to five times as fast. If I ever write a real Monte Carlo program, I definitely won't want to make my program five times slower if I don't have to.
I also spent about an hour trying to find where in my header files I'd somehow done "using namespace std", or if I'd accidentally included a instead of a , because somehow sqrt and rand were in the global namespace. It turns out that gcc's implementation automatically makes all the math functions global. Boo.
I also spent about an hour trying to find where in my header files I'd somehow done "using namespace std", or if I'd accidentally included a
22 September 2008
What the functor?
Today I did the most advanced C++ programming that I've ever done. It's a recursively templated function that checks for soft equivalence of two doubles, or two vectors of doubles, or two vectors of vectors of doubles, or so on and so on.
This evening, I took that design and added functors to it, so that it can do any arbitrary comparison. I'd just read about them yesterday and gone, "Huh. What kind of weird application could those have?"
This evening, I took that design and added functors to it, so that it can do any arbitrary comparison. I'd just read about them yesterday and gone, "Huh. What kind of weird application could those have?"
10 September 2008
Pseudo-random
My professor on pseudo-random numbers in the context of Monte Carlo:
They look like random numbers, they smell like random numbers, and by God, we're going to treat them like random numbers.
23 July 2008
Fsssssss
I discovered this morning one great thing about sleeping on an inflatable air mattress. All I have to do to get myself to stay up when I wake up is to pull open the valve.
Now if only there were an alarm clock to do this...
Now if only there were an alarm clock to do this...
19 July 2008
Apricots
I picked one off of the tree in the yard here. It was tasty, but then an earwig fell out of it.
18 June 2008
Diffusion
Starting a month ago or so, I started writing up some notes on diffusion (specifically, its application in simplified form to the qualifying exam). The idea was that if I didn't pass, I would have a handy reference to help with re-learning diffusion. Anyway, I did pass, but I decided to finish it somewhat and make it available. It's meant for someone already familiar with reactor physics and diffusion, but it emphasizes some points that aren't that common, and it presents a good simplified summary of the one-speed homogeneous method. The content is all correct to the best of my knowledge, but caveat emptor.
Subscribe to:
Comments (Atom)