LabVIEW Programming for a Multicore Environment. Stefan Kreuzer Applications Engineer National Instruments

Similar documents
EECS Berkeley EE249 LabVIEW Framework. Hugo A. Andrade Principal Architect LabVIEW Platform & Real Time Group

Taking Advantage of Multicore Technology. Jeff Meisel, Real-Time and Embedded Group, National Instruments

Parallel Programming Multicore systems

Improving the Performance of your LabVIEW Applications

Going With the (Data) Flow

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4

Chapter 07: Instruction Level Parallelism VLIW, Vector, Array and Multithreaded Processors. Lesson 06: Multithreaded Processors

Programming for the LabVIEW Real-Time Module Using LabWindows/CVI

NI Linux Real-Time. Fanie Coetzer. Field Sales Engineer SA North. ni.com

Graphical System Design

Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2

LabVIEW Real-Time Module Release Notes

For use by students enrolled in #71251 CSE430 Fall 2012 at Arizona State University. Do not use if not enrolled.

Approach to Enable Real-Time HPC. President, CEO and Cofounder National Instruments

DAQ & Control with PXI. Murali Ravindran Senior Product Manager

CHAPTER 3 LabVIEW REAL TIME APPLICATION DEVELOPMENT REFERENCES: [1] NI, Real Time LabVIEW. [2] R. Bishop, LabVIEW 2009.

Simplifying the Development and Debug of 8572-Based SMP Embedded Systems. Wind River Workbench Development Tools

1 1 / 1 / Due : Fri. Nov. 23 rd / Mon. Nov. 26

Software Concepts. It is a translator that converts high level language to machine level language.

Chapter 4: Multi-Threaded Programming

ClearSpeed Visual Profiler

Case Study. Windows XP. Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze

Benefits of Programming Graphically in NI LabVIEW

Benefits of Programming Graphically in NI LabVIEW

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering

High-Value PXI Embedded Controller for Windows. High-Value Embedded Controllers for PXI Express NI PXI-8101, NI PXI NI PXIe-8101, NI PXIe-8102

A new architecture for real-time control in RFX-mod G. Manduchi, A. Barbalace Big Physics Symposium 1/16

LECTURE 3:CPU SCHEDULING

Simultaneous Multithreading on Pentium 4

Getting Started with the LabWindows /CVI Real-Time Module

Introduction to Operating Systems

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

POSIX in Real-Time. By Kevin M. Obenland 03/15/2001. Daniel Correia nºmec Carlos Guisado nºmec 49099

CS420: Operating Systems

Chapter 4 Threads, SMP, and


Getting Started with the LabVIEW Real-Time Module

Operating Systems Overview. Chapter 2

LabVIEW programming I

Lesson 5: Software for embedding in System- Part 2

ni.com Decisions Behind the Design: LabVIEW for CompactRIO Sample Projects

LabVIEW 2009 Real-Time & FPGA 最新技術剖析. National Instruments 美商國家儀器 行銷部技術經理吳維翰

Chapter 4: Multithreaded Programming

Multiple Processor Systems. Lecture 15 Multiple Processor Systems. Multiprocessor Hardware (1) Multiprocessors. Multiprocessor Hardware (2)

THREAD LEVEL PARALLELISM

Professional Multicore Programming. Design and Implementation for C++ Developers

Application Programming

Multi-core Architectures. Dr. Yingwu Zhu

Threads and Too Much Milk! CS439: Principles of Computer Systems January 31, 2018

Part I Introduction Hardware and OS Review

LabVIEW Basics I: Introduction Course

Tips for Code Re-Use. Rejwan Ali, Marketing Engineer NI Africa and Oceania

Parallel Processors. The dream of computer architects since 1950s: replicate processors to add performance vs. design a faster processor

Dongjun Shin Samsung Electronics

Profiling and Debugging OpenCL Applications with ARM Development Tools. October 2014

CS 326: Operating Systems. CPU Scheduling. Lecture 6

Faster Time to Measurement Advances in LabVIEW Instrument Control

Operating Systems: Internals and Design Principles. Chapter 4 Threads Seventh Edition By William Stallings

What You ll Do Today. Learn LabVIEW fundamentals Acquire temperature signal Output warning light based on alarm level Write data to file

Chapter 4: Threads. Chapter 4: Threads

