SlideShare a Scribd company logo
Piotr Balcer
<piotr.balcer@intel.com>
Intel® Data Center Group
SPDK, PMDK & Vtune™ Summit 2
Agenda
• pool<> class
• transactions
• p<> property
• peristent pointer
• transactional allocation
• persistent memory synchronization
• persistent container - array
• persistent container - vector
SPDK, PMDK & Vtune™ Summit
libpmemobjoverview
Atomic APIs Transactional APIs
Action APIs
Pool Management APIs
Configuration
APIs
Persistent Memory Allocator
Unified logs
Offset Pointers
persistence primitives
Primitives
APIs
libpmem
SPDK, PMDK & Vtune™ Summit 4
PoolManagementAPI
0x0 0xFFFFFFFF
HEAP STACK
sbrk() alloca()
Memory Mapping Area
FSDAX volume
File A
File B
File C
• Persistent Memory is usually exposed by the OS through a
DAX-enabled file system.
• Memory Mapping is used to take advantage of byte-
addressability of PMEM
• mmap() does not guarantee the address of the mapping.
Especially if Address Space Layout Randomization (ASLR) is
enabled.
mmap()
SPDK, PMDK & Vtune™ Summit 5
PoolManagementAPIs
0x0 0xFFFFFFFF
HEAP STACK
sbrk() alloca()
pmem::obj::pool
fsdax volume
File A
pmem::obj::pool
File C
pool::open()
• libpmemobj abstracts away the underlying storage, providing
unified APIs for managing files
• The entire library adapts to what type of storage is being used,
and does the right thing for correctness.
• This means msync() when DAX is not supported.
• It also works seamlessly for devdax devices
SPDK, PMDK & Vtune™ Summit 6
pmem::obj::poolexample
if (access(path.c_str(), F_OK) != 0) {
pop = pool<root>::create(path, "some_layout", PMEMOBJ_MIN_POOL,
S_IRWXU);
} else {
pop = pool<root>::open(path, "some_layout");
}
SPDK, PMDK & Vtune™ Summit
SPDK, PMDK & Vtune™ Summit 8
pmem::obj::persistent_ptr
0x40000000 0x4F000000
PMEMobjpool
Object A
void *objB =
0x4B400000;
Object B
• The base pointer of the mapping can change between application instances
• This means that any raw pointers between two memory locations can become invalid
• Must either fix all the pointers at the start of the application
• Potentially terabytes of data to go through…
• Or use a custom data structure which isn’t relative to the base pointer
SPDK, PMDK & Vtune™ Summit 9
pmem::obj::persistent_ptr
0x40000000 0x4F000000
PMEMobjpool Object B
Object A
PMEMoid objB
={…, 0xB400000};
http://pmem.io/pmdk/manpages/linux/master/libpmemobj/oid_is_null.3
• libpmemobj provides 16 byte offset pointers, which contain an offset relative to the beginning
of the mapping.
• Is a random access iterator
• Has primitives for flushing contents to persistence
• Does not manage object lifetime
• Does not automatically add contents to the transaction
• But it does add itself to the transaction
SPDK, PMDK & Vtune™ Summit 10
Rootobject
0x40000000 0x4F000000
PMEMobjpool
Root object
PMEMoid objA;
PMEMoid objC;
Object A
PMEMoid
objB;
Object B Object C
• All data structures of an application start at the root object.
• Has user-defined size, always exists and is initially zeroed.
• Applications should make sure that all objects are always reachable through some path that
starts at the root object.
• Unreachable objects are effectively persistent memory leaks.
SPDK, PMDK & Vtune™ Summit 11
pmem::obj::PERSISTENT_PTRexample
struct foo {
persistent_ptr<bar> barp;
};
pop = pool<foo>::create(…);
persistent_ptr<data> r = pop.root();
assert(r->barp == nullptr);
SPDK, PMDK & Vtune™ Summit
SPDK, PMDK & Vtune™ Summit 13
TransactionalAPI
• libpmemobj provides ACID (Atomicity, Consistency, Isolation, Durability) transactions
for persistent memory
• Atomicity means that a transaction either succeeds or fails completely
• Consistency means that the transaction transforms PMEMobjpool from one
consistent state to another. This means that a pool won’t get corrupted by a
transaction.
• Isolation means that transactions can be executed as if the operations were
executed serially on the pool. This is optional, and requires user-provided locks.
• Durability means that once a transaction is committed, it remains committed even in
the case of system failures
SPDK, PMDK & Vtune™ Summit 14
transactionsexample
auto pop = pool<root>::open("/path/to/poolfile", "layout string");
transaction::run(pop, [] {
// do some work...
}, persistent_mtx, persistent_shmtx);
SPDK, PMDK & Vtune™ Summit 15
Closuretransactions
• Take an std::function object as transaction body
• No explicit transaction commit
• Available with every C++11 compliant compiler
• Throw an exception when the transaction is aborted
• Take an arbitrary number of locks
SPDK, PMDK & Vtune™ Summit
SPDK, PMDK & Vtune™ Summit 17
pmem::obj::p
• Overloads operator= for snapshotting in a transaction
• Overloads a bunch of other operators for seamless integration
• Arithmetic
• Logical
• Should be used for fundamental types
• No convenient way to access members of aggregate types
• No operator. to overload
SPDK, PMDK & Vtune™ Summit 18
Codewithmanualsnapshotting
struct data {
int x;
}
auto pop = pool<data>::("/path/to/poolfile", "layout string");
auto datap = pop.root();
transaction::run(pop, [&]{
pmemobj_tx_add_range(root, 0, sizeof (struct data));
datap->x = 5;
});
SPDK, PMDK & Vtune™ Summit 19
Codewithpmem::obj:p
struct data {
p<int> x;
}
auto pop = pool<data>::("/path/to/poolfile", "layout string");
auto datap = pop.root();
transaction::run(pop, [&]{
datap->x = 5;
});
SPDK, PMDK & Vtune™ Summit 20
SPDK, PMDK & Vtune™ Summit 21
Transactionalallocation
• Can be used only within transactions
• Use transaction logic to enable allocation/delete rollback of persistent state
• make_persistent calls appropriate constructor
• Syntax similar to std::make_shared
• delete_persistent calls the destructor
• Not similar to anything found in std
SPDK, PMDK & Vtune™ Summit 22
Transactionalallocationexample
struct data {
data(int a, int b) : a(a), b(b) {}
int a;
int b;
}
transaction::run(pop, [&]{
persistent_ptr<data> ptr = make_persistent<data>(1, 2);
assert(ptr->a == 1);
assert(ptr->b == 2);
persistent_ptr<data> ptr2 = make_persistent<data>(allocation_flag::no_flush(),
2, 3);
...
delete_persistent<data>(ptr);
});
SPDK, PMDK & Vtune™ Summit 23
Allocationflags
• class_id(id)
• Allocate the object from the allocation class with id equal to id
• no_flush()
• Skip flush on commit
SPDK, PMDK & Vtune™ Summit
SPDK, PMDK & Vtune™ Summit 25
PersistentMemorySynchronizationprimitives
• Types:
• mutex
• shared_mutex
• timed_mutex
• condition_variable
• All with an interface similar to their std counterparts
• Auto reinitializing
• Can be used with transactions
SPDK, PMDK & Vtune™ Summit
SPDK, PMDK & Vtune™ Summit 27
pmem::obj::experimental::array
• std::array compatible interface (almost)
• Takes care of adding elements to a transaction
• In operator[]/at() when obtainig non-const reference
• On iterator dereference
• In other methods which allow write access to data
• Works with std algorithms
SPDK, PMDK & Vtune™ Summit 28
pmem::obj::experimental::arrayexample
transaction::run(pop, [&]{
auto ptr = make_persistent<array<int, 6>>();
// iterators will snapshot on element access
std::fill(ptr->begin(), ptr->end(), 1);
// modify all elements in a range
for (auto &e : ptr->range(0, 3)) {
e++;
}
delete_persistent<array<int, 6>>(ptr);
});
SPDK, PMDK & Vtune™ Summit 29
pmem::obj::experimental::vector
• std::vector compatible interface (almost)
• Takes care of adding elements to a transaction
• The same way as in array
• All functions which may alter vector properties are atomic
• This includes: resize(), reserve(), push_back() and others
• Transactions are used internally
• Strong exception gurantee
SPDK, PMDK & Vtune™ Summit 30
pmem::obj::experimental::vectorexample
transaction::run(pop, [&]{
auto ptr = make_persistent<vector<int>>();
ptr->push_back(1);
ptr->resize(10);
ptr->at(5) = 10;
delete_persistent<vector<int>>(ptr);
});
Create C++ Applications with the Persistent Memory Development Kit

