{"id":93983,"date":"2024-06-18T15:35:40","date_gmt":"2024-06-18T19:35:40","guid":{"rendered":"https:\/\/brocku.ca\/brock-news\/?p=93983"},"modified":"2024-06-18T16:41:50","modified_gmt":"2024-06-18T20:41:50","slug":"researchers-open-source-work-looks-to-accelerate-scientific-computing","status":"publish","type":"post","link":"https:\/\/brocku.ca\/brock-news\/2024\/06\/researchers-open-source-work-looks-to-accelerate-scientific-computing\/","title":{"rendered":"Researcher&#8217;s open-source work looks to accelerate scientific computing"},"content":{"rendered":"<p>A Brock University physicist has created a free open-source package, or collection of reusable programming components, that enables researchers to improve the performance of their scientific software.<\/p>\n<p>Assistant Professor of Physics Barak Shoshany says computers haven\u2019t been getting significantly faster in the last few decades. Instead, what makes it seem like they\u2019ve sped up is that they can do more things simultaneously.<\/p>\n<p>\u201cEarly computers could only execute tasks sequentially, one step at a time,\u201d he says. \u201cThey have since evolved to contain multiple processing units, or cores, which can execute tasks in parallel \u2014 one task per core.\u201d<\/p>\n<p>He says the number of cores can range from a few in budget home computers to hundreds of thousands in supercomputers, with more cores meaning faster performance.<\/p>\n<p>But programmers must write specialized code to take advantage of these multiple cores. Shoshany\u2019s recently published package allows programmers to do this quickly and easily using the programming language C++, which is commonly used in high-performance computing.<\/p>\n<p>In order for a program to be able to run on multiple cores in parallel, he says, it must spawn different threads of execution. A thread can be thought of as a separate sub-program that runs independently of the main program.<\/p>\n<p>\u201cThis functionality already exists in the C++ language but requires creating a new thread for each individual task \u2014 an inefficient and time-consuming process,\u201d says Shoshany.<\/p>\n<p>His package uses a thread pool to mitigate this issue. Instead of creating a new thread every time the program needs to execute a task, the program creates a pool of threads just once, typically one thread per core.<\/p>\n<p>The threads can then be \u201crecycled\u201d to execute multiple tasks, considerably increasing performance, he says.<\/p>\n<p>Using Shoshany\u2019s package, programmers can split calculations, simulations, data analysis and other scientific algorithms into individual tasks and submits these tasks to a queue. The thread pool package then handles the execution of the tasks in the individual threads in the most efficient way possible.<\/p>\n<p>\u201cWhen a thread finishes a task, the pool will automatically give the next task in the queue to that thread, so there is no wasted idle time,\u201d he says.<\/p>\n<p>While C++ thread pool packages have already been in use by the scientific community before, Shoshany\u2019s package uses modern programming practices that allow it to be easier to use and faster to run. It also comes with user-friendly instructions, including many examples.<\/p>\n<p>Details of Shoshany\u2019s thread pool software are explained in his paper \u201c<a href=\"https:\/\/www.sciencedirect.com\/science\/article\/pii\/S235271102400058X\" target=\"_blank\" rel=\"noopener\">A C++17 thread pool for high-performance scientific computing<\/a>,\u201d published in the May edition of the computer science journal <em>SoftwareX<\/em>.<\/p>\n<p>His <a href=\"https:\/\/github.com\/bshoshany\/thread-pool\" target=\"_blank\" rel=\"noopener\">thread pool package<\/a> is freely available on GitHub, a hosting service for open-source software, where Shoshany also provides ongoing user support. It has already been starred, or favourited, by 2,000 GitHub users.<\/p>\n<p>Shoshany says he makes all of his scientific papers, data and software freely available online in the interest of keeping science open.<\/p>\n<p>\u201cI enjoy seeing how scientists are making use of my C++ package to speed up their scientific software, and it feels good to know that I am doing my part to advance all fields of science \u2014 not just physics,\u201d he says.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Brock University physicist has created a free open-source package, or collection of reusable programming components, that enables researchers to improve the performance of their scientific software.<\/p>\n","protected":false},"author":20,"featured_media":93992,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[41,1,5],"tags":[11042,13664,13661,13662,567,389,348,11763,13665,6189,3325,353,13663],"_links":{"self":[{"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/posts\/93983"}],"collection":[{"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/comments?post=93983"}],"version-history":[{"count":10,"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/posts\/93983\/revisions"}],"predecessor-version":[{"id":94024,"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/posts\/93983\/revisions\/94024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/media\/93992"}],"wp:attachment":[{"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/media?parent=93983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/categories?post=93983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brocku.ca\/brock-news\/wp-json\/wp\/v2\/tags?post=93983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}