PARALLEL PROGRAMMING AND OPTIMIZATION
WITH INTEL XEON PHITM COPROCESSORS
HANDBOOK ON THE DEVELOPMENT AND OPTIMIZATION
OF PARALLEL APPLICATIONS
FOR INTEL XEON PROCESSORS
AND INTEL XEON PHITM COPROCESSORS
Second Edition
Andrey Vladimirov, Ryo Asai and Vadim Karpusenko
Colfax International, 20132015
Last revision date: May 20, 2015
Copyrighted Material
Copyright 20132015, Colfax International. All rights reserved.
Cover image Copyright pio3, 2013. Used under license from Shutterstock.com.
Published by Colfax International, 750 Palomar Ave, Sunnyvale, CA 94085, USA.
All Rights Reserved.
No part of this book (or publication) may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording or by any information storage and retrieval system, without written permission from the publisher, except for the inclusion of brief quotations in a review.
Intel, Xeon and Intel Xeon Phi are trademarks of Intel Corporation in the U.S. and/or other countries.
All trademarks and registered trademarks appearing in this publication are the property of their respective owners.
Terms of Use
This book is available in the electronic version and in the printed version. Both versions are accompanied by a set of practical exercises available as an electronic archive. The book and the practical exercises may be used under the following terms:
1. You may use book and the code of the practical exercises for your own education.
2. If you use this book and/or practical exercises to teach a course,
2a) every student must purchase their own copy of the book, OR
2b) you must obtain written authorization from the copyright holder.
3. If you wish to use significant portions of the code of the practical exercises for derivative works, you must obtain written authorization from us.
4. You MAY NOT distribute the electronic version of the book or the source code of the "labs".
5. If you own a printed version of the book, you may lend it to other people, and the borrowers of the book may download the labs as described in Section and use them under the terms described here. This applies to individual book owners and to libraries (i.e., institutional book owners).
Disclaimer and Legal Notices
While best efforts have been used in preparing this book, the publisher makes no representations or warranties of any kind and assumes no liabilities of any kind with respect to the accuracy or completeness of the contents and specifically disclaims any implied warranties of merchantability or fitness of use for a particular purpose. The publisher shall not be held liable or responsible to any person or entity with respect to any loss or incidental or consequential damages caused, or alleged to have been caused, directly or indirectly, by the information or programs contained herein. No warranty may be created or extended by sales representatives or written sales materials.
Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products.
Results have been simulated and are provided for informational purposes only. Results were derived using simulations run on an architecture simulator or model. Any difference in system hardware or software design or configuration may affect actual performance.
Because of the evolutionary nature of technology, knowledge and best practices described at the time of this writing, may become outdated or simply inapplicable at a later date. Summaries, strategies, tips and tricks are only recommendations by the publisher, and reading this eBook does not guarantee that one's results will exactly mirror our own results. Every company is different and the advice and strategies contained herein may not be suitable for your situation. References are provided for informational purposes only and do not constitute endorsement of any websites or other sources.
The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. All products, computer systems, dates, and figures specified are preliminary based on current expectations, and are subject to change without notice.
ISBN: 978-0-9885234-3-2
About the Authors
Andrey Vladimirov, PhD , is Head of HPC Research at Colfax International. His primary interest is the application of modern computing technologies to computationally demanding scientific problems. Prior to joining Colfax, A. Vladimirov was involved in computational astrophysics research at Stanford University, North Carolina State University, and the Ioffe Institute in Russia, where he studied cosmic rays, collisionless plasmas and the interstellar medium using computer simulations.
Ryo Asai is a Researcher at Colfax International. He develops optimization methods for scientific applications targeting emerging parallel computing platforms, computing accelerators and interconnect technologies. Ryo holds a B.S. degree in Physics from University of California, Berkeley.
Vadim Karpusenko, PhD , is Principal HPC Research Engineer at Colfax International involved in training and consultancy projects on data mining, software development and statistical analysis of complex systems. His research interests are in the area of physical modeling with HPC clusters, highly parallel architectures, and code optimization. Vadim holds a PhD from North Carolina State University for his research in in the field of computational biophysics on the free energy and stability of helical secondary structures of proteins.
Additional publications by these authors related to Intel MIC architecture programmingmay be found at http://research.colfaxinternational.com/
Acknowledgements
Second Edition
We cannot thank enough the people who have contributed their valuable time and expertise towrite technical reviews of the 2nd edition of this book. They have provided guidance, fixedmisconceptions, future-proofed the messages and caught countless bugs: Ilya Burylov, Gennady Fedorov, Alexandr Kalinkin, Alexandr Kobotov, Vadim Pirogov (Intel/MKL), Joseph Curley (Intel), Rob Farber (TechEnablement.com), Rakesh Krishnaiyer (Intel), Lawrence Meadows (Intel), John Pennycook (Intel), Troy Porter (Stanford University), Frances Roth (Intel), Jason Sewall (Intel), Gergana Slavova (Intel). Thank you all verymuch!
First Edition
Authors are sincerely grateful to James Reinders for supervising and directing the creation ofthis book, Albert Lee for his help with editing and error checking, to specialists at IntelCorporation who contributed their time and shared with the authors their expertise on the MICarchitecture programming: Bob Davies , Shannon Cepeda , Pradeep Dubey , Ronald Green , James Jeffers , Taylor Kidd , Rakesh Krishnaiyer , Chris (CJ) Newburn , Kevin O'Leary , Zhang Zhang , and to a great number of people, mostly from ColfaxInternational and Intel, who have ensured that gears were turning and bits werechurning during the production of the book, including Rajesh Agny , Mani Anandan , Joe Curley , Roger Herrick , Richard Jackson , Mike Lafferty , Thomas Lee , Belinda Liviero , Gary Paek , Troy Porter , Tim Puett , John Rinehimer , Gautam Shah , Manish Shah , Bruce Shiu , Jimmy Tran , Achim Wengeler , and Desmond Yuen .