More Related Content

What's hot

Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
Kalai Selvi
 
Provision Intel® Optane™ DC Persistent Memory in Linux*
Provision Intel® Optane™ DC Persistent Memory in Linux*Provision Intel® Optane™ DC Persistent Memory in Linux*
Provision Intel® Optane™ DC Persistent Memory in Linux*
Intel® Software
 
Persistent Memory Programming with Java*
Persistent Memory Programming with Java*Persistent Memory Programming with Java*
Persistent Memory Programming with Java*
Intel® Software
 
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13Gosuke Miyashita
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices: A Deep DiveCeph Block Devices: A Deep Dive
Ceph Block Devices: A Deep Dive
joshdurgin
 
Revisiting CephFS MDS and mClock QoS Scheduler
Revisiting CephFS MDS and mClock QoS SchedulerRevisiting CephFS MDS and mClock QoS Scheduler
Revisiting CephFS MDS and mClock QoS Scheduler
Yongseok Oh
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
Aj MaChInE
 
Cephfs jewel mds performance benchmark
Cephfs jewel mds performance benchmarkCephfs jewel mds performance benchmark
Cephfs jewel mds performance benchmark
Xiaoxi Chen
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESJan Kalcic
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Rongze Zhu
 
Red Hat Storage 2014 - Product(s) Overview
Red Hat Storage 2014 - Product(s) OverviewRed Hat Storage 2014 - Product(s) Overview
Red Hat Storage 2014 - Product(s) Overview
Marcel Hergaarden
 
