【计算框架】协程库Argobots

这篇具有很好参考价值的文章主要介绍了【计算框架】协程库Argobots。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Paper: argobots


Argobots: A Lightweight Low-Level Threading and Tasking Framework Library

argobots,编程语言--C++,系统层--操作系统linux,c语言,云计算

SM1 in ES1 has one associated private pool, PM11, and SM2 in ES2 has two private pools, PM21 and PM22.

PS is shared between ES1 and ES2, and thus both SM1 in ES1 and SM2 in ES2 can access the pool to push or pop work units.

PE denotes an event pool. The event pool is meant for lightweight notification. It is periodically checked by a scheduler to handle the arrival of events (e.g., messages from the network).

S1 and S2 in PM11 are stacked schedulers that will be executed by the main scheduler SM1.

Execution Model
  • An ES maps to one OS thread, is explicitly created by the user, and executes independently of other ESs.
  • A work unit is a lightweight execution unit, a ULT or a tasklet, that runs within an ES.
  • Each ES is associated with its own scheduler that is in charge of scheduling work units according to its scheduling policy
  • A ULT has its own stack region, whereas a tasklet borrows the stack of its host ES’s scheduler
  • A ULT is an independent execution unit in user space and provides standard thread semantics at a low context-switching cost.
  • ULTs are suitable for expressing parallelism in terms of persistent contexts whose flow of control can be paused and resumed
  • Tasklets do not yield control and run to completion before returning control to the scheduler that invoked them. tasklets are used for atomic work without suspending
Scheduler
  • Argobots provides an infrastructure for stackable or nested schedulers, with pluggable scheduling policies
  • Plugging in custom policies enables higher levels of the software stack to use their special policies while Argobots handles the lowlevel scheduling mechanisms.
  • stacking schedulers empowers the user to switch schedulers when multiple software modules or programming models interact in an application. 例如,当应用程序执行具有自己的调度程序的外部库时,它会暂停当前调度程序并调用该库的调度程序。
Primitive Operations
  • Creation. When ULTs or tasklets are created, they are inserted into a specific pool in a ready state. Thus, they will be scheduled by the scheduler associated with the target pool and executed in the ES associated with the scheduler. If the pool is shared with more than one scheduler and the schedulers run in different ESs, the work units may be scheduled in any of the ESs.
  • Join: Work units can be joined by other ULTs. When a work unit is joined, it is guaranteed to have terminated.
  • Yield. When a ULT yields control(让出控制权), the control goes to the scheduler that was in charge of scheduling in the ES at the point of yield time. The target scheduler schedules the next work unit according to its scheduling policy.
  • Yield to. When a ULT calls yield to, it yields control to a specific ULT instead of the scheduler. Yield to is cheaper than yield because it bypasses the scheduler and eliminates the overhead of one context switch. Yield to can be used only among ULTs associated with the same ES.
  • Migration. Work units can be migrated between pools.
  • Synchronizations. Mutex, condition variable, future, and barrier operations are supported, but only for ULTs.
Implementation
  • An ES is mapped to a Pthread and can be bound to a hardware processing element (e.g., CPU core or hardware thread).
  • Context switching between ULTs can be achieved through various methods, such as ucontext, setjmp/longjmp with sigaltstack [21], or Boost library’s fcontext [22].
  • The user context includes CPU registers, a stack pointer, and an instruction pointer.
  • When a ULT is created, we create a ULT context that contains a user context, a stack, the information for the function that the ULT will execute, and its argument.
  • A stack for each ULT is dynamically allocated, and its size can be specified by the user.
  • The ULT context also includes a pointer to the scheduler context in order to yield control to the scheduler or return to the scheduler upon completion
  • tasklet contains a function pointer, argument, and some bookkeeping information, such as an associated pool or ES. Tasklets are executed on the scheduler’s stack space.
  • A pool is a container data structure that can hold a set of work units and provides operations for insertion and deletion.
  • A scheduler is implemented similarly to a work unit; it has its own function (i.e., scheduling function) and a stack.
  • Argobots relies on cooperative scheduling of ULTs to improve resource utilization. , a ULT may voluntarily yield control when idle in order to allow the underlying ES to make progress on other work units.
  • Argobots synchronization primitives, such as mutex locking or thread join operations, automatically yield control when blocking is inevitable.
High-level runtimes–colocated I/O services
  • distributed I/O service daemons that are deployed alongside application processes.
    • This service model can be used to provide dynamically provisioned, compute-node-funded services [41], in situ analysis and coupling services [42], or distributed access to on-node storage devices
    • balance three competing goals: programmability (i.e., ensuring that the service itself is easy to debug and maintain), performance for concurrent workloads, and minimal interference with colocated applications.
  • Unlike conventional OS-level threads, ULTs are inexpensive to create and consume minimal resources while waiting for a blocking I/O operation. Each ULT can cooperatively yield when appropriate so that other ULTs (i.e., concurrent requests) can make progress, thereby enabling a high degree of I/O operation concurrency with minimal resource consumption

