In this paper we investigate the effectiveness of functional language
features when writing
scientific codes. Our programs are written in the purely functional subset
of
Id and executed
on a one node Motorola Monsoon machine, and in Haskell and executed on
a Sparc 2.
In the application we study – the NAS FT benchmark, a three-dimensional
heat equation
solver – it is necessary to target and select one-dimensional sub-arrays
in three-dimensional
arrays. Furthermore, it is important to be able to share computation in
array
definitions. We
compare first order and higher order implementations of this benchmark.
The
higher order
version uses functions to select one-dimensional sub-arrays, or slices,
from a
three-dimensional
object, whereas the first order version creates copies to achieve the same
result. We compare
various representations of a three-dimensional object, and study the effect
of
strictness in
Haskell. We also study the performance of our codes when employing recursive
and iterative
implementations of the one-dimensional FFT, which forms the kernel of this
benchmark. It
turns out that these languages still have quite inefficient implementations,
with respect to
both space and time. For the largest problem we could run (323),
Haskell is 15 times slower
than Fortran and uses three times more space than is absolutely necessary,
whereas Id on
Monsoon uses nine times more cycles than Fortran on the MIPS R3000, and
uses
five times
more space than is absolutely necessary. This code, and others like it,
should
inspire compiler
writers to improve the performance of functional language implementations.
We propose a simple and efficient self-stabilizing distributed algorithm to construct the breadth first search (BFS) spanning tree of an arbitrary connected symmetric graph. We develop a completely new direct approach of graph theoretical reasoning to prove the correctness of our algorithm. The approach seems to have potential to have applications in proving correctness of other self-stabilizing algorithms for graph theoretical problems.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.