Linux Stammtisch Munich: Ceph - Overview, Experiences and Outlook
Linux Stammtisch Munich: Ceph - Overview, Experiences and OutlookLinux Stammtisch Munich: Ceph - Overview, Experiences and Outlook
Linux Stammtisch Munich: Ceph - Overview, Experiences and Outlook
Danny Al-Gaaf
 
CephFS update February 2016
CephFS update February 2016CephFS update February 2016
CephFS update February 2016
John Spray
 
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Patrick McGarry
 
Bluestore
BluestoreBluestore
Bluestore
Patrick McGarry
 

What's hot (16)

Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
 
Provision Intel® Optane™ DC Persistent Memory in Linux*
Provision Intel® Optane™ DC Persistent Memory in Linux*Provision Intel® Optane™ DC Persistent Memory in Linux*
Provision Intel® Optane™ DC Persistent Memory in Linux*
 
Persistent Memory Programming with Java*
Persistent Memory Programming with Java*Persistent Memory Programming with Java*
Persistent Memory Programming with Java*
 
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices: A Deep DiveCeph Block Devices: A Deep Dive
Ceph Block Devices: A Deep Dive
 
Revisiting CephFS MDS and mClock QoS Scheduler
Revisiting CephFS MDS and mClock QoS SchedulerRevisiting CephFS MDS and mClock QoS Scheduler
Revisiting CephFS MDS and mClock QoS Scheduler
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
 
Cephfs jewel mds performance benchmark
Cephfs jewel mds performance benchmarkCephfs jewel mds performance benchmark
Cephfs jewel mds performance benchmark
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
 
optimizing_ceph_flash
optimizing_ceph_flashoptimizing_ceph_flash
optimizing_ceph_flash
 