argobots,编程语言--C++,系统层--操作系统linux,c语言,云计算

  • abt-io, provides thin wrappers for common POSIX I/O function calls such as open(), pwrite(), and close().
    • Internally, the wrappers delegate blocking system calls to a separate Argobots pool as shown in Figure 12. The calling ULT is suspended while the I/O operation is in progress, thereby allowing other service threads to make progress until the I/O operation completes.
    • by spawning a new tasklet that coordinates with the calling ULT via an eventual, an Argobots future-like synchronization construct.
    • 请求服务池和 I/O 系统调用服务池之间的这种职责划分可以被认为是 I/O 转发的一种形式,它允许独立供应 I/O 资源,而不会干扰主应用程序例程的执行。
    • If the I/O resource provides a native asynchronous API (such as the Mercury RPC library [44]), then one need not delegate operations to a dedicated pool; the resource can use its normal completion notification mechanism to signal eventuals.
  • abt-snoozer, implements an I/O-aware Argobots scheduler that causes the ES to block (i.e., sleep) when no work units are eligible for execution and wake up when new work units are inserted
    • The scheduler can use the epoll() system call to block, and the pool can write() to an eventfd() file descriptor to notify it when new work units are added.
    • The abt-snoozer library uses the libev [45] event loop and asynchronous event watchers to abstract this functionality for greater portability

argobots,编程语言--C++,系统层--操作系统linux,c语言,云计算文章来源地址https://www.toymoban.com/news/detail-671805.html

Resource

  • https://www.mcs.anl.gov/~aamer/papers/tpds17_argobots.pdf

到了这里,关于【计算框架】协程库Argobots的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 大数据Flink(四十九):框架版本介绍和编程语言选择

    文章目录 框架版本介绍和编程语言选择 一、框架版本介绍 二、编程语言选择

    2024年02月15日
    浏览(51)
  • 想学计算机编程从什么学起?零基础如何自学计算机编程?中文编程开发语言工具箱之渐变标签组构件

    想学计算机编程从什么学起?零基础如何自学计算机编程? 给大家分享一款中文编程工具,零基础轻松学编程,不需英语基础,编程工具可下载。 这款工具不但可以连接部分硬件,而且可以开发大型的软件,向如图这个实例就是用这个工具开发的。 它的编程工具箱非常的丰

    2024年02月05日
    浏览(68)
  • C语言网络编程:实现自己的高性能网络框架

    一般生产环境中最耗时的其实是业务逻辑处理。所以,是不是可以将处理业务逻辑的代码给拆出来丢到线程池中去执行。 比如像下面这样: ​我们事先创建好一堆worker线程,主线程accepter拿到一个连接上来的套接字,就从线程池中取出一个线程将这个套接字交给它。这样,我

    2024年02月10日
    浏览(44)
  • 【计算机编程语言】HTML-前端基础知识

    学习网站:https://jquery.cuishifeng.cn/index.html HTML5+CSS3 1.1什么是HTML Hyper Text Markup Language - (超文本标记语言) 超文本:文字、图片、音频、视频、动画等 W3C:World Wide Web Consortium - 万维网联盟 - 中立性技术标准机构 W3C标准 结构 化标准语言(HTML、XML) 表现 标准语言(CSS) 行为

    2024年02月15日
    浏览(60)
  • 【计算机编程语言】JAVA-MyBatis(Eclipse)

    官网:https://mybatis.org/mybatis-3/zh/index.html 环境: JDK1.8(尽量) MySQL - 5.7(超经典) maven - 3.6.3 Eclipse 回顾: JDBC MySQL Java基础 maven Junit 框架:配置文件、最好的方式:官网文档 SSM框架:Spring SpringMVC Mybatis 1.1什么是Mybatis [外链图片转存失败,源站可能有防盗链机制,建议将图片保

    2024年02月16日
    浏览(40)
  • 【计算机编程语言】MySQL8+JDBC+Eclipse

    1.1数据库分类 关系型数据库:行,列 – (SQL ) MySQL,Oracle,Sql Server 通过表和表之间,行和列之间的关系进行数据存储。 学员信息,考勤表 非关系型数据库:{Key,Value} (NoSQL – not only SQL ) Redis,MongoDB 以对象存储,通过对象自身的属性来决定 DBMS – 数据库管理系统 数据库的

    2024年02月16日
    浏览(49)
  • Prompt进阶系列1:LangGPT(从编程语言反思LLM的结构化可复用提示设计框架)

    大语言模型 (Large Language Models, LLMs) 在不同领域都表现出了优异的性能。然而,对于非AI专家来说,制定高质量的提示来引导 LLMs 是目前AI应用领域的一项重要挑战。现有的提示工程研究已经提出了一些零散的优化原则,也有些研究设计了基于经验的提示优化器。然而,这些研

    2024年03月11日
    浏览(116)
  • C语言编程练习(经过确定分钟后,计算现在的时间)

    题目是在某大学教育平台上听的一道题,但是没有答案。自己琢磨的 题目大概意思:现在是11:20,经过110分钟,是几点几分? 首先贴上老师的解题思路:   解题思路:首先将目前时间 11:20分为两个部分,如何分开两部分? 1. 1120/100=11(c语言两个整数相除 结果是整数);1120%100

    2023年04月24日
    浏览(53)
  • 【C语言编程基础】根据日期求星期(基姆拉尔森计算公式)

    任意给出一个年月日,求出是星期几。 输入:     年   月   日 输出:   0~6 星期日用 0 表示,星期一用 1 表示,星期二用 2 表示......星期六用 6 表示。 这里采用基姆拉尔森计算公式: w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7 在公式中d表示日期中的日数,m表示月份数,y表示年数

    2024年02月06日
    浏览(51)
  • C语言编程实现,计算每天进步一点点一年后的效果

    本来的基数为1,如果好好学习时能力值相比前一天提高1%,当放任时相比前一天下降1%。1年(365天)后的效果相差多少呢? 原基数为1,努力一天进步1%,效果1*(1+0.01),努力两天是在前一天的基础上进步1%,结果是1*(1+0.01)*(1+0.01),一年后天天向上的力量是(1+0.01)的365次方。

    2024年02月11日
    浏览(54)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包