{"id":9637,"date":"2016-08-11T06:18:35","date_gmt":"2016-08-11T06:18:35","guid":{"rendered":"http:\/\/revoscience.com\/en\/?p=9637"},"modified":"2016-08-11T06:18:35","modified_gmt":"2016-08-11T06:18:35","slug":"user-friendly-language-for-programming-efficient-simulations","status":"publish","type":"post","link":"https:\/\/www.revoscience.com\/en\/user-friendly-language-for-programming-efficient-simulations\/","title":{"rendered":"User-friendly language for programming efficient simulations"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"color: #000000;\"><em><strong style=\"color: #222222;\">New language can speed up computer simulations 200-fold or reduce the code they require by 90 percent.<\/strong><\/em><\/span><\/p>\n<figure id=\"attachment_9638\" aria-describedby=\"caption-attachment-9638\" style=\"width: 639px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9638\" src=\"http:\/\/revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg\" alt=\"Simulations written in Simit, a new programming language, were dozens or even hundreds of times as fast as those written in existing simulation languages. But they required only one-tenth as much code as meticulously hand-optimized simulations that could achieve similar execution speeds. Image: MIT News\" width=\"639\" height=\"426\" title=\"\" srcset=\"https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg 639w, https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0-300x200.jpg 300w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" \/><\/a><figcaption id=\"caption-attachment-9638\" class=\"wp-caption-text\">Simulations written in Simit, a new programming language, were dozens or even hundreds of times as fast as those written in existing simulation languages. But they required only one-tenth as much code as meticulously hand-optimized simulations that could achieve similar execution speeds.<br \/>Image: MIT News<\/figcaption><\/figure>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\"><strong>CAMBRIDGE, Mass.<\/strong> &#8212;\u00a0Computer simulations of physical systems are common in science, engineering, and entertainment, but they use several different types of tools.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">If, say, you want to explore how a crack forms in an airplane wing, you need a very precise physical model of the crack\u2019s immediate vicinity. But if you want to simulate the flexion of an airplane wing under different flight conditions, it\u2019s more practical to use a simpler, higher-level description of the wing.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">If, however, you want to model the effects of wing flexion on the crack\u2019s propagation, or vice versa, you need to switch back and forth between these two levels of description, which is difficult not only for computer programmers but for computers, too.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">A team of researchers from MIT\u2019s Computer Science and Artificial Intelligence Laboratory, Adobe, the University of California at Berkeley, the University of Toronto, Texas A&amp;M, and the University of Texas have developed a new programming language that handles that switching automatically.<\/span><\/p>\n<p style=\"text-align: justify;\">[pullquote]Matrix manipulations are second nature to many scientists and engineers, and popular simulation software such as MatLab provides a vocabulary for describing them.[\/pullquote]<\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">In experiments, simulations written in the language were dozens or even hundreds of times as fast as those written in existing simulation languages. But they required only one-tenth as much code as meticulously hand-optimized simulations that could achieve similar execution speeds.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">\u201cThe story of this paper is that the trade-off between concise code and good performance is false,\u201d says Fredrik Kjolstad, an MIT graduate student in electrical engineering and computer science and first author on a new paper describing the language. \u201cIt\u2019s not necessary, at least for the problems that this applies to. But it applies to a large class of problems.\u201d<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">Indeed, Kjolstad says, the researchers\u2019 language has applications outside physical simulation, in machine learning, data analytics, optimization, and robotics, among other areas. Kjolstad and his colleagues have already used the language to implement a version of Google\u2019s original PageRank algorithm for ordering search results, and they\u2019re currently collaborating with researchers in MIT\u2019s Department of Physics on an application in quantum chromodynamics, a theory of the \u201cstrong force\u201d that holds atomic nuclei together.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">\u201cI think this is a language that is not just going to be for physical simulations for graphics people,\u201d says Saman Amarasinghe, Kjolstad\u2019s advisor and a professor of electrical engineering and computer science (EECS). \u201cI think it can do a lot of other things. So we are very optimistic about where it\u2019s going.\u201d<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">Kjolstad presented the paper in July at the Association for Computing Machinery\u2019s Siggraph conference, the major conference in computer graphics. His co-authors include Amarasinghe; Wojciech Matusik, an associate professor of EECS; and Gurtej Kanwar, who was an MIT undergraduate when the work was done but is now an MIT PhD student in physics.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\"><strong>Graphs vs. matrices<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">As Kjolstad explains, the distinction between the low-level and high-level descriptions of physical systems is more properly described as the distinction between descriptions that use graphs and descriptions that use linear algebra.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">In this context, a graph is a mathematical structure that consists of nodes, typically represented by circles, and edges, typically represented as line segments connecting the nodes. Edges and nodes can have data associated with them. In a physical simulation, that data might describe tiny triangles or tetrahedra that are stitched together to approximate the curvature of a smooth surface. Low-level simulation might require calculating the individual forces acting on, say, every edge and face of each tetrahedron.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">Linear algebra instead represents a physical system as a collection of points, which exert forces on each other. Those forces are described by a big grid of numbers, known as a matrix. Simulating the evolution of the system in time involves multiplying the matrix by other matrices, or by vectors, which are individual rows or columns of numbers.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">Matrix manipulations are second nature to many scientists and engineers, and popular simulation software such as MatLab provides a vocabulary for describing them. But using MatLab to produce graphical models requires special-purpose code that translates the forces acting on, say, individual tetrahedra into a matrix describing interactions between points. For every frame of a simulation, that code has to convert tetrahedra to points, perform matrix manipulations, then map the results back onto tetrahedra. This slows the simulation down drastically.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">So programmers who need to factor in graphical descriptions of physical systems will often write their own code from scratch. But manipulating data stored in graphs can be complicated, and tracking those manipulations requires much more code than matrix manipulation does. \u201cIt\u2019s not just that it\u2019s a lot of code,\u201d says Kjolstad. \u201cIt\u2019s also complicated code.\u201d<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\"><strong>Automatic translation<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">Kjolstad and his colleagues\u2019 language, which is called Simit, requires the programmer to describe the translation between the graphical description of a system and the matrix description. But thereafter, the programmer can use the language of linear algebra to program the simulation.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">During the simulation, however, Simit doesn\u2019t need to translate graphs into matrices and vice versa. Instead, it can translate instructions issued in the language of linear algebra into the language of graphs, preserving the runtime efficiency of hand-coded simulations.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">Unlike hand-coded simulations, however, programs written in Simit can run on either conventional microprocessors or on graphics processing units (GPUs), with no change to the underlying code. In the researchers\u2019 experiments, Simit code running on a GPU was between four and 20 times as fast as on a standard chip.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>New language can speed up computer simulations 200-fold or reduce the code they require by 90 percent.<\/p>\n","protected":false},"author":6,"featured_media":9638,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43,17],"tags":[],"class_list":["post-9637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-science","category-research"],"featured_image_urls":{"full":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"thumbnail":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0-150x150.jpg",150,150,true],"medium":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"large":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"1536x1536":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"2048x2048":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"ultp_layout_landscape_large":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"ultp_layout_landscape":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"ultp_layout_portrait":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",600,400,false],"ultp_layout_square":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",600,400,false],"newspaper-x-single-post":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"newspaper-x-recent-post-big":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",540,360,false],"newspaper-x-recent-post-list-image":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",95,63,false],"web-stories-poster-portrait":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",639,426,false],"web-stories-publisher-logo":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",96,64,false],"web-stories-thumbnail":["https:\/\/www.revoscience.com\/en\/wp-content\/uploads\/2016\/08\/MIT-Simulation-Language_0.jpg",150,100,false]},"author_info":{"info":["Amrita Tuladhar"]},"category_info":"<a href=\"https:\/\/www.revoscience.com\/en\/category\/computer-science\/\" rel=\"category tag\">Computer Science<\/a> <a href=\"https:\/\/www.revoscience.com\/en\/category\/news\/research\/\" rel=\"category tag\">Research<\/a>","tag_info":"Research","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/posts\/9637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/comments?post=9637"}],"version-history":[{"count":0,"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/posts\/9637\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/media\/9638"}],"wp:attachment":[{"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/media?parent=9637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/categories?post=9637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.revoscience.com\/en\/wp-json\/wp\/v2\/tags?post=9637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}