Red Hat Storage 2014 - Product(s) Overview
Red Hat Storage 2014 - Product(s) OverviewRed Hat Storage 2014 - Product(s) Overview
Red Hat Storage 2014 - Product(s) Overview
 
Linux Stammtisch Munich: Ceph - Overview, Experiences and Outlook
Linux Stammtisch Munich: Ceph - Overview, Experiences and OutlookLinux Stammtisch Munich: Ceph - Overview, Experiences and Outlook
Linux Stammtisch Munich: Ceph - Overview, Experiences and Outlook
 
CephFS update February 2016
CephFS update February 2016CephFS update February 2016
CephFS update February 2016
 
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
 
Bluestore
BluestoreBluestore
Bluestore
 

Similar to Create C++ Applications with the Persistent Memory Development Kit

Parallel program design
Parallel program designParallel program design
Parallel program design
ZongYing Lyu
 
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran LonikarExploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Spark Summit
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
Sasha Goldshtein
 
2016 NCTU P4 Workshop
2016 NCTU P4 Workshop2016 NCTU P4 Workshop
2016 NCTU P4 Workshop
Yi Tseng
 
A compact bytecode format for JavaScriptCore
A compact bytecode format for JavaScriptCoreA compact bytecode format for JavaScriptCore
A compact bytecode format for JavaScriptCore
Tadeu Zagallo
 
Building source code level profiler for C++.pdf
Building source code level profiler for C++.pdfBuilding source code level profiler for C++.pdf
Building source code level profiler for C++.pdf
ssuser28de9e
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic Stack
Jakub Hajek
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek
PROIDEA
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded System
John Efstathiades
 
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
SegFaultConf
 
Symmetric Crypto for DPDK - Declan Doherty
Symmetric Crypto for DPDK - Declan DohertySymmetric Crypto for DPDK - Declan Doherty
Symmetric Crypto for DPDK - Declan Doherty
harryvanhaaren
 
Informix Data Streaming Overview
Informix Data Streaming OverviewInformix Data Streaming Overview
Informix Data Streaming Overview
Brian Hughes
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Adam Dunkels
 
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and TransformIntro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Apache Apex
 
Spark Summit EU talk by Sol Ackerman and Franklyn D'souza
Spark Summit EU talk by Sol Ackerman and Franklyn D'souzaSpark Summit EU talk by Sol Ackerman and Franklyn D'souza
Spark Summit EU talk by Sol Ackerman and Franklyn D'souza
Spark Summit
 
Intro to HPC
Intro to HPCIntro to HPC
Intro to HPC
Wendi Sapp
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryoguest40fc7cd
 
Recordmanagment2
Recordmanagment2Recordmanagment2
Recordmanagment2myrajendra
 
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
HostedbyConfluent
 

Similar to Create C++ Applications with the Persistent Memory Development Kit (20)

Parallel program design
Parallel program designParallel program design
Parallel program design
 
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran LonikarExploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
2016 NCTU P4 Workshop
2016 NCTU P4 Workshop2016 NCTU P4 Workshop
2016 NCTU P4 Workshop
 
A compact bytecode format for JavaScriptCore
A compact bytecode format for JavaScriptCoreA compact bytecode format for JavaScriptCore
A compact bytecode format for JavaScriptCore
 
Building source code level profiler for C++.pdf
Building source code level profiler for C++.pdfBuilding source code level profiler for C++.pdf
Building source code level profiler for C++.pdf
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic Stack
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded System
 
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
 
Symmetric Crypto for DPDK - Declan Doherty
Symmetric Crypto for DPDK - Declan DohertySymmetric Crypto for DPDK - Declan Doherty
Symmetric Crypto for DPDK - Declan Doherty
 
Informix Data Streaming Overview
Informix Data Streaming OverviewInformix Data Streaming Overview
Informix Data Streaming Overview
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
 
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and TransformIntro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
 