Threads and Too Much Milk! CS439: Principles of Computer Systems February 6, 2019

Parallelism Marco Serafini

What You ll Do Today. Learn LabVIEW fundamentals Acquire temperature signal Output warning light based on alarm level Write data to file

Chapter 4: Multithreaded Programming

Multi-core Architectures. Dr. Yingwu Zhu

PC-based data acquisition I

Comparison of SSL/TLS libraries based on Algorithms/languages supported, Platform, Protocols and Performance. By Akshay Thorat

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Integrating Data Acquisition and Instrument Control with Your Scilab Scripts

SMP/BIOS Overview. Nov 18, 2014

SMP/BIOS Overview. March 19, 2015

Introduction to LabVIEW and NI Hardware Platform

Using POSIX Threading to Build Scalable Multi-Core Applications

Processor Performance and Parallelism Y. K. Malaiya

DSP using Labview FPGA. T.J.Moir AUT University School of Engineering Auckland New-Zealand

Kernel Synchronization I. Changwoo Min

CS370 Operating Systems Midterm Review

A dedicated kernel named TORO. Matias Vara Larsen

EECS 750: Advanced Operating Systems. 01/29 /2014 Heechul Yun

LabVIEW Communication Techniques for Distributed Applications

Is Intel s Hyper-Threading Technology Worth the Extra Money to the Average User?

CUDA GPGPU Workshop 2012

Performance Analysis on SMP and Non-SMP for Multicore Technology

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management

Threads, SMP, and Microkernels

CS6401- Operating System QUESTION BANK UNIT-I

Plugin Architectures. Customizable application with plugin architecture

Designing Real-Time Control Applications Using LabVIEW and CompactRIO. Developer Days 2009

Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy)

ECU Measurement and Calibration in a Real-Time Test Environment. Roland Magolei National Instruments Engineering GmbH Embedded Networks

Chapter 5: CPU Scheduling

SE300 SWE Practices. Lecture 10 Introduction to Event- Driven Architectures. Tuesday, March 17, Sam Siewert

Chapter 4: Threads. Operating System Concepts 8 th Edition,

Multi-core Programming Evolution

LIMITS OF ILP. B649 Parallel Architectures and Programming

Chapter 5: CPU Scheduling. Operating System Concepts Essentials 8 th Edition

Operating Systems. Operating Systems

Chapter 5: Process Scheduling

CS425 Computer Systems Architecture

Transcription:

LabVIEW Programming for a Multicore Environment Stefan Kreuzer Applications Engineer National Instruments

Agenda Overview of LabVIEW Multithreading Parallel Programming Techniques Real-Time Considerations Resources

Impact on Engineers and Scientists Engineering and scientific applications are typically on dedicated systems (i.e. little multitasking).

Creating Multithreaded Applications Engineers and scientists mustuse threads to benefit from multicore processors.

Automatic Multithreading in LabVIEW LabVIEW automatically divides each application into multiple execution threads LabVIEW introduced multithreading in 1998

Automatic Multithreading in LabVIEW LabVIEW automatically divides each application into multiple execution threads LabVIEW introduced multithreading in 1998 thread thread thread

Demo: Accidental Parallelism in LabVIEW

NEWMultithreading Features in LabVIEW8.5 Scale # of execution system threads based on available cores Improved thread scheduling for LabVIEW timed loops Set Processor Affinity with Timed Structures Real-Time Features: Support for Real-Time targets with Symmetric Multiprocessing Real-Time Execution Trace Toolkit 2.0

Application Example Eaton Corporation Eaton created a portable in-vehicle test system for truck transmissions using LabVIEW. Acquired and analyzed 16 channels on single core using DAQmx multithreaded driver Now acquire and analyze 80+ channels on multicore There was no need to rewrite our application for the new multicore processing platforms. Scott Sirrine Lead Design Engineer Eaton Truck Division

Multithreaded Software Stack Support Software Stack Development tool Support provided on the operating system of choice; tool facilitates correct threading and optimization Libraries Example: Multithreaded nature of LabVIEW and structures that provide optimization Thread-safe, re-entrant libraries Example: BLAS libraries Device drivers Drivers designed for optimal multithreaded performance Operating system Operating system supports multithreading and multitasking and can load balance tasks Example: NI-DAQmxdriver software Example: Support for Windows, Mac OS, Linux OS, and real-time operating systems

