------------------------------------------
Intel(R) Advisor XE
mmult Sample Application
README
------------------------------------------

Introduction
------------------------------------------

This is the README file for the mmult sample application written using the Fortran programming language. It explains how to open, build, and run this sample application using the Intel(R) Advisor XE 2015.

The mmult sample implements a basic matrix multiplication.

Acquiring the Sample Application
------------------------------------------

Copy the mmult.tgz from the <INSTALL_DIR>\samples\en\Fortran directory to a writable directory or share on your system. Extract the sample.

Running a Survey Analysis
------------------------------------------

Build the release version of the serial sample with the following command: make 1_mmult_serial 

Open the Intel Advisor XE GUI and create a new project for the 1_mmult_serial executable. The default matrix size should ensure a long enough run time. Choose File > New > Start Survey Analysis to start a new survey analysis of the application.

The Survey report shows that the hotspot is in the subroutine matrix_multiply(). Look along the hot call-chain and notice that there are three loops above this hotspot. Loops are often good candidates for parallel sites, so investigate more by double-clicking on one to get to the Survey Source view. Return to the Survey report by using the Survey Report button.

The loops in matrix_multiply could be parallelized in different ways depending on how the work is to be divided. In order to indicate that this loop is a good parallel site, you add Intel Advisor XE annotations to the source code.  These are used by subsequent Intel Advisor XE tools to model parallelism on your serial program

For this example, the outermost loop will be modeled as the parallel loop. Annotations have already been added to the file mmult_annotated.f90. Study this file to see how annotations were used. 

Running a Suitability Analysis
------------------------------------------

Build the release version of the annotated sample with the following command: make 2_mmult_annotated

Note: The Makefile requires that the ADVISOR_XE_2015_DIR environment variable is set to the install directory of the Intel Advisor XE. This environment variable can be set by running the Intel Advisor XE setup script <install-dir>/advixe-vars.sh.

Create a new project or modify the project properties to run the executable 2_mmult_annotated. Continue using the defulat matrix size.

Choose File > Project Properties and select the Source Search tab to tell Intel Advisor XE where to locate the source files of the application. In this case, add the mmult directory.

Choose File > New > Start Suitability Analysis to start a new suitability analysis of the application.
 
The annotated application appears to scale up to at least 256 cores, which is the desirable result.

Running a Dependencies Analysis
------------------------------------------

Build the debug version of the annotated sample with the following command: make 2_mmult_annotated_debug

Note: The Makefile requires that the ADVISOR_XE_2015_DIR environment variable is set to the install directory of the Intel Advisor XE. This environment variable can be set by running the Intel Advisor XE setup script <install-dir>/advixe-vars.sh.

Create a new project or modify the project properties to run the executable 2_nqueens_annotated_debug. Change the application parameter to 128 to speed up the analysis time.

Choose File > Project Properties and select the Source Search tab to tell Intel Advisor XE where to locate the source files of the application. In this case, add the mmult directory, if you haven't already.

Choose File > New > Start Dependencies Analysis to start a new Dependencies Analysis of the application.

The Correctness report verifies that the site was encountered during the run. It also shows that no potential correctness issues were found with this parallel model.

Adding Parallelism
------------------------------------------
The file mmult_omp.f90 has OpenMP pragmas in place of the annotations. Build debug or release versions of this application with the following commands:
make 3_mmult_omp
make 3_mmult_omp_debug

Run these applications to see how the performance improves over the serial version.

Conclusion
------------------------------------------

You have successfully followed the Intel Advisor XE Workflow to parallelize a Fortran program.

Feel free to experiment with the tool using your own Fortran programs.

Please contact us if you have any feedback or questions at http://software.intel.com/en-us/articles/intel-software-developer-support/


Legal Information
------------------------------------------

INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. 

UNLESS OTHERWISE AGREED IN WRITING BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR ANY APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A SITUATION WHERE PERSONAL INJURY OR DEATH MAY OCCUR. 

Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. 

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. Current characterized errata are available on request. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go to: http://www.intel.com/design/literature.htm 

Intel processor numbers are not a measure of performance. Processor numbers differentiate features within each processor family, not across different processor families. Go to: http://www.intel.com/products/processor_number/

BlueMoon, BunnyPeople, Celeron, Celeron Inside, Centrino, Centrino Inside, Cilk, Core Inside, E-GOLD, i960, Intel, the Intel logo, Intel AppUp, Intel Atom, Intel Atom Inside, Intel Core, Intel Inside, Intel Insider, the Intel Inside logo, Intel NetBurst, Intel NetMerge, Intel NetStructure, Intel SingleDriver, Intel SpeedStep, Intel Sponsors of Tomorrow., the Intel Sponsors of Tomorrow. logo, Intel StrataFlash, Intel vPro, Intel XScale, InTru, the InTru logo, the InTru Inside logo, InTru soundmark, Itanium, Itanium Inside, MCS, MMX, Moblin, Pentium, Pentium Inside, Puma, skoool, the skoool logo, SMARTi, Sound Mark, The Creators Project, The Journey Inside, Thunderbolt, Ultrabook, vPro Inside, VTune, Xeon, Xeon Inside, X-GOLD, XMM, X-PMU and XPOSYS are trademarks of Intel Corporation in the U.S. and/or other countries.

*Other names and brands may be claimed as the property of others.

Microsoft, Windows, Visual Studio, Visual C++, and the Windows logo are trademarks, or registered trademarks of Microsoft Corporation in the United States and/or other countries. 

Copyright (C) 2014, Intel Corporation. All rights reserved. 

