
<div class="gbc-title-banner ta ta-lg ta-xl" style='background-color: #082d48ff; color: #ffffffff; border-radius: 0px; '>
    <div class="container" style='border-radius: 0px; '>
        <div class="row justify-content--center" style='color: #ffffffff;'>
            <div class="col-12"  >
                <div class="wrap pv-2 " style="0px">
                                <div class="col-12 col-md-12 col-lg-10 col-xl-8  banner-content"  >
    
                                             {"id":2884,"date":"2023-07-04T16:03:56","date_gmt":"2023-07-04T16:03:56","guid":{"rendered":"https:\/\/nag.com\/?post_type=case-studies&#038;p=2884"},"modified":"2023-07-04T16:03:57","modified_gmt":"2023-07-04T16:03:57","slug":"performance-improvements-on-suite-of-computational-chemistry-hpc-codes","status":"publish","type":"case-studies","link":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/","title":{"rendered":"Performance Improvements on Suite of Computational Chemistry HPC Codes"},"content":{"rendered":"<h1>\n<div class=\"gbc-title-banner ta ta-lg ta-xl\" style='border-radius: 0px; '>\n    <div class=\"container\" style='border-radius: 0px; '>\n        <div class=\"row justify-content--center\" >\n            <div class=\"col-12\"  >\n                <div class=\"wrap pv-4 \" style=\"0pxbackground-color: \">\n                                <div class=\"col-12 col-md-12 col-lg-12 col-xl-12  banner-content\"  >\n    \n                    \n                    <div class=\"mt-1 mb-1 content\"><\/div>\n\n                                             [button_shortcode]                    \n                                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\nPerformance Improvements on Suite of Computational Chemistry HPC Codes\n<div class=\"gbc-title-banner ta ta-lg ta-xl\" style='border-radius: 0px; '>\n    <div class=\"container\" style='border-radius: 0px; '>\n        <div class=\"row justify-content--center\" >\n            <div class=\"col-12\"  >\n                <div class=\"wrap pv-4 \" style=\"0pxbackground-color: \">\n                                <div class=\"col-12 col-md-12 col-lg-12 col-xl-12  banner-content\"  >\n    \n                    \n                    <div class=\"mt-1 mb-1 content\"><\/div>\n\n                                             [button_shortcode]                    \n                                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n<\/h1>                    \n                    <div class=\"mt-1 mb-1 content\"><p>Case Study<\/p>\n<\/div>\n\n                    \n                                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n\n<!-- Spacer -->\n<div class=\"pt-4 pt-lg-4 pt-xl-4\" ><\/div>\n\n<div class=\"container content-area-default \">\n    <div class=\"row justify-content--center\">\n        <div class=\"col-12 col-md-12 col-lg-10 col-xl-8\">\n            <h3 class=\"field field--name-field-paragraph-title field--type-string field--label-hidden field--item\">Project Background<\/h3>\n<div class=\"field field--name-field-paragraph-text field--type-text-long field--label-hidden field--item\">\n<div class=\"tex2jax_process\">\n<p>The\u00a0<a href=\"https:\/\/www.scm.com\/\" target=\"_blank\" rel=\"noopener\">ADF Modeling Suite<\/a>\u00a0is a powerful computational chemistry package produced by SCM (Software for Chemistry and Materials), a company based in the Netherlands. It tackles chemistry, materials science and engineering challenges and is comprised of six applications.<\/p>\n<p>We performed a broad investigation of the ADF Modeling Suite including assessing the performance of new functionality, locating and fixing bottlenecks and testing multiple approaches on three of the most widely used applications: ADF, BAND and DFTB. To analyse the performance of these applications, we used the tools\u00a0<a href=\"https:\/\/tools.bsc.es\/\" target=\"_blank\" rel=\"noopener\">Extrae, Paraver and Dimemas<\/a>\u00a0from Barcelona Supercomputing Center, along with\u00a0<a href=\"http:\/\/www.vi-hps.org\/projects\/score-p\/\" target=\"_blank\" rel=\"noopener\">Score-P<\/a>\u00a0and\u00a0<a href=\"http:\/\/www.scalasca.org\/\" target=\"_blank\" rel=\"noopener\">Scalasca.<\/a><\/p>\n<h3>ADF<\/h3>\n<p>ADF is a computational chemistry application which uses density functional theory calculations to predict the structure and reactivity of molecules. Sally Bridgwater, a Technical Consultant at <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG, assessed a particular calculation of interest to the developers which highlighted new functionality (medium-sized molecule with hybrid exchange-correlation functional). Initial investigations identified load imbalance as the main cause of inefficiency, resulting in idle time and the processors not being fully utilised. A secondary issue was the increase in time spent transferring data with increased core counts. ADF is parallelised with MPI and shared POSIX array buffers within a node. These shared buffers are not captured automatically by the profiling tools and so had to be manually instrumented using the Extrae API. The locking and unlocking of these shared arrays was found to exacerbate the load imbalance, leading to more idle time than initially thought.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2887 size-full\" src=\"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/adf1.jpg\" alt=\"\" width=\"780\" height=\"600\" \/><\/p>\n<h3>A factor of two improvement was achieved<\/h3>\n<p>The long waiting times<strong>\u00a0<\/strong>were found to be due to the load balancing algorithm not distributing work frequently enough and this was made worse by the imbalanced input used in this specific case. By distributing the work more frequently and tuning the chunk size of the work, Sally predicted that a factor of two saving in runtime could be achieved here. This gave SCM a clear idea of the potential improvement in performance.<\/p>\n<p>SCM adapted their load balancing scheme to provide work more frequently by using a dedicated process to manage load balance, as well as initially dividing the work up into smaller chunks. SCM made these changes quickly and the estimated improvement of a factor of two was achieved.<\/p>\n<p>Image: Timelines for the original (top) and version after improvements were made (bottom). This shows the large reduction in idle time (red) and halving of the total time taken.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2888 size-full\" src=\"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/adf2.jpg\" alt=\"\" width=\"780\" height=\"600\" \/><\/p>\n<p>Alexei Yakovlev, Software developer SCM, said:<\/p>\n<p><em>\u201cI can honestly say your analysis gave us a new insight into performance of one of the newer features available in ADF. What is more important, it clearly showed us the limitations of the current implementation and pointed us to the ways to improve it.\u201d<\/em><\/p>\n<h3 class=\"field field--name-field-paragraph-title field--type-string field--label-hidden field--item\">BAND<\/h3>\n<div class=\"field field--name-field-paragraph-text field--type-text-long field--label-hidden field--item\">\n<p><strong>The initial assessment<\/strong>\u00a0of the BAND application by Jonathan Boyle, HPC Application Analyst at <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG, found profiling difficult due to the long runtimes and large amount of data produced for a moderately sized system. Initial findings, however, showed that load balance was the main bottleneck and that this was exacerbated by poor computational scalability.<\/p>\n<p><strong>Two more detailed assessments investigated sub-components<\/strong>\u00a0of BAND. The first of these looked at computation of the overlap matrix. The performance observed ranged from reasonable to good, depending on the system being computed. Jonathan found that the main issue was reduced computational scaling, with contributions from low instructions scalability and IPC scalability. The routines responsible for the largest increases in exclusive time were identified for further investigation by the code developers.<\/p>\n<p><strong>The performance of the complex matrix-matrix multiplications<\/strong>\u00a0was the focus of the second assessment, where each complex matrix is held using two shared memory real arrays, which are replicated on each compute node. This was found to have significant room for improvement and so a Proof of Concept study followed on from this work. The main bottlenecks identified were a reduction in IPC at scale and an increasing amount of time spent in MPI data transfer. Most computational work is within a dgemm call and hence this became a target for optimisation.<\/p>\n<p><strong>The Proof of Concept work\u00a0<\/strong>that Jonathan implemented first tested out approaches to improve the performance and then implemented the ones that were beneficial in the source code.<\/p>\n<p>The optimisations that were implemented are:<\/p>\n<ul>\n<li>overlapping computation with communication<\/li>\n<li>improved use of BLAS, which doubled the speed of computation<\/li>\n<li>reorganising the algorithm to reduce the amount of data communicated via MPI.<\/li>\n<\/ul>\n<p><strong>The optimised subroutine showed four times speed up compared to the original code on eight 36-core compute nodes.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2889 size-full\" src=\"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/adf3.jpg\" alt=\"\" width=\"780\" height=\"600\" \/><\/p>\n<p class=\"para-sm\">Image:\u00a0Speedup plot showing the large improvement in scalability of the new subroutine.<\/p>\n<h3>DFTB<\/h3>\n<p>A case study of the work carried out on this application by Nick Dingle, Technical Consultant at <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG, can be read\u00a0<a href=\"https:\/\/www.nag.com\/content\/audit-density-functional-theory-application-suggested-potentially-improved-communications\">here<\/a>. <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG was chosen to perform the following work due to our involvement in the POP Project.<\/p>\n<\/div>\n<\/div>\n<\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n\n<div class=\"gbc-title-banner tac tac-lg tac-xl\" style='border-radius: 0px; '>\n    <div class=\"container\" style='border-radius: 0px; '>\n        <div class=\"row justify-content--center\" >\n            <div class=\"col-12\"  >\n                <div class=\"wrap pv-4 \" style=\"0pxbackground-color: \">\n                                <div class=\"col-12 col-md-12 col-lg-10 col-xl-8  banner-content\"  >\n    \n                    \n                    <div class=\"mt-1 mb-1 content\"><\/div>\n\n                    \n                    <a href='https:\/\/nag.com\/hpc-services\/' style='background-color: #63c0fdff; border-radius: 30px; font-weight: 600; ' class='btn mr-1  ' >HPC Services <i class='fas fa-angle-right'><\/i><\/a>                <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>We performed a broad investigation of the ADF Modeling Suite including assessing the performance of new functionality, locating and fixing bottlenecks and testing multiple approaches on three of the most widely used applications<\/p>\n","protected":false},"author":3,"featured_media":2893,"parent":0,"menu_order":0,"template":"","meta":{"content-type":"","footnotes":""},"post-tag":[43],"class_list":["post-2884","case-studies","type-case-studies","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Performance Improvements on Suite of Computational Chemistry HPC Codes - nAG<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Performance Improvements on Suite of Computational Chemistry HPC Codes - nAG\" \/>\n<meta property=\"og:description\" content=\"We performed a broad investigation of the ADF Modeling Suite including assessing the performance of new functionality, locating and fixing bottlenecks and testing multiple approaches on three of the most widely used applications\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/\" \/>\n<meta property=\"og:site_name\" content=\"nAG\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-04T16:03:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1000\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@NAGTalk\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/\",\"url\":\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/\",\"name\":\"Performance Improvements on Suite of Computational Chemistry HPC Codes - nAG\",\"isPartOf\":{\"@id\":\"https:\/\/nag.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg\",\"datePublished\":\"2023-07-04T16:03:56+00:00\",\"dateModified\":\"2023-07-04T16:03:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#primaryimage\",\"url\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg\",\"contentUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg\",\"width\":2000,\"height\":1000},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/nag.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Case Studies\",\"item\":\"https:\/\/nag.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Performance Improvements on Suite of Computational Chemistry HPC Codes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nag.com\/#website\",\"url\":\"https:\/\/nag.com\/\",\"name\":\"NAG\",\"description\":\"Robust, trusted numerical software and computational expertise.\",\"publisher\":{\"@id\":\"https:\/\/nag.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nag.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/nag.com\/#organization\",\"name\":\"Numerical Algorithms Group\",\"alternateName\":\"NAG\",\"url\":\"https:\/\/nag.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nag.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png\",\"contentUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png\",\"width\":1244,\"height\":397,\"caption\":\"Numerical Algorithms Group\"},\"image\":{\"@id\":\"https:\/\/nag.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/NAGTalk\",\"https:\/\/www.linkedin.com\/company\/nag\/\",\"https:\/\/www.youtube.com\/user\/NumericalAlgorithms\",\"https:\/\/github.com\/numericalalgorithmsgroup\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Performance Improvements on Suite of Computational Chemistry HPC Codes - nAG","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/","og_locale":"en_US","og_type":"article","og_title":"Performance Improvements on Suite of Computational Chemistry HPC Codes - nAG","og_description":"We performed a broad investigation of the ADF Modeling Suite including assessing the performance of new functionality, locating and fixing bottlenecks and testing multiple approaches on three of the most widely used applications","og_url":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/","og_site_name":"nAG","article_modified_time":"2023-07-04T16:03:57+00:00","og_image":[{"width":2000,"height":1000,"url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@NAGTalk","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/","url":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/","name":"Performance Improvements on Suite of Computational Chemistry HPC Codes - nAG","isPartOf":{"@id":"https:\/\/nag.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#primaryimage"},"image":{"@id":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#primaryimage"},"thumbnailUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg","datePublished":"2023-07-04T16:03:56+00:00","dateModified":"2023-07-04T16:03:57+00:00","breadcrumb":{"@id":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#primaryimage","url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg","contentUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/07\/iStock-1482882998.jpg","width":2000,"height":1000},{"@type":"BreadcrumbList","@id":"https:\/\/nag.com\/case-studies\/performance-improvements-on-suite-of-computational-chemistry-hpc-codes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nag.com\/"},{"@type":"ListItem","position":2,"name":"Case Studies","item":"https:\/\/nag.com\/case-studies\/"},{"@type":"ListItem","position":3,"name":"Performance Improvements on Suite of Computational Chemistry HPC Codes"}]},{"@type":"WebSite","@id":"https:\/\/nag.com\/#website","url":"https:\/\/nag.com\/","name":"NAG","description":"Robust, trusted numerical software and computational expertise.","publisher":{"@id":"https:\/\/nag.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nag.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nag.com\/#organization","name":"Numerical Algorithms Group","alternateName":"NAG","url":"https:\/\/nag.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nag.com\/#\/schema\/logo\/image\/","url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png","contentUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png","width":1244,"height":397,"caption":"Numerical Algorithms Group"},"image":{"@id":"https:\/\/nag.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/NAGTalk","https:\/\/www.linkedin.com\/company\/nag\/","https:\/\/www.youtube.com\/user\/NumericalAlgorithms","https:\/\/github.com\/numericalalgorithmsgroup"]}]}},"_links":{"self":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/case-studies\/2884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/case-studies"}],"about":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/types\/case-studies"}],"author":[{"embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":2,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/case-studies\/2884\/revisions"}],"predecessor-version":[{"id":2897,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/case-studies\/2884\/revisions\/2897"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/media\/2893"}],"wp:attachment":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/media?parent=2884"}],"wp:term":[{"taxonomy":"post-tag","embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/post-tag?post=2884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}