Spark Summit EU talk by Sol Ackerman and Franklyn D'souza
Spark Summit EU talk by Sol Ackerman and Franklyn D'souzaSpark Summit EU talk by Sol Ackerman and Franklyn D'souza
Spark Summit EU talk by Sol Ackerman and Franklyn D'souza
 
Flink internals web
Flink internals web Flink internals web
Flink internals web
 
Intro to HPC
Intro to HPCIntro to HPC
Intro to HPC
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryo
 
Recordmanagment2
Recordmanagment2Recordmanagment2
Recordmanagment2
 
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
 

More from Intel® Software

AI for All: Biology is eating the world & AI is eating Biology
AI for All: Biology is eating the world & AI is eating Biology AI for All: Biology is eating the world & AI is eating Biology
AI for All: Biology is eating the world & AI is eating Biology
Intel® Software
 
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Python Data Science and Machine Learning at Scale with Intel and AnacondaPython Data Science and Machine Learning at Scale with Intel and Anaconda
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Intel® Software
 
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSciStreamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Intel® Software
 
AI for good: Scaling AI in science, healthcare, and more.
AI for good: Scaling AI in science, healthcare, and more.AI for good: Scaling AI in science, healthcare, and more.
AI for good: Scaling AI in science, healthcare, and more.
Intel® Software
 
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Intel® Software
 
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Intel® Software
 
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Intel® Software
 
AWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI ResearchAWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI Research
Intel® Software
 
Intel Developer Program
Intel Developer ProgramIntel Developer Program
Intel Developer Program
Intel® Software
 
Intel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview SlidesIntel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview Slides
Intel® Software
 
AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019
Intel® Software
 
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
Intel® Software
 
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Intel® Software
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Intel® Software
 
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Intel® Software
 
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
Intel® Software
 
AIDC India - AI on IA
AIDC India  - AI on IAAIDC India  - AI on IA
AIDC India - AI on IA
Intel® Software
 
AIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino SlidesAIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino Slides
Intel® Software
 
AIDC India - AI Vision Slides
AIDC India - AI Vision SlidesAIDC India - AI Vision Slides
AIDC India - AI Vision Slides
Intel® Software
 
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Intel® Software
 

More from Intel® Software (20)

AI for All: Biology is eating the world & AI is eating Biology
AI for All: Biology is eating the world & AI is eating Biology AI for All: Biology is eating the world & AI is eating Biology
AI for All: Biology is eating the world & AI is eating Biology
 
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Python Data Science and Machine Learning at Scale with Intel and AnacondaPython Data Science and Machine Learning at Scale with Intel and Anaconda
Python Data Science and Machine Learning at Scale with Intel and Anaconda
 
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSciStreamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
 
AI for good: Scaling AI in science, healthcare, and more.
AI for good: Scaling AI in science, healthcare, and more.AI for good: Scaling AI in science, healthcare, and more.
AI for good: Scaling AI in science, healthcare, and more.
 
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
 
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
 
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
 
AWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI ResearchAWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI Research
 
Intel Developer Program
Intel Developer ProgramIntel Developer Program
Intel Developer Program
 
Intel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview SlidesIntel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview Slides
 
AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019
 
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
 
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
 
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
 
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
 
AIDC India - AI on IA
AIDC India  - AI on IAAIDC India  - AI on IA
AIDC India - AI on IA
 
AIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino SlidesAIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino Slides
 