Evaluating if existing LabVIEW applications will run faster on multicoresystems Key Considerations Is the code sequential or parallel? How are shared resources being utilized within the application? Conclusions Code speed-up will widely vary depending on application Many applications will require minor modifications to fully optimize for multicore

Sequential vs. Parallel Code Sequential Example - LabVIEW will execute VIs in order, one after another. RESULT: A multicoresystem will not improve processing speed over a single core system, because there is no parallelism in the code.

Sequential vs. Parallel Code Parallel Example - Since code has parallel branches, LabVIEW will try to compile code for parallel execution RESULT: Code can now take advantage of multicore systems, i.e. Filter and Spectral Measurements VIs will execute in parallel.

Potential Bottlenecks: Shared Resources 1. Data Dependencies Example: Data stored in global variables that need to be accessed by different VIs would be a shared resource 2. Hard Disk Example: Computers can only read or write to the hard disk one item at a Example: Computers can only read or write to the hard disk one item at a time (File I/O cannot be made into parallel operations) 3. Non-reentrant VIs

Non-reentrant VIs VIs that are non-reentrant cannot be called simultaneously, one call runs and the other call waits for the first to finish before running To make a VI reentrant, select File»VI Properties, select the Execution category and choose Reentrant execution.

Parallel Programming Techniques to Improve Performance on Multicore Systems Task Parallelism Data Parallelism Pipelining

Data Parallelism You can speed up processor-intensive operations on large data sets on multicore systems. Data Set Signal Processing Result

Data Parallelism You can speed up processor-intensive operations on large data sets on multicore systems. Data Set Signal Processing Signal Processing Signal Processing Signal Processing Combine Results

Data Parallelism Demo

Application Example: High-Speed Control Max Planck Institute (Munich, Germany) Plasma control in nuclear fusion tokamakwith LabVIEW on 8 core system using data parallelism technique with LabVIEW, we obtained a 20X processing speed-up on an octal-core processor machine over a single-core processor Louis Giannone Lead Project Researcher Max Planck Institute

Pipelining Strategy Many applications involve sequential, multistep algorithms Applying pipelining can increase performance 2 4 2 4 Acquire Filter Analyze Log 1 3 Acquire Filter Analyze Log 1 3 time t 0 t 3 t 4 t 7

Pipelining Strategy Acquire Filter Analyze Log t 0 t 1 t 2 t 3 time

Pipelining Strategy Acquire Acquire Filter Filter Analyze Analyze Log Log t 0 t 1 t 2 t 3 time

Pipelining Strategy Acquire Acquire Acquire Acquire Filter Filter Filter Filter Analyze Analyze Analyze Analyze Log Log Log Log t 0 t 1 t 2 t 3 time

Pipelining in LabVIEW Sequential Pipelined? Note: Queues may also be used to pipeline data between different loops or

Pipelining Demo

Key Considerations for Pipelining Consider number of Processor Cores when determining number of pipeline stages Be sure to balance stages since longest stage will be limiting factor in performance speed-up Example: Unbalanced Pipeline

Tips for Balancing Pipeline Stages Use LabVIEW benchmarking techniques Perform basic benchmarking with timestamps and VI Profiler

Deterministic Real-Time Systems LabVIEW 8.5 adds Symmetric Multiprocessing (SMP) for realtime systems.

Assigning Tasks to Specific Cores In LabVIEW 8.5, users can assign code to specific processor cores using the LabVIEW Timed Loop.

Processor Affinity with the Timed Loop Recommended for Real-Time development Under special usecases it can be used on Windows (example: cache optimization)

Execution Trace Toolkit 2.0 30-day evaluation Compatible with LabVIEW 7.1 and higher New Features in Version 2.0 Performance improvements Trace activity sorting New debugging flags (priority inheritance) Multicore support

Application Example: Real-Time Control Wind Tunnel Safety-of-Flight system at NASA Ames Research Center Benchmarks Results Ran on PXI-8106 RT Controller Time-Critical loop was reduced from 43 % CPU load to 30 % CPU load on one CPU of the PXI-8106RT A core leftover for processing of noncritical tasks. Image Source: http://windtunnels.arc.nasa.gov

Resources www.ni.com/multicore