Akimasa Morihata
Tohoku University
Network
Latest external collaboration on country level. Dive into details by clicking on the dots.
Publication
Featured researches published by Akimasa Morihata.
programming language design and implementation | 2007
Kazutaka Morita; Akimasa Morihata; Kiminori Matsuzaki; Zhenjiang Hu; Masato Takeichi
Divide-and-conquer algorithms are suitable for modern parallel machines, tending to have large amounts of inherent parallelism and working well with caches and deep memory hierarchies. Among others, list homomorphisms are a class of recursive functions on lists, which match very well with the divide-and-conquer paradigm. However, direct programming with list homomorphisms is a challenge for many programmers. In this paper, we propose and implement a novel systemthat can automatically derive cost-optimal list homomorphisms from a pair of sequential programs, based on the third homomorphism theorem. Our idea is to reduce extraction of list homomorphisms to derivation of weak right inverses. We show that a weak right inverse always exists and can be automatically generated from a wide class of sequential programs. We demonstrate our system with several nontrivial examples, including the maximum prefix sum problem, the prefix sum computation, the maximum segment sum problem, and the line-of-sight problem. The experimental results show practical efficiency of our automatic parallelization algorithm and good speedups of the generated parallel programs.
symposium on principles of programming languages | 2009
Akimasa Morihata; Kiminori Matsuzaki; Zhenjiang Hu; Masato Takeichi
Parallel programs on lists have been intensively studied. It is well known that associativity provides a good characterization for divide-and-conquer parallel programs. In particular, the third homomorphism theorem is not only useful for systematic development of parallel programs on lists, but it is also suitable for automatic parallelization. The theorem states that if two sequential programs iterate the same list leftward and rightward, respectively, and compute the same value, then there exists a divide-and-conquer parallel program that computes the same value as the sequential programs. While there have been many studies on lists, few have been done for characterizing and developing of parallel programs on trees. Naive divide-and-conquer programs, which divide a tree at the root and compute independent subtrees in parallel, take time that is proportional to the height of the input tree and have poor scalability with respect to the number of processors when the input tree is ill-balanced. In this paper, we develop a method for systematically constructing scalable divide-and-conquer parallel programs on trees, in which two sequential programs lead to a scalable divide-andconquer parallel program. We focus on paths instead of trees so as to utilize rich results on lists and demonstrate that associativity provides good characterization for scalable divide-and-conquer parallel programs on trees. Moreover, we generalize the third homomorphism theorem from lists to trees.We demonstrate the effectiveness of our method with various examples. Our results, being generalizations of known results for lists, are generic in the sense that they work well for all polynomial data structures.
international symposium on functional and logic programming | 2010
Akimasa Morihata; Kiminori Matsuzaki
Although the recent popularity of parallel-computing environments has called for parallel programs, it is difficult for nonspecialists to develop those that are efficient. What is required are parallelization methods that can automatically generate efficient parallel programs from sequential ones. In this paper, we propose an automatic method of parallelization for recursive functions. The key is a quantifier-elimination-based derivation of an operator that shrinks function closures representing partial computations. Once we obtain such an operator, we can split the input structure and perform computation on each part in parallel. Our method has several features: it does not require any human help, it guarantees computational efficiency of generated programs, and it deals with complicated recursive functions such as those that are nonlinear recursive, non-self recursive, and accumulative.
international conference on conceptual structures | 2011
Akimasa Morihata; Kiminori Matsuzaki
Abstract Algorithmic skeletons are ready-made parallel computation patterns. Since each skeleton can be evaluated efficiently on parallel computation environments, we can develop effcient parallel programs only by specifying our computation by a combination of skeletons. Although effectiveness of algorithmic skeletons, especially those manipulating arrays and lists, is now well-recognized, those for trees of unbounded degree have not been firmly established. Most of the existing studies transform them to binary trees through preprocessing. But this approach is not practical. The transformation not only makes developments of parallel programs diffcult but also affects the performance of the parallel programs developed. In this paper, we propose a parallel tree contraction algorithm named Rake-Shunt contraction algorithm. It is generalization of the Shunt contraction algorithm, which has been used as the algorithmic basis of the binary-tree skeletons, and inherits several good properties such as scalability with respect to the number of processors and simplicity of the implementation. Moreover, it can deal with arbitrary trees and requires no modification of their shapes. Our preliminary experiments show that our algorithm leads to an implementation of the tree reduction, one of the most important tree skeletons, that is easier to use and more effcient than the previous method based on the transformation to binary trees.
international conference on functional programming | 2016
Kento Emoto; Kiminori Matsuzaki; Zhenjiang Hu; Akimasa Morihata; Hideya Iwasaki
The vertex-centric programming model, known as “think like a vertex”, is being used more and more to support various big graph processing methods through iterative supersteps that execute in parallel a user-defined vertex program over each vertex of a graph. However, the imperative and message-passing style of existing systems makes defining a vertex program unintuitive. In this paper, we show that one can benefit more from “Thinking like a vertex” by “Behaving like a function” rather than “Acting like a procedure” with full use of side effects and explicit control of message passing, state, and termination. We propose a functional approach to vertex-centric graph processing in which the computation at every vertex is abstracted as a higher-order function and present Fregel, a new domain-specific language. Fregel has clear functional semantics, supports declarative description of vertex computation, and can be automatically translated into Pregel, an emerging imperative-style distributed graph processing framework, and thereby achieve promising performance. Experimental results for several typical examples show the promise of this functional approach.
asian symposium on programming languages and systems | 2014
Katsuhiro Ueno; Yutaka Fukasawa; Akimasa Morihata; Atsushi Ohori
Ruby is a dynamic, object-oriented language with advanced features such as yield operator and dynamic class manipulation. They make Ruby a popular, highly productive scripting language, but they also make the semantics of Ruby complicated and difficult to understand. Even the JIS/ISO standard of Ruby seems to contain some ambiguities. For Ruby to be established as a reliable scripting language, it should have a rigorous semantics. To meet this challenge, we present a formal operational semantics that can serve as a high-level specification for both the users and implementers. The key insight underlying the semantics is that various elaborate features of Ruby can be cleanly represented as a composition of two orthogonal calculi: one for objects and classes and the other for representing control. The presented semantics leads straightforwardly to a reference implementation. Initial evaluation of our implementation confirms that the presented semantics conforms to commonly accepted Ruby behavior.
workshop on generic programming | 2010
Shin-Cheng Mu; Yu-Han Lyu; Akimasa Morihata
The fully polynomial-time approximation scheme (FPTAS) is a class of approximation algorithms that is able to deliver an approximate solution within any chosen ratio in polynomial time. By generalising Bird and de Moors Thinning Theorem to a property between three orderings, we come up with a datatype-generic strategy for constructing fold-based FPTASs. Greedy, thinning, and approximation algorithms can thus be seen as a series of generalisations. Components needed in constructing an FPTAS are often natural extensions of those in the thinning algorithm. Design of complex FPTASs is thus made easier, and some of the resulting algorithms turn out to be simpler than those in previous works.
international conference on functional programming | 2008
Akimasa Morihata; Kiminori Matsuzaki; Masato Takeichi
Optimal path queries are queries to obtain an optimal path specified by a given criterion of optimality. There have been many studies to give efficient algorithms for classes of optimal path problem. In this paper, we propose a generic framework for optimal path queries. We offer a domain-specific language to describe optimal path queries, together with an algorithm to find an optimal path specified in our language. One of the most distinct features of our framework is the use of recursive functions to specify queries. Recursive functions reinforce expressiveness of our language so that we can describe many problems including known ones; thus, we need not learn existing results. Moreover, we can derive an efficient querying algorithm from the description of a query written in recursive functions. Our algorithm is a generalization of existing algorithms, and answers a query in O(n log n) time on a graph of O(n) size. We also explain our implementation of an optimal path querying system, and report some experimental results.
international symposium on functional and logic programming | 2016
Akimasa Morihata
Incremental computing is a method of keeping consistency between an input and an output. If only a small portion of the input is modified, it is natural to expect that the corresponding output can be obtained more efficiently than full re-computation. However, for abstract data structures such as self-balancing binary search trees, even the most primitive modifications may lead to drastic change of the underlying structure. In this paper, we develop an incremental computing method, which can deal with complex modifications and therefore is suitable for abstract data structures. The key idea is to use shortcut fusion in order to decompose a complex modification to a series of simple ones. Based on this idea, we extend Jeuring’s incremental computing method, which can deal with algebraic data structures, so as to deal with abstract data structures. Our method is purely functional and does not rely on any run-time support. Its correctness is straightforward from parametricity. Moreover, its cost is often proportional to that of the corresponding modification.
Science of Computer Programming | 2015
Shin-Cheng Mu; Yu-Han Lyu; Akimasa Morihata
The fully polynomial-time approximation scheme (FPTAS) is a class of approximation algorithms for optimisation problems that is able to deliver an approximate solution within any chosen ratio in polynomial time. By generalising Bird and de Moors Thinning Theorem to a property between three orderings, we come up with a datatype-generic strategy for constructing fold-based FPTASs. Greedy, thinning, and approximation algorithms can thus be seen as a series of generalisations. Components needed in constructing an FPTAS are often natural extensions of those in the thinning algorithm. Design of complex FPTASs is thus made easier, and some of the resulting algorithms turn out to be simpler than those in previous works.