AIDC India - AI Vision Slides
AIDC India - AI Vision SlidesAIDC India - AI Vision Slides
AIDC India - AI Vision Slides
 
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Create C++ Applications with the Persistent Memory Development Kit

  • 2. SPDK, PMDK & Vtune™ Summit 2 Agenda • pool<> class • transactions • p<> property • peristent pointer • transactional allocation • persistent memory synchronization • persistent container - array • persistent container - vector
  • 3. SPDK, PMDK & Vtune™ Summit libpmemobjoverview Atomic APIs Transactional APIs Action APIs Pool Management APIs Configuration APIs Persistent Memory Allocator Unified logs Offset Pointers persistence primitives Primitives APIs libpmem
  • 4. SPDK, PMDK & Vtune™ Summit 4 PoolManagementAPI 0x0 0xFFFFFFFF HEAP STACK sbrk() alloca() Memory Mapping Area FSDAX volume File A File B File C • Persistent Memory is usually exposed by the OS through a DAX-enabled file system. • Memory Mapping is used to take advantage of byte- addressability of PMEM • mmap() does not guarantee the address of the mapping. Especially if Address Space Layout Randomization (ASLR) is enabled. mmap()
  • 5. SPDK, PMDK & Vtune™ Summit 5 PoolManagementAPIs 0x0 0xFFFFFFFF HEAP STACK sbrk() alloca() pmem::obj::pool fsdax volume File A pmem::obj::pool File C pool::open() • libpmemobj abstracts away the underlying storage, providing unified APIs for managing files • The entire library adapts to what type of storage is being used, and does the right thing for correctness. • This means msync() when DAX is not supported. • It also works seamlessly for devdax devices
  • 6. SPDK, PMDK & Vtune™ Summit 6 pmem::obj::poolexample if (access(path.c_str(), F_OK) != 0) { pop = pool<root>::create(path, "some_layout", PMEMOBJ_MIN_POOL, S_IRWXU); } else { pop = pool<root>::open(path, "some_layout"); }
  • 7. SPDK, PMDK & Vtune™ Summit
  • 8. SPDK, PMDK & Vtune™ Summit 8 pmem::obj::persistent_ptr 0x40000000 0x4F000000 PMEMobjpool Object A void *objB = 0x4B400000; Object B • The base pointer of the mapping can change between application instances • This means that any raw pointers between two memory locations can become invalid • Must either fix all the pointers at the start of the application • Potentially terabytes of data to go through… • Or use a custom data structure which isn’t relative to the base pointer
  • 9. SPDK, PMDK & Vtune™ Summit 9 pmem::obj::persistent_ptr 0x40000000 0x4F000000 PMEMobjpool Object B Object A PMEMoid objB ={…, 0xB400000}; http://pmem.io/pmdk/manpages/linux/master/libpmemobj/oid_is_null.3 • libpmemobj provides 16 byte offset pointers, which contain an offset relative to the beginning of the mapping. • Is a random access iterator • Has primitives for flushing contents to persistence • Does not manage object lifetime • Does not automatically add contents to the transaction • But it does add itself to the transaction
  • 10. SPDK, PMDK & Vtune™ Summit 10 Rootobject 0x40000000 0x4F000000 PMEMobjpool Root object PMEMoid objA; PMEMoid objC; Object A PMEMoid objB; Object B Object C • All data structures of an application start at the root object. • Has user-defined size, always exists and is initially zeroed. • Applications should make sure that all objects are always reachable through some path that starts at the root object. • Unreachable objects are effectively persistent memory leaks.
  • 11. SPDK, PMDK & Vtune™ Summit 11 pmem::obj::PERSISTENT_PTRexample struct foo { persistent_ptr<bar> barp; }; pop = pool<foo>::create(…); persistent_ptr<data> r = pop.root(); assert(r->barp == nullptr);
  • 12. SPDK, PMDK & Vtune™ Summit
  • 13. SPDK, PMDK & Vtune™ Summit 13 TransactionalAPI • libpmemobj provides ACID (Atomicity, Consistency, Isolation, Durability) transactions for persistent memory • Atomicity means that a transaction either succeeds or fails completely • Consistency means that the transaction transforms PMEMobjpool from one consistent state to another. This means that a pool won’t get corrupted by a transaction. • Isolation means that transactions can be executed as if the operations were executed serially on the pool. This is optional, and requires user-provided locks. • Durability means that once a transaction is committed, it remains committed even in the case of system failures
  • 14. SPDK, PMDK & Vtune™ Summit 14 transactionsexample auto pop = pool<root>::open("/path/to/poolfile", "layout string"); transaction::run(pop, [] { // do some work... }, persistent_mtx, persistent_shmtx);
  • 15. SPDK, PMDK & Vtune™ Summit 15 Closuretransactions • Take an std::function object as transaction body • No explicit transaction commit • Available with every C++11 compliant compiler • Throw an exception when the transaction is aborted • Take an arbitrary number of locks
  • 16. SPDK, PMDK & Vtune™ Summit
  • 17. SPDK, PMDK & Vtune™ Summit 17 pmem::obj::p • Overloads operator= for snapshotting in a transaction • Overloads a bunch of other operators for seamless integration • Arithmetic • Logical • Should be used for fundamental types • No convenient way to access members of aggregate types • No operator. to overload
  • 18. SPDK, PMDK & Vtune™ Summit 18 Codewithmanualsnapshotting struct data { int x; } auto pop = pool<data>::("/path/to/poolfile", "layout string"); auto datap = pop.root(); transaction::run(pop, [&]{ pmemobj_tx_add_range(root, 0, sizeof (struct data)); datap->x = 5; });
  • 19. SPDK, PMDK & Vtune™ Summit 19 Codewithpmem::obj:p struct data { p<int> x; } auto pop = pool<data>::("/path/to/poolfile", "layout string"); auto datap = pop.root(); transaction::run(pop, [&]{ datap->x = 5; });
  • 20. SPDK, PMDK & Vtune™ Summit 20
  • 21. SPDK, PMDK & Vtune™ Summit 21 Transactionalallocation • Can be used only within transactions • Use transaction logic to enable allocation/delete rollback of persistent state • make_persistent calls appropriate constructor • Syntax similar to std::make_shared • delete_persistent calls the destructor • Not similar to anything found in std
  • 22. SPDK, PMDK & Vtune™ Summit 22 Transactionalallocationexample struct data { data(int a, int b) : a(a), b(b) {} int a; int b; } transaction::run(pop, [&]{ persistent_ptr<data> ptr = make_persistent<data>(1, 2); assert(ptr->a == 1); assert(ptr->b == 2); persistent_ptr<data> ptr2 = make_persistent<data>(allocation_flag::no_flush(), 2, 3); ... delete_persistent<data>(ptr); });
  • 23. SPDK, PMDK & Vtune™ Summit 23 Allocationflags • class_id(id) • Allocate the object from the allocation class with id equal to id • no_flush() • Skip flush on commit
  • 24. SPDK, PMDK & Vtune™ Summit
  • 25. SPDK, PMDK & Vtune™ Summit 25 PersistentMemorySynchronizationprimitives • Types: • mutex • shared_mutex • timed_mutex • condition_variable • All with an interface similar to their std counterparts • Auto reinitializing • Can be used with transactions
  • 26. SPDK, PMDK & Vtune™ Summit
  • 27. SPDK, PMDK & Vtune™ Summit 27 pmem::obj::experimental::array • std::array compatible interface (almost) • Takes care of adding elements to a transaction • In operator[]/at() when obtainig non-const reference • On iterator dereference • In other methods which allow write access to data • Works with std algorithms
  • 28. SPDK, PMDK & Vtune™ Summit 28 pmem::obj::experimental::arrayexample transaction::run(pop, [&]{ auto ptr = make_persistent<array<int, 6>>(); // iterators will snapshot on element access std::fill(ptr->begin(), ptr->end(), 1); // modify all elements in a range for (auto &e : ptr->range(0, 3)) { e++; } delete_persistent<array<int, 6>>(ptr); });
  • 29. SPDK, PMDK & Vtune™ Summit 29 pmem::obj::experimental::vector • std::vector compatible interface (almost) • Takes care of adding elements to a transaction • The same way as in array • All functions which may alter vector properties are atomic • This includes: resize(), reserve(), push_back() and others • Transactions are used internally • Strong exception gurantee
  • 30. SPDK, PMDK & Vtune™ Summit 30 pmem::obj::experimental::vectorexample transaction::run(pop, [&]{ auto ptr = make_persistent<vector<int>>(); ptr->push_back(1); ptr->resize(10); ptr->at(5) = 10; delete_persistent<vector<int>>(ptr); });