[mesa-users] DIRect: global optimization for noisy problems
Warrick Ball
wball at astro.physik.uni-goettingen.de
Wed Sep 17 09:55:23 EDT 2014
Fellow MESAlians,
I'm looking for a small amount of input before I potentially press on
myself. Super low urgency, since it's a side project. Heck, more of a
curiosity than even a project!
While waiting for our computing clusters to do my bidding, I stumbled onto
a description of the DIRect algorithm for global search and optimization.
Various snippets of code and documentation are available at
http://www4.ncsu.edu/~ctk/Finkel_Direct/
and in the attached PDF. In short, the algorithm starts with the corners
of a hypercube in parameter space, then selectively cuts the cube into
smaller (hyper)rectangles, evaluating the new corners at each iteration.
The details are in how the algorithm decides to slice up parameter space.
I downloaded the FORTRAN code [1], and it looks like between DIRect.f,
DIRsubrout.f and DIRserial.f, the subroutine Direct() can stand alone and
work work as a drop in replacement for the downhill simplex already in
MESA.
However, naively compiling DIRect in didn't work. I cloned the do_simplex
routine in run_star_extras_astero.f and replaced the simplex call with
Direct(), but I can't get it to compile, let alone run. In the makefile,
I added references to either DIRect's location with -I, or added the
source files explicitly to the compile command for run_star_extras_astero.
I either get a bazillion syntax errors (when I point directly to the
source), or something like:
run_star_extras_astero.o: In function
`__run_star_extras_astero_MOD_do_direct':
run_star_extras_astero.f:(.text+0x7789): undefined reference to `direct_'
collect2: error: ld returned 1 exit status
make: *** [star] Error 1
FAILED
when I used -I to point to where the pre-compiled binaries (e.g. gfortran
-c DIRect.f) are hiding. The latter error makes me think that it's not
seeing the subroutines in there at all.
I'm not sure if part of the problem is that DIRect seems to be FORTRAN 77,
including perennial favourites such as GOTO and COMMON blocks. But before
I spend free time transcribing it into a new module, I thought I'd ask if
there's an easier way. I was under the impression that FORTRAN was
generally backwards-compatible, but maybe it doesn't mix well?
Cheers,
Warrick
[1] http://www4.ncsu.edu/~ctk/SOFTWARE/DIRECTv204.tar.gz
PS: I also tried to make sense of how ADIPLS, which is also in F77, is
compiled into a MESA-friendly form, but I haven't pieced it together yet.
------------
Warrick Ball
Postdoc, Institut für Astrophysik Göttingen
wball at astro.physik.uni-goettingen.de
+49 (0) 551 39 5069
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DirectUserGuide_pdf.pdf
Type: application/pdf
Size: 499301 bytes
Desc:
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20140917/cd9b474d/attachment.pdf>
More information about the Mesa-users
mailing list