Quantcast
Channel: Intel Developer Zone Articles
Viewing all 3384 articles
Browse latest View live

Upgrading Intel® IoT Developer Kit libraries – Intel® Edison or Intel® Galileo board

$
0
0

Your Intel® Edison or Intel® Galileo board came with the official operating system, based on Yocto Linux* and the latest version of the Intel® IoT Developer Kit  (dev kit) libraries. From time to time, you should check if there is a new version of the libraries available.

The operating system uses opkg as the package manager. Below are the commands to add the repository and to update the libraries if a new version of dev kit is available.

The following commands should be run in a terminal with access to the Edison or Galileo board. Open a serial terminal, or a ssh connection, whichever you prefer. 

Add the repository – Edison only

This step is not required on Galileo boards running the dev kit. To update the libraries, you need to add this repository to the opkg list of repositories. You only need to do this step once. After that, you can check for updates anytime you wish. 

$ echo "src intel-iotdk http://iotdk.intel.com/repos/1.1/intelgalactic"> /etc/opkg/intel-iotdk.conf

To update the dev kit packages 

Since we already have set up the repository, we can check for updates and install new versions with the commands:

$ opkg update

$ opkg upgrade

 

 


Intel® Concurrent Collections for C++ for Windows* and Linux*

$
0
0

Parallelism Without the Pain

Why CnC?

CnC makes it easy to write C++ programs which take full advantage of the available parallelism. Whether run on multicore systems, Xeon Phi™ or clusters CnC will seamlessly exploit the performance potential of your hardware. Through its portability and composability (with itself and other tools) it provides future-proof scalability.

Intel® Concurrent Collections for C++

Intel® Concurrent Collections for C++ is a C++ template library for letting C++ programmers implement CnC applications which run in parallel on shared and distributed memory. Intel(R) Concurrent Collections for C++ is now also available as open source from github

Primary features

Easy parallelism

  • There is no need to think about lower level parallelization techniques like threading primitives or message passing; no need to understand pthreads, MPI, Windows threads, TBB,...
  • There is no need to think about different types of parallelism such as task, pipeline, fork-join, task or data parallelism.
  • Intel® Concurrent Collections for C++ provides a separation of concerns between what the application means and how to tune it for a specific platform. The application code can be paired with isolated tuning code. This allows programmers to focus on each separately.

 


CnC yields quasi-linear scaling in these example applications

 


CnC yields quasi-linear scaling on thousands of cores in RTM-3dfd

 

CnC makes tuning a separate ingredient
CnC makes tuning a separate ingredient

 

 

Portability

  • The same source runs on Windows and Linux.
  • The same binary runs on shared memory multi-core systems and clusters of workstations. In fact, Intel® Concurrent Collections for C++ is a unified model for shared and distributed memory systems (as opposed to the MPI / OpenMP combination, for example).

Efficiency

  • Because Intel® Concurrent Collections for C++ provides a way to express an algorithm with minimal scheduling constraints, it is very efficient
  • In addition, Intel® Concurrent Collections for C++ supports two types of tuning:
    • Runtime tuning makes the runtime more efficient for a specific application.
    • Application tuning makes the application itself more efficient with user-specified distribution of the work.

Scalability

  • Intel® Concurrent Collections for C++ achieves scalable performance on a wide range of configurations from small multicore systems to large clusters.
  • No need to re-write or re-compile application in order to target a new configuration.

The following downloads are available under the BSD license. The current version is 1.0.100.

Including required TBB bits
Choose one of these if in doubt
Linux* 64bit  
Windows* 64bitWindows* 32bit (old ver. 1.0.002)

Without TBB bits
Requires existing TBB >= 4.2 Update 3
Windows* 64bit Windows* 32bit (old ver. 1.0.002)

The Idea

The major goal of CnC (Concurrent Collections) is a productive path to efficient parallel execution. And yet a CnC program does not indicate what runs in parallel. Instead, it explicitly identifies what precludes parallel execution. There are exactly two reasons that computations cannot execute in parallel. If one computation produces data that the other one consumes, the producer must execute before the consumer. If one computation determines if another will execute, the controller must execute before the controllee. CnC is a data and control flow model together with tuple-space influence. However, it is closer in philosophy to the PDG (Program Dependence Graph) intermediate form than to other parallel programming models. Its high-level abstractions allow flexible and efficient mapping of a CnC program to the target platform. By this it simplifies parallelism and at the same time let's you exploit the full parallel potential of your application.

What's new in version 1.0?

  • Support for re-use
    • Write CnC graphs and use them in other CnC programs (multiple times)
    • Embed non-CnC functionality in a CnC application
  • Reductions
  • Join/Cross
  • Combine MPI programs with CnC code
  • More example codes
    • Attaching to databases (mysql*)
    • Showcasing reductions, mapreduce, join, CnC-SPMD/MPI combo and more
  • Intel(R) Concurrent Collections for C++ is now available as open source from github.
  • Bug fixes etc.
  • Added support for Visual Studio* 2013, dropped support for Visual Studio* 2008 (Microsoft Windows* only)
  • With Update 1.0.100:
    • Improved tracing output: put()s, get()s and reporting never-available items linked to calling step
    • Added warning messages about put()s before get()s in step executions (unless -DNDEBUG)
    • New CnC programs/samples: raytracer and jacobi2d-heureka
    • Improved startup process for SOCKETS on distributed memory
    • Dropped binary releases for ia32 and Visual Studio* 2010 (Microsoft Windows*)
    • Source structure improvements on github

See also the Release Notes.

Docs about Intel® Concurrent Collections for C++

Tutorial
API Documentation
Release Notes
Getting Started
FAQ

CnC Papers and Related Links

The Concurrent Collections Programming Model
Parallel Programming For Distributed Memory Without The Pain
Performance Evaluation of Concurrent Collections on High-Performance Multicore Computing Systems
Measuring the Overhead of Intel C++ CnC over Gauss-Jordan Elimination
Segmentation for the Brain Connectome using a Multi-Scale Parallel Computing Architecture
Cluster Computing using Intel Concurrent Collections 
Habanero Concurrent Collections Project at Rice University

Discussions, Report Problems or Leave Feedback

To report a problem or request a feature, please use the issue tracker on github: https://github.com/icnc/icnc/issues

For questions and feedback on this product you can also visit the "Whatif Alpha Forum" to participate in forum discussions about Intel® Concurrent Collections: http://software.intel.com/en-us/forums/intel-concurrent-collections-for-cc/

To stay in touch with the Intel® Concurrent Collections team and the community, we provide a new email-list you can subscribe to or just watch online:
http://tech.groups.yahoo.com/group/intel_concurrent_collections/

pyMIC: A Python Offload Module for the Intel(R) Xeon Phi(TM) Coprocessor

$
0
0

Python has gained a lot of attention by the high performance computing community as an easy-to-use, elegant scripting language for rapid prototyping and development of flexible software. At the same time, there is an ever-growing need for more compute power to satisfy the demand for higher accuracy simulation or more detailed modeling. The Intel(R) Xeon Phi(TM) coprocessor strives to provide additional compute power for floating-point intensive codes, while maintaining the programmability of the traditional Intel(R) Xeon(R) platform.

This paper presents a Python module to handle offloads to the Intel Xeon Phi coprocessor from Python code. It provides an easy-to-use interface to invoke compute kernels on the coprocessor, while handling data transfers in a flexible yet performant way. The paper discusses how the Python module can be utilized to offload key kernels in the Python-based open source electronic-structure simulation software GPAW. Micro-benchmarks show that the solution imposes only marginal overheads on the kernel invocations.

Building OpenCV 3.0 based embedded application using Intel® System Studio 2015

$
0
0

To Download this article :  Building OpenCV using Intel System Studio.pdf (452 KB)


Introduction

We describe how to use Intel® System Studio 2015 to build the OpenCV 3.0 based embedded application on Intel platforms. In this paper, we have considered a sample code that is part of OpenCV, how to use different components of Intel® System Studio to build OpenCV sample code.  

OpenCV is the most prominent computer vision library and many embedded applications are built using features of OpenCV.   It is filled with a lot of features for performing tasks like image registration, tracking, classification and much more. An easy way to improve OpenCV application performance on Intel Architecture is to re build using components of Intel® System Studio like Intel® C++ compiler and Intel® IPP.

Building OpenCV 3.0 based application using Intel® System Studio 2015

To take benefit of Intel® System studio components, step by step approach will be used.   

Summary

Intel® System Studio is a comprehensive and integrated tool suite that provides developers with advanced system tools and technologies to help accelerate the delivery of the next generation power efficient, high performance, and reliable embedded and mobile devices. 

In this paper, we showed how to build OpenCV 3.0 based sample using Intel® C++ Compiler and Intel® IPP.

Intel® C++ compiler supports vectorization, which can generate Streaming SIMD Extensions (SSE) instructions. Use of such instructions through the compiler can lead to improved application performance on Intel architectures. Intel IPP library provides low-level, but high performance basic image and video processing functions, if you have pre-installed Intel System Studio, then OpenCV 3.0 will automatically detect and take benefit of optimization on Intel Platform.

Reference

 

Intel® System Studio web page : https://software.intel.com/en-us/intel-system-studio

OpenCV web page:http://opencv.org/ 

 

 

Parallel Android* Applications for 64-bit architecture with Intel® TBB

$
0
0

Recently, the new Android L 64-bit OS became available. In this paper I will show you how easy it is to develop parallel applications for Android L 64 bit with Intel® Threading Building Blocks (Intel® TBB). The Intel TBB is a cross-platform library of templates for creating parallel programs. It creates and synchronizes streams of data, hiding the details of the architecture and allowing you to work at a higher level of abstraction. Intel TBB works on all architectures. For Android, use version 4.3 and above.

Build Intel® TBB

  1. You can download Intel TBB from here: https://www.threadingbuildingblocks.org/. I downloaded the sources of the last stable release (4.3 Update 1).
  2. Add NDK to PATH:
    For Windows*:
    • $ SET PATH=%PATH%; <path_to_ndk>
    For Linux*:
    • $ export PATH=$PATH: <path_to_ndk>
  3. Unzip Intel TBB and go to the src folder.
    $ cd <tbb_sources>/src/
  4. Build Intel TBB libraries for Android by running: $ <path_to_ndk>/ndk-build –C <tbb_sources>/src/ arch=intel64 compiler=gcc target=android clean tbb tbbmalloc -j
  5. The library is built. In the build directory (<tbb_sources>/build/) you can find directories with these libs: libgnustl_shared.so, libtbbmalloc_proxy.so, libtbbmalloc.so and libtbb.so. We will use libtbb.so and libgnustl_shared.so in our application.

Configuring the emulator

In Eclipse* click: Window -> Android Virtual Device Manager. In this window click Create and choose the options shown on the next screen:

Click Ok. To check if it’s working, select new device in the list and click Start…. In a new window click the Launch button and the emulator will start:

Create application

In our sample application we will matrix multiply (3x2) times (2x3). Let’s do this!

Create a new Android application:

Add native support by right-clicking on the our project in Project Explorer -> Android Tools -> Add Native Support

On the next window enter the name of the lib of our project and click Finish.

In the project directory, a new jni directory has been created. Android.mk is the Makefile for our project, and we need to add the Intel TBB libs to it:

LOCAL_PATH := $(call my-dir)
TBB_PATH := <tbb_sources>
TBB_BUILD_PATH := /build/linux_intel64_gcc_android_cc4.9_NDKr10b_version_android-L_release

include $(CLEAR_VARS)

LOCAL_MODULE    := TBBMatrixMult
LOCAL_SRC_FILES := TBBMatrixMult.cpp
LOCAL_CFLAGS += -DTBB_USE_GCC_BUILTINS -std=c++11 -fexceptions -Wdeprecated-declarations -I$(TBB_PATH)/include -I$(TBB_PATH)$(TBB_BUILD_PATH)
LOCAL_LDLIBS := -llog -ltbb -L./ -L$(TBB_PATH)$(TBB_BUILD_PATH)
LOCAL_SHARED_LIBRARIES += libtbb

include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := libtbb
LOCAL_SRC_FILES := $(TBB_PATH)$(TBB_BUILD_PATH)/libtbb.so
include $(PREBUILT_SHARED_LIBRARY)

In the jni directory, create an Application.mk file and add the following lines:

APP_ABI := x86_64
APP_GNUSTL_FORCE_CPP_FEATURES := exceptions rtti
APP_STL := gnustl_shared

The purpose of Application.mk is to describe which native modules (i.e., static/shared libraries) are needed by your application. In the line APP_ABI := x86_64 we specify our target architecture. It will application for 64-bit architecture.

Now we can try to run our application. If you see the main screen of the application, then Intel TBB linked successfully and we can start developing our matrix multiplication app.

In the res/layout/activity_main.xml paste the following code:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity"><ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"><TextView
                android:id="@+id/titleA"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@string/a"
                android:textAppearance="?android:attr/textAppearanceSmall" /><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><EditText
		            android:id="@+id/a00"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /><EditText
		            android:id="@+id/a01"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned"><requestFocus /></EditText></LinearLayout><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><EditText
		            android:id="@+id/a10"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /><EditText
		            android:id="@+id/a11"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /></LinearLayout><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><EditText
		            android:id="@+id/a20"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /><EditText
		            android:id="@+id/a21"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /></LinearLayout><TextView
		        android:id="@+id/titleB"
		        android:layout_width="wrap_content"
		        android:layout_height="wrap_content"
		        android:layout_marginTop="15dp"
		        android:text="@string/b"
		        android:textAppearance="?android:attr/textAppearanceSmall" /><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><EditText
		            android:id="@+id/b00"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /><EditText
		            android:id="@+id/b01"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /><EditText
		            android:id="@+id/b02"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /></LinearLayout><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><EditText
		            android:id="@+id/b10"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /><EditText
		            android:id="@+id/b11"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /><EditText
		            android:id="@+id/b12"
		            android:layout_width="wrap_content"
		            android:layout_height="wrap_content"
		            android:layout_weight="1"
		            android:ems="3"
		            android:inputType="numberDecimal|numberSigned" /></LinearLayout><Button
		        android:id="@+id/button"
		        style="?android:attr/buttonStyleSmall"
		        android:layout_width="wrap_content"
		        android:layout_height="wrap_content"
		        android:layout_marginTop="17dp"
		        android:text="@string/button" /><TextView
		        android:id="@+id/titleC"
		        android:layout_width="wrap_content"
		        android:layout_height="wrap_content"
		        android:text="@string/c"
		        android:textAppearance="?android:attr/textAppearanceSmall" /><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><TextView
		            android:id="@+id/c00"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /><TextView
		            android:id="@+id/c01"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /><TextView
		            android:id="@+id/c02"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /></LinearLayout><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><TextView
		            android:id="@+id/c10"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /><TextView
		            android:id="@+id/c11"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /><TextView
		            android:id="@+id/c12"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /></LinearLayout><LinearLayout
		        android:layout_width="match_parent"
		        android:layout_height="wrap_content"><TextView
		            android:id="@+id/c20"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:layout_marginBottom="40dp"
		            android:textAppearance="?android:attr/textAppearanceSmall" /><TextView
		            android:id="@+id/c21"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /><TextView
		            android:id="@+id/c22"
		            android:layout_width="70dp"
		            android:layout_height="wrap_content"
		            android:textAppearance="?android:attr/textAppearanceSmall" /></LinearLayout></LinearLayout></ScrollView></RelativeLayout>

In the res/values/strings.xml add this code:

<?xml version="1.0" encoding="utf-8"?><resources><string name="app_name">TBBMatrixMult</string><string name="action_settings">Settings</string><string name="a">A:</string><string name="b">B:</string><string name="c">C:</string><string name="button">A x B = C</string></resources>

And now the main activity looks like this:

 

Next we need to implement the Java* interface for our activity. In the src/intel.example.tppmatrixmult/MainActivity.java file, add the following code:

package intel.example.tbbmatrixmult;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {

	private native double [][] onClickCalc(double [] a, double [] b, int aRow, int aCol);
	private EditText matrixA [][] = new EditText[3][2];
	private EditText matrixB [][] = new EditText[2][3];
	private TextView matrixC [][] = new TextView[3][3];
	private TextView titleC;
	private Button mult;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		initA();
		initB();
		initC();
		mult = (Button) findViewById(R.id.button);
		mult.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Toast.makeText(getBaseContext(), "Unknown error!", Toast.LENGTH_SHORT).show();
				double [][] a = getA();
				double [][] b = getB();
				if (a == null || b == null) {
					Toast.makeText(getBaseContext(), "Unknown error!", Toast.LENGTH_SHORT).show();
					return;
				}
				double [][] c = onClickCalc(matrixToArray(a), matrixToArray(b), 3, 2);
				setC(c);
				setVisibleC(true);
			}
		});
		setVisibleC(false);

		System.loadLibrary("tbb");
        System.loadLibrary("TBBMatrixMult");
	}

	private double [] matrixToArray(double [][] matrix) {
		double [] array = new double[matrix.length * matrix[0].length];
		for (int row = 0; row < matrix.length; ++row) {
			for (int col = 0; col < matrix[row].length; ++col)
			{
				array[row * matrix[row].length + col] = matrix[row][col];
			}
		}
		return array;
	}

	private void initA() {
		matrixA[0][0] = (EditText) findViewById(R.id.a00);
		matrixA[0][1] = (EditText) findViewById(R.id.a01);
		matrixA[1][0] = (EditText) findViewById(R.id.a10);
		matrixA[1][1] = (EditText) findViewById(R.id.a11);
		matrixA[2][0] = (EditText) findViewById(R.id.a20);
		matrixA[2][1] = (EditText) findViewById(R.id.a21);
	}
	private void initB() {
		matrixB[0][0] = (EditText) findViewById(R.id.b00);
		matrixB[0][1] = (EditText) findViewById(R.id.b01);
		matrixB[0][2] = (EditText) findViewById(R.id.b02);
		matrixB[1][0] = (EditText) findViewById(R.id.b10);
		matrixB[1][1] = (EditText) findViewById(R.id.b11);
		matrixB[1][2] = (EditText) findViewById(R.id.b12);
	}
	private void initC() {
		titleC = (TextView) findViewById(R.id.titleC);
		matrixC[0][0] = (TextView) findViewById(R.id.c00);
		matrixC[0][1] = (TextView) findViewById(R.id.c01);
		matrixC[0][2] = (TextView) findViewById(R.id.c02);
		matrixC[1][0] = (TextView) findViewById(R.id.c10);
		matrixC[1][1] = (TextView) findViewById(R.id.c11);
		matrixC[1][2] = (TextView) findViewById(R.id.c12);
		matrixC[2][0] = (TextView) findViewById(R.id.c20);
		matrixC[2][1] = (TextView) findViewById(R.id.c21);
		matrixC[2][2] = (TextView) findViewById(R.id.c22);
	}

	private double[][] getA() {
		double [][] ret = new double [matrixA.length][];
		for (int i = 0; i < matrixA.length; ++i) {
			ret[i] = new double [matrixA[i].length];
			for (int j = 0; j < matrixA[i].length; ++j) {
				if (matrixA[i][j].getText().toString().length() == 0) {
					Toast.makeText(getBaseContext(), "Error! One field is empty!", Toast.LENGTH_SHORT).show();
					return null;
				}
				ret[i][j] = Double.parseDouble(matrixA[i][j].getText().toString());
			}
		}
		return ret;
	}

	private double[][] getB() {
		double [][] ret = new double [matrixB.length][];
		for (int i = 0; i < matrixB.length; ++i) {
			ret[i] = new double [matrixB[i].length];
			for (int j = 0; j < matrixB[i].length; ++j) {
				if (matrixB[i][j].getText().toString().length() == 0) {
					Toast.makeText(getBaseContext(), "Error! One field is empty!", Toast.LENGTH_SHORT).show();
					return null;
				}
				ret[i][j] = Double.parseDouble(matrixB[i][j].getText().toString());
			}
		}
		return ret;
	}

	private void setC(double [][] cVal) {
		if (matrixC.length != cVal.length) {
			Toast.makeText(getBaseContext(), "Unknown error!", Toast.LENGTH_SHORT).show();
			return;
		}
		for (int i = 0; i < matrixC.length; ++i) {
			if (matrixC[i].length != cVal[i].length) {
				Toast.makeText(getBaseContext(), "Unknown error!", Toast.LENGTH_SHORT).show();
				return;
			}
			for (int j = 0; j < matrixC[i].length; ++j) {
				matrixC[i][j].setText(String.valueOf(cVal[i][j]));
			}
		}
	}

	private void setVisibleC(boolean cond) {
		if (cond == true)
			titleC.setVisibility(View.VISIBLE);
		else
			titleC.setVisibility(View.GONE);
		for (int i = 0; i < matrixC.length; ++i) {
			for (int j = 0; j < matrixC[i].length; ++j) {
				if (cond == true) {
					matrixC[i][j].setVisibility(View.VISIBLE);
				}
				else {
					matrixC[i][j].setVisibility(View.GONE);
				}
			}
		}
	}
}

And now we are using Intel TBB constructions for parallel code. The next code snippet is an implementation of matrix multiplication in jni/TBBMatrixMult.cpp. This code is running in one thread:
#include <jni.h>

double ** arrayToMatrix(double * array, int row, int col)
{
	double ** matrix = new double * [row];
	for (int i = 0; i < row; ++i)
	{
		matrix[i] = new double [col];
		for (int j = 0; j < col; ++j)
		{
			matrix[i][j] = array[i * col + j];
		}
	}
	return matrix;
}

extern "C" JNIEXPORT jobjectArray JNICALL Java_intel_example_tbbmatrixmult_MainActivity_onClickCalc(
		JNIEnv *env, jobject obj, jdoubleArray aMatrix, jdoubleArray bMatrix, jint aRow, jint aCol)
{
	double * aArray = (*env).GetDoubleArrayElements(aMatrix, 0);
	double ** a = arrayToMatrix(aArray, aRow, aCol);
	double * bArray = (*env).GetDoubleArrayElements(bMatrix, 0);
	double ** b = arrayToMatrix(bArray, aCol, aRow);
	double ** c = new double * [aRow];
	for (int i = 0 ; i < 3; ++i) {
		c[i] = new double [aRow];
	}
	for (int row = 0; row < aRow, ++row) {
		for (int col = 0; col < aRow; ++col) {
			c[row][col] = 0;
			for(int k = 0; k < aCol; ++k)
			{
				c[row][col] += a[row][k] * b[k][col];
			}
		}
	};

	jclass doubleArrayClass = (*env).FindClass("[D");

	jobjectArray cMatrix = (*env).NewObjectArray((jsize) aRow, doubleArrayClass, 0);

	for (int i = 0; i < aRow; i++)
	{
		jdoubleArray doubleArray = (*env).NewDoubleArray(aRow);
		(*env).SetDoubleArrayRegion(doubleArray, (jsize) 0, (jsize) aRow, c[i]);
		(*env).SetObjectArrayElement(cMatrix, (jsize) i, doubleArray);
		(*env).DeleteLocalRef(doubleArray);
	}

	return cMatrix;
}
For adding parallelism to this code, we should include the Intel TBB header: #include "tbb/tbb.h" and change the cycle by row:
tbb::parallel_for (0, aRow, 1, [=](int row) {
	for (int col = 0; col < aRow; ++col) {
		c[row][col] = 0;
		for(int k = 0; k < aCol; ++k)
		{
			c[row][col] += a[row][k] * b[k][col];
		}
	}
});

And now we are using Intel TBB constructions for parallel code. The next code snippet is an implementation of matrix multiplication in jni/TBBMatrixMult.cpp. This code is running in one thread:

#include <jni.h>

double ** arrayToMatrix(double * array, int row, int col)
{
	double ** matrix = new double * [row];
	for (int i = 0; i < row; ++i)
	{
		matrix[i] = new double [col];
		for (int j = 0; j < col; ++j)
		{
			matrix[i][j] = array[i * col + j];
		}
	}
	return matrix;
}

extern "C" JNIEXPORT jobjectArray JNICALL Java_intel_example_tbbmatrixmult_MainActivity_onClickCalc(
		JNIEnv *env, jobject obj, jdoubleArray aMatrix, jdoubleArray bMatrix, jint aRow, jint aCol)
{
	double * aArray = (*env).GetDoubleArrayElements(aMatrix, 0);
	double ** a = arrayToMatrix(aArray, aRow, aCol);
	double * bArray = (*env).GetDoubleArrayElements(bMatrix, 0);
	double ** b = arrayToMatrix(bArray, aCol, aRow);
	double ** c = new double * [aRow];
	for (int i = 0 ; i < 3; ++i) {
		c[i] = new double [aRow];
	}
	for (int row = 0; row < aRow, ++row) {
		for (int col = 0; col < aRow; ++col) {
			c[row][col] = 0;
			for(int k = 0; k < aCol; ++k)
			{
				c[row][col] += a[row][k] * b[k][col];
			}
		}
	};

	jclass doubleArrayClass = (*env).FindClass("[D");

	jobjectArray cMatrix = (*env).NewObjectArray((jsize) aRow, doubleArrayClass, 0);

	for (int i = 0; i < aRow; i++)
	{
		jdoubleArray doubleArray = (*env).NewDoubleArray(aRow);
		(*env).SetDoubleArrayRegion(doubleArray, (jsize) 0, (jsize) aRow, c[i]);
		(*env).SetObjectArrayElement(cMatrix, (jsize) i, doubleArray);
		(*env).DeleteLocalRef(doubleArray);
	}

	return cMatrix;
}

For adding parallelism to this code, we should include the Intel TBB header: #include"tbb/tbb.h" and change the cycle by row:

tbb::parallel_for (0, aRow, 1, [=](int row) {
	for (int col = 0; col < aRow; ++col) {
		c[row][col] = 0;
		for(int k = 0; k < aCol; ++k)
		{
			c[row][col] += a[row][k] * b[k][col];
		}
	}
});

You can see the result of our application in the next screenshot:

Notices

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

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark* and MobileMark*, 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.

Any software source code reprinted in this document is furnished under a software license and may only be used or copied in accordance with the terms of that license.

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.

Copyright © 2014 Intel Corporation. All rights reserved.

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

Handling Offline Capability and Data Sync In An Android* App – Part 1

$
0
0
Abstract

 

Mobile apps with a backend need to provide offline capability as the devices may not have continuous network access. We also need an efficient way for our app to automatically sync with a backend server. In this article we will take a look at how Android* sync adapter framework can be leveraged for a restaurant sample app to enable seamless data sync. We will discuss how to provide offline capability using content providers and local SQLite database. This will be a 2-part series; part 1 will cover the usage of content provider APIs with a local SQLite database.

Contents

Abstract. 

Overview... 

A Retail Business Restaurant Sample App – Little Chef.

Using a Content Provider with local SQLite database. 

Implementing the RestaurantContentProvider 

Accessing RestaurantContentProvider using ContentResolver 

Adding RestaurantContentProvider to app Manifest. 

About the Author 

 

Overview

Android* apps that rely on a backend server for data or content need to provide offline capability for a seamless userexperience. This requires us to maintain a local copy of the data model. We also need an efficient way to keep the local data model insync with the one on the backend server.  We can achieve both of these features using the standard Android APIs.

Content provider APIs can be used to abstract away the data model, and using SQLite APIs we can maintain a device resident SQLite database for a local copy of the data. For efficient data sync with the server, Android provides sync adapter framework APIs to automatically handle network connection drops, background syncing, and scheduling.

Additionally, we can hook up the sync adapter framework to the content provider, enabling us to reuse the same data abstraction for in-app use and background sync. Please refer to the following link for more details on the sync adapter framework in Android.

http://developer.Android.com/training/sync-adapters/index.html

In this 2-part series, we will take a look at how these APIs were used in a sample restaurant Android app, providing a seamless user experience. Part 1 will cover using content provider APIs with a local SQLite database.

 

A Retail Business Restaurant Sample App – Little Chef.

“Little Chef” is a sample restaurant app with several features including menu content, loyalty club, and location based services among others. The app uses a backend server for getting the latest menu content and updates. The backend database can be updated using a web frontend.

 

 

Figure 1: A Restaurant Sample App - Little Chef

We will use a local SQLite database to mirror the data model needed for the app. Content providers are used so we can enable search suggestions, or in the future share menu content with other Android apps. Android sync adapter framework is used to keep the data between the app and backend in sync.

In the next few sections, we will look at how these features are implemented in this sample app.

 

Using a Content Provider with a Local SQLite Database

 

Previously, we discussed how to use a local SQLite database with the Little Chef sample app. Please see the following link for reference.

https://software.intel.com/en-us/Android/articles/using-a-database-with-your-Android-app

Android content provider APIs can help us with new use cases like sharing the menu content with other apps on the device and offering custom search and/or advanced copy/paste operations on the device.

Once implemented, content providers can be used as a generic data abstraction along with other Android APIs like UI adapters or sync adapters, for example.

For a comprehensive reference on creating and using content providers please see the official reference at the following link.

http://developer.Android.com/guide/topics/providers/content-providers.html

For the sample app we will use a content provider as the front-end for a local SQLite database.

Previously, the sample app was directly accessing the menu items from a local SQLite database using the getMenuItems method. We can wrap around this function with a simple content provider.

Implementing the RestaurantContentProvider

 

To implement a content provider in Android, we need to create a class that extends from abstract class ContentProvider and implement its 6 required methods - query(), insert(), update(), delete() getType(), onCreate(). 

 

public class RestaurantContentProvider extends ContentProvider {
    private static final String AUTHORITY = "com.example.restaurant.provider";
    private static final int MENU = 1;
    private static final int MENU_ID = 2;
    private static final UriMatcher sURIMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    static {
        sURIMatcher.addURI(AUTHORITY, "menu", MENU);
        sURIMatcher.addURI(AUTHORITY, "menu/#", MENU_ID);
    }

    public static final Uri MENU_URI = Uri.parse("content://" + AUTHORITY + "/" + "menu");
    private RestaurantDatabase mDb;

    @Override
    public boolean onCreate() {
        mDb = new RestaurantDatabase(getContext());
        return true;
    }

    @Override
    public String getType(Uri uri) {
        switch (sURIMatcher.match(uri)) {
            case MENU:
                return "vnd.Android.cursor.dir/vnd.com.example.restaurant.provider.menu";
            case MENU_ID:
                return "vnd.Android.cursor.dir/vnd.com.example.restaurant.provider.menu";
            default:
                throw new RuntimeException("getType No URI Match: " + uri);
        }
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection,
                        String[] selectionArgs, String sortOrder) {

        switch (sURIMatcher.match(uri)) {
            case MENU:
                return mDb.getMenuItems();
            default:
                throw new UnsupportedOperationException("Not yet implemented");
        }

    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        // Implement this to handle requests to delete one or more rows.
        throw new UnsupportedOperationException("Not yet implemented");
    }        

Code Snippet 1, a simple content provider wrapper ++

 

URIs are used to uniquely address the resources and an AUTHORITY tag to identify the content provider.

Accessing the content provider is done via a ContentResolver object available from the application context.  ContentResolver uses the URIs and AUTHORITY tag to route the calls to the appropriate content provider.

Accessing RestaurantContentProvider Using ContentResolver

In the current version of the sample app, we access the menu items directly from the SQLite database. Using a ContentResolver we can direct our data access calls to the content provider wrapper we created earlier.

     public void loadDataFromLocalDataBase(Context ctx) {
        if (mMenuItems != null && mMenuItems.size() > 0) {
            clear();
        }

        mMenuItems = new ArrayList<MenuItem>();

        Set<String> categories = new HashSet<String>();
        //Cursor c = db.getMenuItems();
        Cursor c = ctx.getContentResolver().query(RestaurantContentProvider.MENU_URI, null, null, null, null);
        while (c.moveToNext()) {
            String category = c.getString(c.getColumnIndexOrThrow(RestaurantDatabase.MenuColumns.CATEGORY));
            categories.add(category);

            MenuItem menuItem = new MenuItem();
            menuItem.setCategory(category);
            menuItem.setName(c.getString(c.getColumnIndexOrThrow(RestaurantDatabase.MenuColumns.NAME)));
            menuItem.setDescription(c.getString(c.getColumnIndexOrThrow(RestaurantDatabase.MenuColumns.DESCRIPTION)));
            menuItem.setNutrition(c.getString(c.getColumnIndexOrThrow(RestaurantDatabase.MenuColumns.NUTRITION)));
            menuItem.setPrice(c.getString(c.getColumnIndexOrThrow(RestaurantDatabase.MenuColumns.PRICE)));
            menuItem.setImagename(c.getString(c.getColumnIndexOrThrow(RestaurantDatabase.MenuColumns.IMAGENAME)));
            mMenuItems.add(menuItem);
        }
        c.close();

        mCategoryList = new ArrayList<String>(categories);
    }

Code Snippet 2, accessing content provider wrapper ++

 

Since both SQLite and content provider APIs use cursor objects, we can simply switch out the call as shown in the above code snippet.

 

Adding RestaurantContentProvider to App Manifest

Finally, we need to register our content provider with the Android system by adding it to the app manifest.

<provider
            Android:name="com.example.restaurant.RestaurantContentProvider"
            Android:authorities="com.example.restaurant.provider"
            Android:enabled="true"
            Android:exported="true"></provider>

Code Snippet 3. Add RestaurantContentProvider to app manifest ++

The provider element has several options to customize content provider permissions and security. Please see the following link for more details.

http://developer.Android.com/guide/topics/manifest/provider-element.html

In code snippet 3, we have the exported flag set to ‘True’ so we can selectively share some restaurant app content with other apps on the device.

In the 2nd part of the article we will take a look at how the restaurant sample app leverages the Android sync adapter framework to achieve seamless data sync with the backend server.

  About the Author

Ashok Emani is a Software Engineer in the Intel Software and Services Group. He currently works on the Intel® Atom™ processor scale enabling projects.

 

Notices

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

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark* and MobileMark*, 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.

Any software source code reprinted in this document is furnished under a software license and may only be used or copied in accordance with the terms of that license.

Intel, the Intel logo, and Atom are trademarks of Intel Corporation in the U.S. and/or other countries.

Copyright © 2013 Intel Corporation. All rights reserved.

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

Optimization Notice

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel.

Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804

 

 

++This sample source code is released under the Intel OBL Sample Source Code License (MS-LPL Compatible)

MPX support in GCC 5.0

$
0
0

You can download latest Intel MPX Runtime library sources for Linux here:

Downloadmpxrt.zip

License is included into each source file.

Making Your Android* Application Login Ready Part I

$
0
0

Introduction

This two part series of articles will walk you through adding login capability to an Android* application; in this case our existing restaurant app. We want the customers, manager, and everyone in between to be able to log in and access features, content, and capabilities specific to their access level. Our restaurant application is designed to be a shared application installed on a tablet at a table and hence used by multiple people throughout the day. The default Android account manager is not designed to handle such shared public access, so we will implement our own account system. This series will walk you through setting up a login system in Android starting with the UI design and moving onto sending HTTP calls to our account manager server. The primary focus of this article will be on adding login capabilities and features specific to the restaurant owner, so that they can manage the application and users locally through the app. Part two of the series will cover sending and receiving HTTP calls.

Setup

The logins will be managed by a server that the Android application sends HTTP calls to communicate with. The calls going to the server will be handled asynchronously using AsyncTasks so as not to block the main UI thread. No information about users besides the currently logged in user will be stored on the device this way as the server will store all of the data. To get to the login screen, there is a user profile icon added in the action bar in the top right. 

Figure 1: Restaurant Application

Figure 2: Screenshot of the restaurant application’s manager portal

Login

Implementing a login screen itself is fairly easy; you need the login button, the login status, and then possibly a pop-up message that the user is now logged in. It is the edge cases and little details surrounding these that you have to watch out for and figure out how to handle.

The first thing to consider is how to layout the landscape view and portrait view. Consider Figure 3 below with the “login” and the “register” button. Putting them side-by-side in the landscape and then on their own separate line in portrait mode uses the screen real estate and space much better. There are still a lot of tweaks that can be done on the below to make them look even better, but it shows that just re-ordering can make a big difference in how your application is presented visually to the viewer. So create different layouts for your “res/layout-land” and “res/layout-port” to improve the user experience. 

Figure 3: Different sign-in view layouts

On the login form, we tell the user what to enter into the field using the “hint” attribute, then we make the input type a “textEmailAddress”  to pop up the proper keyboard, and finally we add “<requestFocus/>” at the end, so that the user email field is automatically selected and the keyboard pops up upon creation. 

<EditText
        android:id="@+id/email"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="@string/username"
        android:inputType="textEmailAddress"><requestFocus /></EditText>

Code Example 1: EditText in our layout xml for the email/username field

Additionally we want the keyboard’s “Done” key to trigger login as well as the “Login” button itself. So since the password field is the last EditText in our layout, the “Done” option will automatically appear. We set up a listener for it to trigger the sign in process. However we also don’t want a user to be able to trigger the login process multiple times. We can easily do this with the login button by disabling it, (mSignInButton.setEnabled(false);).  We could do the same with the password field as well but the field will be grayed out and that is not as visually appealing. So instead we will keep track of that login state with a mSignInProgress variable and make sure that login is not already in process (this will come in handy for another piece of logic later in this article). 

private static final int STATE_DEFAULT = 0;
private static final int STATE_IN_PROGRESS = 1;
private int mSignInProgress;

Code Example 2: Sign in progress and states

mPassword = (EditText) findViewById(R.id.userPassword);
mPassword.setOnEditorActionListener(new OnEditorActionListener(){
	@Override
	public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
		//Have the done button on keyboard trigger sign in
		if (actionId == EditorInfo.IME_ACTION_DONE && mSignInProgress!=STATE_IN_PROGRESS) {
			onClick(mSignInButton);
			//hide the keyboard
			return false;
		}
		return false;
	}
});

Code Example 3: Password button listening for keyboard “Done” click

 

So now that we have built our activity layout and added some logic when the user initiates the sign in process, what will happen when the user rotates the screen mid-login and the whole view is rebuilt? Everything is going to become enabled again and the instance to the login status’s TextView but our Buttons will be gone.  However our AsyncTask to log in will continue to run in the background, so the login process will proceed unhindered.

To fix the UI state on rotate, the first step is to make the layout fields static. Hence their instance will be retained when the device is rotated and we will be able to update them after rotating. 

private static Button mSignInButton;
private static Button mRegisterButton;
public static TextView mStatus;

Code Example 4: Static layout fields will retain their instance after onDes

Next we are going to want to save our login progress state in the saved state instance for when the view is destroyed. 

@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		outState.putInt(SAVED_PROGRESS, mSignInProgress);
	}

Code Example 5: onSaveInstanceState method to save the login progress

And retrieve it in onCreate and gray out the Buttons and set the login status accordingly. 

//Retrieve saved state for sign in progress
if (savedInstanceState != null) {
	mSignInProgress = savedInstanceState.getInt(SAVED_PROGRESS, STATE_DEFAULT);
}

//If in middle of sign-in, gray out the buttons
if(mSignInProgress==STATE_IN_PROGRESS){
	mStatus.setText(R.string.status_signing_in);
	mSignInButton.setEnabled(false);
	mRegisterButton.setEnabled(false);
}

Code Example 6: Get the saved state and update the UI

The above works fine when you are rotating an activity, but the register screen is a DialogFragment (see Figure 4). We can still do the same saved state instance and retrieve it in the onCreateView method instead, but to save the instance of our status and Buttons, the process is different.

In the onCreate method call the following 

setRetainInstance(true);

Code Example 7: Prevent a Fragment from being re-created

However, there is a bug in android that will dismiss the dialog on rotate when setRetainInstance is true, so override the onDestroyView method to prevent the dialog from being dismissed. 

@Override
	public void onDestroyView(){
		Dialog dialog = getDialog();
		if ((dialog != null) && getRetainInstance())
			dialog.setDismissMessage(null);
		super.onDestroyView();
	}

Code Example 8: Don’t dismiss a fragment onDestroyView

Since we have a status TextView on the fragment as well, we need to make sure it exists before we try and update the field when the AsyncTask completes its job. You can do this by checking if the fragment isAdded(). As the user may also tap away from the fragment or even exit the sign-in intent entirely, you can show a dialogue themed activity over whatever view the user has navigated away to (see Figure 5). To enable this you have to save the context of the DialogueFragment as it will be detached and hence the context normally null.

Create a static reference to the context in your class. 

static Context context;

Code Example 9: Static reference to context for when fragment is detached

Initialize it in the onCreate method:

context= getActivity().getApplicationContext();

Code Example 10: Save the Fragment’s context

Then put it all together in the onPostExecute of the register AsyncTask to inform the user that they have either been registered or there was an error. Part two will go more in-depth on the AsyncTask logic. 

@Override
protected void onPostExecute(String result) {
mRegisterProgress= STATE_DEFAULT;
	//if no errors
	if(result.equals("")){
		//fragment is visible and attached
		if(isAdded()){
			dismiss();
			//call came from manager access screen or from a regular log in?
			if(from.equals(MANAGER_LEVEL)){
		LoginManagerViewActivity.userManageStatus.setText(R.string.status_registered);
			}else{
							LoginViewActivity.mStatus.setText(R.string.status_registered);
			}
		//fragment not visible, display dialogue intent
		}else{
			Intent intent = new Intent(context, OrderViewDialogue.class);
			intent.putExtra(LoginViewActivity.DIALOGUE_MESSAGE, context.getResources().getString(R.string.status_registered));
						intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(intent);
		}
	//else there is an error
	}else{
		//fragment is visible and attached
		if(isAdded()){
		registerStatus.setText(String.format(getString(R.string.status_register_error,result)));
		//fragment not visible, display dialogue intent
		}else{
			Intent intent = new Intent(context, OrderViewDialogue.class);
			intent.putExtra(LoginViewActivity.DIALOGUE_MESSAGE, String.format(context.getResources().getString(R.string.status_register_error,result)));
			intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(intent);
		}
		register.setEnabled(true);
	}
}

Code Example 11: Handle result from the register HTTP server call

Figure 4: Register DialogFragment

Figure 5: Intent message that shows registration complete

Dynamic Navigation Drawer

When adding login capabilities to your application, we want the different users to be able to access various features specialized for their role. The manager especially can have a whole range of tools to help organize and run the restaurant, while the customer can have an account to earn rewards and coupons.

We will start with editing the navigation drawer on login to hide or show items by creating different string arrays in the “res/values/strings.xml” folder with the different titles for each type of user. 

<string-array name="drawer_titles_guest"><item>Main</item><item>Locations and Geofences</item><item>My Little Chef Club</item></string-array><string-array name = "drawer_titles_customer"><item>Main</item><item>My Coupons</item><item>Ordering history</item><item>Locations and Geofences</item><item>My Little Chef Club</item></string-array>

Code Example 12: Navigation drawer titles for a guest vs. a registered customer user

You can then reference the different drawer titles in the setUpNavigationDrawer() method using a switch statement based on user access level.

     if(currentUser==null){
        	mDrawerTitles = getResources().getStringArray(R.array.drawer_titles_guest);
        }else{
        	switch (currentUser.accessLevel){
        	case UserFactory.MANAGER_ACCESS:
        		mDrawerTitles = getResources().getStringArray(R.array.drawer_titles_manager);
        		break;
        	case UserFactory.SERVER_ACCESS:
        		mDrawerTitles = getResources().getStringArray(R.array.drawer_titles_server);
        		break;
        	case UserFactory.CUSTOMER_ACCESS:
        		mDrawerTitles = getResources().getStringArray(R.array.drawer_titles_customer);
        		break;
        	default:
        		mDrawerTitles = getResources().getStringArray(R.array.drawer_titles_guest);
        		break;
        	}
        }

Code Example 13: Initialize the naviation drawer depending on the user

Our navigation drawer’s onItemClick() method was also using hard coded position integer values to tell which title was clicked. Switching that to comparing the strings of the titles instead of the position will enable us to have a dynamic navigation drawer. 

    /**
     * This method is called when the user selects an item from navigation drawer
     */
    public void onItemClick(AdapterView<?> parent, View view, int position,
                            long id) {
        mDrawerList.setItemChecked(position, true);
        mSelectedDrawerIndex = position;
        mNavigationDrawer.closeDrawer(mDrawerList);

        String selectedTitle = mDrawerTitles[position];
        if (selectedTitle.equals("Locations and Geofences")) {
            Intent intent = new Intent(this, GeolocationActivity.class);
            startActivity(intent);
        } else if (selectedTitle.equals("Charting")) {
            Intent intent = new Intent(this, ChartingActivity.class);
            startActivity(intent);
        }else if (selectedTitle.equals("My Little Chef Club")) {
            Intent intent = new Intent(this, LoyaltyMembershipActivity.class);
            startActivity(intent);
        }
    }

Code Example 14: Navigation drawer compares titles instead of position to tell what is clicked

After that write a simple handler interface for the main activity to implement with a method that will call setUpNavigationDrawer() again. Then from inside the class that handles the login logic, initialize the handler, and trigger the callback when the user logs in. The only things to watch out for are that if the login call is made on a AsyncTask like ours is, then the handler needs to be initialized to use the main thread’s looper to get access to the navigation drawer (new Handler(Looper.getMainLooper())). And the next thing to remember is to call it again once the user logs out.

In-App Menu Editing

On login we want the manager to be able to quickly edit the menu in-app without having to go to an external source. So the menu fields need to appear as TextViews to the customer, but as EditText to the manager. There are a number of different ways to handle this and this article will discuss how to hide them in plain sight.  

When the view is created, we will change each EditText view to look like a TextView by making the background null and disabling them. And then when the manager logs in, re-enable them and set the background back to make them easily identify as editable. 

public void editTextPermission(boolean allow) {
		mTitle.setEnabled(allow);
		mDescription.setEnabled(allow);
		mNutrition.setEnabled(allow);
		mPrice.setEnabled(allow);
		if(allow){
			mTitle.setBackgroundResource(android.R.drawable.editbox_background_normal);
			mDescription.setBackgroundResource(android.R.drawable.editbox_background_normal);
			mNutrition.setBackgroundResource(android.R.drawable.editbox_background_normal);
			mPrice.setBackgroundResource(android.R.drawable.editbox_background_normal);
		}else{
			mTitle.setBackground(null);
			mDescription.setBackground(null);
			mNutrition.setBackground(null);
			mPrice.setBackground(null);
		}
	}

Code Example 15: Call to change EditText to have TextView or normal EditText behavoir

The EditText view will also need some more parameters set when it is first being initialized. The view is going to use the “Done” action on the keyboard as the trigger of when the manager is finished updating the field and ready to commit it to the menu. However when the field is setup with the IME_ACTION_DONE, it makes the field only able to be one line as we have replaced the next line option with the done option. We do not want the text field to scroll horizontally, so we will have to counter this by setting horizontal scrolling to false and setting the number of lines to the maximum possible. This way when the manager enters in a string longer than the screen, it will automatically wrap around as a new line underneath. Below is a generic edit text initialization method with all the logic so the class wouldn’t have the same code repeated over and over again for all four EditText fields. Its inputs are the EditText variable and the string that represents the menu item’s attribute with which it is being filled. For example, the item’s title would be initialized by calling setupEditText(mTitle, RestaurantDatabase.MenuColumns.NAME);.

//set up the EditText field
//takes in the EditText and the corresponding database column name as the update field
	public void setupEditText(final EditText text, final String updateField){
                text.setImeOptions(EditorInfo.IME_ACTION_DONE);
		text.setHorizontallyScrolling(false);
		text.setMaxLines(Integer.MAX_VALUE);
		text.setOnEditorActionListener(new OnEditorActionListener(){
			@Override
			public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
				if (actionId == EditorInfo.IME_ACTION_DONE) {
					String newString= text.getText().toString();
					//we stored original string as the tag when we first set it, hence we can get the old value easily
					String oldString= text.getTag().toString();
					//unique key identifier of the item
					String titleText= mTitle.getTag().toString();
					//update the database for the server
					RestaurantDatabase dB= new RestaurantDatabase(getActivity());
					dB.updateMenuDatabase(titleText,newString,oldString,updateField);
					//update our local menu list
					MenuFactory mMenuCurrent= MenuFactory.getInstance();
					mMenuCurrent.updateMenuItem(mCurrentItem.category,titleText,oldString,newString,updateField);
					//reset the tag as the new string
					text.setTag(newString);
					dismissKeyboard();
					return true;
				}
				return false;
			}
		});
	}

	public void dismissKeyboard(){
		InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        View view = getActivity().getCurrentFocus();
        if (view != null) {
            inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
        }
	}

Code Example 16: EditText logic to update the menu

For the final touch, we do not want the keyboard to pop up by default, and instead only pop up when the manager actively taps on the EditText to change it. The EditText is going to steal the focus by default when the activity or fragment starts, so the main layout needs to be set to command the focus. 

android:focusable="true"
android:focusableInTouchMode="true"

Code Example 17: Make a UI element the focus 

Figure 6: Editable menu for the manager 

Summary

This article has gone over how to add login UI logic to your application and add some tweaks for different user access levels for the navigation drawer and in-app menu editing for the manager. Part two of this series will go into depth about how to handling HTTP calls to and from a server to handle the user login logic.

 

References

Building Dynamic UI for Android* Devices

About the Author

Whitney Foster is a software engineer at Intel in the Software Solutions Group working on scale enabling projects for Android applications.

 

*Other names and brands may be claimed as the property of others.
**This sample source code is released under the Intel Sample Source Code License Agreement

 


What is new with IDE Integration for Android* 1.5.7 update in Intel® INDE (Windows* host)?

$
0
0

Overview

IDE Integration for Android* provides productivity-oriented design, coding, and debugging tools
for applications targeting Android* on ARM* and Intel® architecture (x86) devices, including
smartphones and tablets. The tools are compatible with Android Studio*, Microsoft* Visual
Studio* and Eclipse* and support popular Android SDKs including the Android* Native
Development Kit (NDK).

What is new in the IDE Integration for Android* 1.5.7?

  • Updated Intel® Hardware Accelerated Execution Manager (Intel® HAXM) to 1.1.1
  • Add 64 bit Guest Support - Able to boot 64 bit Kernel and User space

Check the Release Notes for a full set of features.

For additional questions please check INDE Support page or post your questions in the forum

 

HTML5 Web App Using Intel® XDK

$
0
0

HTML5 Web App Using Intel® XDK

 

Introduction

Intel® XDK allows developers to build Web and Hybrid apps using web technologies HTML5, JavaScript, and CSS3 for multiple platforms. Developers can write one app that can run cross-platform and on mobile devices with no modification. Intel® XDK supports all major target platforms - Microsoft Windows*, OS X* and Ubuntu* Linux*. The tool provides developers a complete workflow for developing, debugging, testing and deploying their apps on the target platform based devices.

Intel® XDK is a great tool for beginners and experienced developers alike, and provides a simplified workflow to enable developers to easily design, build, and deploy Web and Hybrid apps across multiple app stores and form factor devices. Developers can either start with a blank project, or work with an existing demo or other templates. Editing is supported via the open source HTML5 Brackets* editor. The HTML5 Brackets* editor provides several convenient features like auto completion and provides all relevant development lifecycle tools for developing, debugging, building and testing apps.

This document demonstrates users how to create a native Web application using HTML5, JavaScript and CSS3 for new users. It will outline how to install the Intel® XDK, create a simple log-in form project, style it, and test it on the emulator.

The code developed for this article will be used in the future to provide web based access to the resources used in the Restaurant app referred to in several articles from other team members.

Some references to those articles are:

  1. Adding Search Capabilities
  2. Using a Database With Your Android* App
  3. Developing Android* Business Apps Using NFC Host-based Card Emulation Capabilities

 

Intel® XDK Installation

Download and install the latest version of the Intel® XDK at  http://xdk-software.intel.com. The tool is provided free of charge. You will need to create an Intel® XDK account to launch and test your app on a real device. For a tutorial on how to run the app on a real device, visit    Get Started with the Intel® XDK. An account is not required if you are using the emulator from the Intel® XDK to test your app.

 

Create a Blank Project

You can start a project using the templates, demo or a blank project. The tool includes a streamlined workflow, which guides developers through the development, testing, debugging and deployment phases of app development. The text editor on the “Develop” tab is based on the Brackets* editor, where you edit your app. Intel® XDK documentation has detailed instructions on how to use each tab of the workflow.

Figure 1: Starting a new project

 

Figure 2: Creating a blank project

 

Create a Log-in Form using HTML5, JavaScript and CSS3

You are now ready to edit your index.html to create the log-in form. First, you need to start with an opening form element tag. The input type for user name and pass word are text with placeholder. Placeholder describes the expected value of the input field.

<form action="" method="post" name="login" class="little-chef-form"><label><span>Username:</span><input type="text" name="username" placeholder="Username" id="username" /></label><label><span>Password:</span><input type="password" name="password" placeholder="Password" /></label></form>

Code Example 1: Log-in form in HTML5 **

 

Figure 3: Layout of log-in form in Emulator

 

The next input type is button. Once the user clicks the log-in button, JavaScript validateForm() will be invoked to validate the log-in form. You can use HTML5 to validate the log-in form but it is better to use JavaScript since some of the HTML5 attributes are limited to the latest browsers.

<label><span>&nbsp;</span><input type="button" class="button" value="Login" onclick="return validateForm()" /></label>

Code Example 2: Input button in HTML5 **

 

Here is an example of using JavaScript to validate the form. A JavaScript file must be saved with the .js extension.

function validateForm() {
    var formUsername = document.forms.login.username.value;
    var formPassword = document.forms.login.password.value;

    // Validate username and password
    if (formUsername === null || formUsername === "") {
        alert("Username must be filled out");
    }
    else if (formPassword === null || formPassword === "") {
        alert("Password must be filled out");
    }
    else if (formUsername.length < MINLENGTH || formPassword.length < MINLENGTH) {
        alert("The minimum length of username and password at least " + MINLENGTH);
    }
    else {
        // Call api function to check whether the username and password exist in the server
        return;
        }
        alert("Login failed!!!");
    }

Code Example 3: Validate form in JavaScript **

 

If the user failed to log in, clear the form and give the user number of time to try. If the user successfully logged in, clear and disable the form as below.

function clearAndDisableForm(form) {
    if (form == formType.LOGIN_FORM) {
        // Clear the form
        document.forms.login.username.value = '';
        document.forms.login.password.value = '';
        // Diabled the form
        document.forms.login.username.disabled = true;
        document.forms.login.password.disabled = true;
    }
}

Code Example 4: Clear and disable form in JavaScript **

 

Link to an external script file “js/Login.js” using script tag and the source attribute from index.html.

<script src="js/Login.js" type="text/javascript"></script>

Code Example 5: Script tag

 

A complete example of a HTML5 log-in form is shown below:

<html><head><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="styles.css" media="screen" /><title>Little Chef Login</title><script src="js/Login.js" type="text/javascript"></script></head><body><form action="" method="post" name="login" class="little-chef-frm"><h1>Little Chef Log in<span>Please login or sellect other options </span></h1><label><span>Username:</span><input type="text" name="username" placeholder="Username" id="username" autofocus required /></label><label><span>Password:</span><input type="password" name="password" placeholder="Password" /></label><label><span>&nbsp;</span><input type="button" class="button" value="Login" onclick="return validateForm()" /></label><label><span>&nbsp;</span><input type="button" class="button" value="Reset Password" onclick="return resetPassword()" /></label><label><span>&nbsp;</span><input type="button" class="button" value="Register New User" onclick="return registerNewUser()" /></label></form><table id="myTable"></table></body></html>

Code Example 6: Complete example of a log-in form in HTML5 **

 

To style the way the log-in form looks, use CSS3. The most common ways of inserting a style sheet are external, internal and inline. An external style sheet is ideal to style many web pages. Each page must include a link to the style sheet with the <link> tag inside the head section.

<head><link rel="stylesheet" type="text/css" href="styles.css" media="screen" /></head>

Code Example 7: External style sheet tag

 

To add a 1 pixel light gray border around the input text and input password fields, use “border: 1px solid #CCC“.  With six-digit hexadecimal color values, you can style the color of the text, background, and the border. Default value is #000000. You can also use color names such as red, green, and blue and more, or the HTML color picker. One way to use pixel to specify the width of the field is “line-height:15px”. It also specifies the space between the lines in two paragraphs.  With “margin-bottom: 16px” you can change the bottom margin of the field. Similarly, margin-right and margin-top will define the right and the top margin of the field.

.little-chef-form input[type="text"], .little-chef-form input[type="password"], .little-chef-form select{
    border: 1px solid #CCC;
    color: #888;
    background-color: #000000

    line-height:15px;
    margin-bottom: 16px;
    margin-right: 6px;
    margin-top: 2px;
}

Code Example 8: Input field style in CSS3 **

 

The example below styles the way the button looks. It specifies the background color, button text color, and the border. To style the shape of the button, use border-radius. “padding: 4px 25px 4px 25px” will specify the size of the button.

.little-chef-form .button {
    background: #EEE;
    border: 1px solid #DDD;
    padding: 4px 25px 4px 25px;
    color: #333;
    border-radius: 4px;
}

    Code Example 9: Button style in CSS3 **

 

Test in the Emulator

The Emulate tab is used to test the functionality and layout of your app on a collection of virtual mobile devices. The default is Motorola Droid 2 with Android based devices.

Figure 4: Log-in form in Emulator

 

After successfully creating a log-in form and testing it on the emulator, you can try to create the reset password and new user registration form.

Figure 5: Password reset

 

Figure 6: New user registration

 

Summary

Intel® XDK is an integrated front-to-back HTML cross platform app development tool. The various tabs at the top guide the developers easily through the various development tasks. The tool makes it very easy for developers to develop and deploy their applications to one or multiple supported app stores. This document also demonstrates to new users how to use Intel® XDK to create a native Web application.

 

About the Author

Nancy Le is a software engineer at Intel in Software and Services Group working on the Intel® AtomTM processor scale enabling projects.

 

References

HTML5 training: http://software.intel.com/html5

 

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

**This sample source code is released under the Intel Sample Source Code License Agreement.

Intel® Active Management Technology (Intel® AMT) in the Cloud Computing Paradigm

$
0
0

Introduction

Back in 2006 Intel introduced the Intel® vPro™ brand which included as an ingredient Active Management Technology (AMT).  Back then AMT was basically a desktop technology based on wired LAN Networking.  Over the next few years AMT was enhanced to include mobile platforms with wireless networking   Another feature included to enhance the mobile experience was Client Initiated Remote Access, or CIRA, Fast Call for Help.   CIRA allows AMT features to be securely accessible to management consoles while outside the corporate networking environment.  This feature being important for mobile platforms since these platforms would be used both inside and outside the corporate environment. Moreover, another industry trend has develop and matured since the early days of AMT and that is of cloud computing.   While CIRA was not developed specially to address the cloud computing paradigm, it can be used to enable AMT platforms to be managed and supported in a cloud computing environment.  The purpose of this article is to show how the CIRA feature can be used to securely manage AMT platforms in such environment.  The content used for this article is based on a .NET Proof of Concept Intel has developed internally based on Microsoft* Azure.  Although .NET and Azure were used for the PoC, the concepts and ingredients can be implemented in Amazon Web Services or any Cloud based fabric supporting similar concepts and architecture.

Ingredients of an AMT cloud computing solution

Typically, management consoles act as a client by initiating a connection to AMT devices. In this case the AMT devices acts in the role of a server (e.g.  Hosting an embedded https server in the firmware) and the ISV software pays of the role of a client.    On the other hand, when CIRA is being used, the firmware acts as the client and instates the connection to server.  The server the firmware connects to is known as a Intel® vPro™ Gateway (also known as a Management Presence Server, or MPS).     Hosting an MPS with a cloud service provider such as Microsoft Azure or Amazon Web Services can then bring AMT features into the cloud.  So the ingredients of an AMT cloud computing solution becomes the following:

  • AMT  firmware configured to use CIRA
  • Cloud hosted MPS
  • Cloud Queue service
  • ISV software services that support AMT features when reported to be connected via the Queue Service

 cloud mps figure 2

The MPS

From the above diagram we can see the MPS plays the central role in the solution and so we will discuss it first.   The MPS is a service that implements both external facing and internal facing interfaces.   AMT devices use the external facing interface which is based on the AMT Port Forwarding (APF) Protocol. The firmware, running on the AMT clients, use this protocol to exchange messages with the MPS.  The APF protocol is described in the SDK and can be implement in C++ or managed code such .C#/.NET or Java.   Multiple instances of an MPS can be hosted behind a load balancer providing scalability resource elasticity common to cloud computing platforms.   In addition, there are a few internal facing interfaces to each instance of the MPS and they include a standard HTTP proxy and a SocksV5 proxy for handing AMT requests in the internal cloud network.   Finally, the MPS publishes connections to a reliable cloud queue storage and ISV working applications can pull the queue service for the published connections and services them.  Now we will examine each MPS interface in more detail to see how messages are exchanged between AMT devices and ISV services through the MPS and the queue.

The External Interface

All the AMT devices are configured with the IP address and port of the cloud service.   The external interface is a secure TLS connection and for scalability each device can be routed to a specific MPS instance through a network load balancer.  Each MPS instances can handle many concurrent connections and to scale you just bring up more instances.   Some load balancers automatically terminate the TLS connections at the load balancer and each MPS instance would be running in an isolated VM network after the load balancer.  In case of Azure, each MPS instance terminates the TLS connection itself.  In the PoC we used the .Net SslStream class to handle TLS directly inside the MPS.

cloud mps figure 1\

The Internal Interfaces

Once a connection is received by the MPS, ApfConnection object is constructed with all the device info such as SystemGUID and device host name,  then an ApfChannel instance is created to service each port the device is listening on (e.g. 16992/16993,16994/16995,5900).  Once a connection and all of its channels are created this information published to the storage queue.   ISV applications can then pull the queue and service the connection by sending AMT commands through the internal proxy interfaces.  The HTTP proxy is for WS-MAN commands and the SocksV5 proxy is for redirection commands (e.g. KVM,IDER).   The AMT host name is provided as part of the proxy handshake and that is used to look up the ApfConnection object associated with the connection.  Once the ApfConnection is found then then messages can be routed over the specific ApfChannel and eventually make it to the AMT device over the channel.

MPS figure 3

Queue Storage

Both Windows Azure and Amazon Web Services support the concept of Storage Queues.   Queues allow a reliable way for one application (in this case the MPS) to publish work for another application to pick up and perform (in this case an ISV hosted application).  Many MPS instances can be publishing connections to the storage queue while many ISV worker instances can be pulling connections off the queue and servicing them.   Once a connection is pulled from the queue an ISV application can now perform AMT specific tasks using the internal proxy interfaces.   The connection information pulled from the queue will contain the MPS proxy address and port as well as the AMT device host name.

 

The APF Protocol

APF messages fall into the following categories:

  • Transport Layer Messages (e.g. connect, disconnect, keep alive, version, service request)
  • Authentication Messages (Optional).   When connections are made using Mutual TLS then the client supplied certificates is used for authentication and authentication messages are not used.  Otherwise, there can be a user name password exchange for TLS server authentication.
  • Port forwarding messages-setups the connection
  • Channel messages – channels are were data is sent to and received from  a specific port AMT(e.g. 16993,16995,5900)

Problems address by the cloud computing paradigm

There are two main challenges addressed by using the cloud computing paradigm to manage AMT devices.  First, is that of scalability were the number of clients that can be managed is just a function of the cloud computing resources one is willing to deploy.  The second is discoverability, in the cloud paradigm AMT calls home to its cloud service on regular intervals and so there is no need for ISV apps to “discover” were AMT is located.  As we can see cloud computing offers some unique advantages and that it is possible for AMT to participate in this evolving industry trend.

Additional links

The Intel logo is a trademark of Intel Corporation in the U.S. and/or other countries.

Murl Engine* Cross-Platform Development Tool with Android* x86 Support

$
0
0

By Wolfgang Moser, Spraylight GmbH

The Cross-Platform Challenge

The late 1980s marked the end of the home computer era and the beginning of the unique success story of the IBM PC and Microsoft Windows*. A crowded computer landscape with various different computer systems, architectures and operating systems was replaced by the uniform personal computer. For a long time developers could ship their applications just on Windows and reach more than 95 percent of their mainstream customers. The introduction of the iPhone* and other new mobile devices disrupted this dominant position and substantially changed the computer landscape.

In 2012 smartphones outsold PCs two to one, and it is expected that in 2014 the number will increase to four to one [1]. The adoption of new mobile devices is happening ten times faster than the PC boom [2]. The tremendous success of smartphones and tablets has led again to a fragmented market with a lot of different devices and different form factors. For the foreseeable future there will be no dominant mainstream platform, and companies need to prepare themselves for this challenge.

Almost every industry is to some degree affected by this rapid technology shift. Companies are forced to react quickly and adjust their strategies and products to the changing market in order not to fall behind their competitors. Software developers are required to support multiple operating systems like Android*, iOS*, Windows, and OS X* and different processor architectures like Intel® architecture (IA-32/x86) and ARM* to just cover the most popular notebooks, smartphones, and tablets.

Supporting multiple platforms is a challenging task. Each platform has its own API, preferred programming language, and, even, quirks. If done naively by implementing separate apps for each platform, development and maintenance costs become prohibitively expensive. Maintaining three or four code bases can result in feature skew where different features are supported on different platforms and multiple bug databases are necessary. Development teams with expertise in different languages and other redundancies are required.

It is therefore not a surprise that cross-platform tools are booming nowadays. However, selecting the right tool is not easy. A lot of tools with different approaches are available on the market. Obviously not every tool is suitable for every purpose. Depending on the type of application, one cross-platform solution may be a better fit or may not fit at all. Additionally many tools offer great promises that don’t hold true, and it is difficult to filter the actual important features from the marketing buzz. In the end, every team has to define their own tool requirements and choose wisely. In our view, two indispensable quality characteristics deserve special attention and these are flexibility and controllability.

Most tools have a steep learning curve so you want a tool flexible enough to use for most projects. Project requirements often change and new features are requested; hence, your tool must be flexible enough to add new features. Additionally it is crucial that you keep full control over your project. You don’t want to lose ownership and be at the mercy of a third-party tool. If these qualities are important to you, you may want to take a closer look at Spraylight’s Murl Engine. It was designed with portability, efficiency, flexibility, and controllability as its topmost design goals.

Murl Engine Primer

The Murl Engine is a fresh and free solution for cross-platform development. It is focused on games and multimedia applications and is currently supporting Android, iOS, Windows, OS X and Linux* platforms. The intention, when designing it, was to create a tool set that enables developers to develop rich multimedia applications fast and easy without limiting or restricting them.

The Murl Engine is not a typical WYSIWYG game engine, but instead a flexible coders’ framework. It is slightly more low level and offers more flexibility and control. The framework provides an abstraction API, a powerful scene graph framework, optional add-on components, and a set of tools. The source code is provided for large parts of the framework so you can extend and adapt it as needed. Licensing the full source code is possible too. The application code compiles directly to pure native binaries, so VMs and runtime environments are not necessary, providing raw native performance.

C++ Language

When deciding the basic technology, C++ was a natural choice. Inexperienced users are sometimes afraid of C++ and deem it complicated and outdated, but it’s definitely not. C++ is a modern and efficient programming language and the primary language used in professional game development. It is a proven technology and the only way to create really portable native code.

C++ enables you to write efficient code with a modern, object-oriented language. Additionally it allows you to always open the hood and take control over more advanced features like memory layouts, processor instructions, optimizations, etc. when needed. Most of the time it is not needed, but it’s good to know, that you can if wanted or forced to. This is especially important on mobile platforms where you need to do more with less hardware and less power and for multimedia applications and games where power and performance are paramount.

Probably the most important feature of C++ is portability. It is the only modern language where you can write a single source code base for any kind of demanding app and be able to natively target all platforms. Every platform has a C++ compiler and new upcoming platforms will have it too. Therefore this approach is not only portable but also future proof.

It was obvious to choose C++ as the main programming language for the Murl Engine, and we never regretted our choice. Only the platform abstraction layer had to be developed in other programming languages.

It is worth noting that some of today’s most successful cross-platform apps like Dropbox, MS Office*, King games, etc. are built using the same approach with a common C++ code base and platform-specific adoption layers.

Murl Engine Architecture

As shown in Figure 1, the Murl Engine’s architecture is divided into different layers. The lowest layer is the platform abstraction layer which, as the name implies, performs the platform abstraction. One individual platform abstraction module exists for each platform. Depending on the platform requirements the platform code has been written in C, C++, Objective-C*, and Java*. This layer provides a homogenous C++ interface that can be used by higher layers.


Figure 1. Murl Engine* Architecture

The framework layer provides all the features that are needed to develop decent multimedia applications and has been developed in portable C++. Basically it is a time-based scene graph framework including support for 2D and 3D rendering, OpenGL ES*, and DirectX* graphic APIs, resource management, input handling, physics, audio, networking, scripting, fast container classes, etc. A detailed feature list can be found here. Optional add-ons like the Vuforia* augmented reality toolkit, the Facebook* add-on, or custom add-ons can be used to enlarge the feature set.

Application development (“user code”) is usually written in C++. Additionally Lua*, a popular scripting language, can be used for development.

The Murl Engine comes with a set of useful tools, like the Dashboard, to manage projects and the Atlas Generator to create texture atlases. Another tool, called “Werkbank” (Figure 2), to be released shortly, is a graphical scene editor with live preview that can be used to create and edit scene graphs and resource packages. Another very nice feature is an integrated shader editor that allows you to develop and preview vertex and fragment shaders for OpenGL ES (GLSL) and DirectX 11.1 (HLSL).


Figure 2. Murl Engine* Werkbank

Werkbank utilizes the cross-platform widget toolkit Qt for the user interface and is running several instances of the Murl Engine as preview widgets. This is another good example of Murl Engine’s flexibility.

Developing with the Murl Engine

To start developing simply download the Murl Engine from the website http://murlengine.com. It’s free and no registration is required. There’s only one version and it comes with all features. The download package also has the source code and the project files for the tutorials included.

The provided Dashboard (Figure 3) is a convenient tool for managing your project files and creating builds for the Android platform. It can be used to easily open a tutorial project or to create a new project.


Figure 3. Murl Engine* Dashboard

Basically any available C++ IDE can be used for application development. However, the framework's support for project creation and maintenance is currently only provided for Microsoft Visual Studio*, Apple Xcode*, and the Android SDK/NDK toolset. Development and testing can largely be done in a desktop environment using familiar tools. This guarantees fast edit-build-test iteration cycles and minimizes cumbersome work with emulators and target devices.

The first beta build of the Murl Engine was released on March 3, 2013. Even in beta status, Murl Engine is ready for professional application development. The very successful, top grossing app, “Slots - Pharaoh’s Way” with more than 10 million downloads, more than 10 billion games played, and few technical complaints, is a good example of the stability and the maturity of the Murl Engine.

Android x86 Support

The best thing when owning a highly portable C++ code base is that supporting new architectures or new platforms is a piece of cake. Providing support for Android x86 was a breeze.

As mentioned above, we are using the Android SDK/NDK toolset for Android builds. The NDK already provides support for Android x86 via the APP_ABI attribute. So we just had to add the right parameter and recompile the whole framework. You can find a more detailed discussion about adding Android x86 support and performance improvements in this blog post.

To enable Android x86 support for a Murl Engine-based app, the parameter MURL_ANDROID_CPUS in the common Makefile needs to be set accordingly, e.g.:


MURL_ANDROID_CPUS := armeabi
MURL_ANDROID_CPUS += armeabi-v7a
MURL_ANDROID_CPUS += x86


The specified values correspond to the values of the APP_ABI parameter of the Android NDK build environment (ABI is short for "Application Binary Interface").


armeabi         ARM-based CPUs that support at least the ARMv5TE instruction set
armeabi-v7a     ARM-based CPUs that support ARM Architecture v7-a instruction set
                	with Thumb-2 instructions und VFPv3-D16 hardware FPU.
x86             x86-based CPUs. The NDK build uses the following gcc flags:
	               	-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32


You can directly edit the common Makefile in a text editor, or it’s probably more convenient to use the Android -> Configure Project command on the Dashboard (see Figure 4).


Figure 4. Configure Android* Settings

Conclusion

Cross-platform application development is more important than ever. Good cross-platform solutions like the one presented here, Murl Engine, can massively lower the burden of development and reduce development costs. Adding native support for x86-powered Android devices to the Murl Engine was easy due to the highly portable code base and the already available x86 support of the Android NDK. Using this feature in Murl Engine-based apps is hassle-free and leads to a substantial performance gain on Android devices powered with Intel® Atom™ processors.

About the Author

Wolfgang Moser is a computer enthusiast with 10+ years of professional experience and a strong background in embedded computing. He is co-founder and managing director of Spraylight GmbH, a 2011 founded company focusing on multimedia and mobile development. He previously worked in a variety of fields including electronic engineering, firmware development, algorithm design, real-time rendering and management. Wolfgang holds an MSc degree in Information and Communications Technology from Graz University of Technology.

[1]http://www.gartner.com/newsroom/id/2791017

[2]http://www.flurry.com/bid/88867/iOS-and-Android-Adoption-Explodes-Internationally

Intel® INDE 2015: support of Android* OS 5.0 ("Lollipop")

$
0
0

Introduction

Google* has recently released "Lollipop", Version 5.0 of the Android* OS (others may know this OS by its original name, "L-dessert"). Besides significant new features, Lollipop is the first 64-bit capable Android* OS.

Intel understands the importance of this major Android* OS release to our customers, and is making support of this OS a top priority.

Detailed Lollipop Support Information

  • Lollipop 32-bit apps: At this time, our primary focus is allowing customers to create and debug/analyze 32-bit apps that will run on either L-32 (Lollipop 32-bit OS) or L-64 (Lollipop 64-bit OS), and many of the tools already provide this support. The table below shows which Intel INDE tools support the creation of 32-bit apps on either the L-32 or L-64 platforms.
  • Lollipop 64-bit apps: We are updating the Intel INDE components to enable you to create and debug/analyze 64-bit apps -- this work is "in progress".
Lollipop support by the various Intel INDE components (for creating and debugging/analyzing 32-bit apps)
Component NameL-32 / L-64 SupportNotes
Intel® IPPyes / yesFull support.
Intel® HAXM*yes / yesBe sure to install the Intel® IDE Integration Update available through Intel® Software Manager (ISM).
IDE Integration for Android*yes / yesFull support.
Debugger Extension for VS-Androidyes / yesFull support.
Context Sensing SDKyes / TBDFull support for L-32; L-64 support is still being verified.
Note that the Context Sensing SDK is not applicable for the Google* Nexus* Player (Android* TV).
Intel® TBByes / TBDFull support for L-32; L-64 support is still being verified.
OpenCL™ Code Builderno / noSupport is still being verified.
Intel C++ Compilersyes / TBDFull support for L-32; L-64 support is still being verified.
Graphics Performance Analyzers (GPA):
System Analyzer,
Graphics Frame Debugger,
Graphics Frame Analyzer,
Platform Analyzer
no / no

Kernel changes in Lollipop require additional work for full support.

Media for Mobileyes / yesFull support.
Media SDK for Windows*,
Audio for Windows*,
Media RAW Accelerator for Windows*
(not applicable)Tools only support the Windows* OS.
For Android* support, see Media for Mobile above.

 

Next Steps...

This article has described how each of the components of the Intel INDE product support the latest Android* OS, Version 5.0 (aka "Lollipop" or "L-dessert"). As new information is available, Intel will update this article to notify you of any changes.

If Lollipop support presents a significant issue for your product development plans, please send us an email or leave us a note at the Intel INDE Support Forum.

Open Source Downloads

$
0
0

This article makes available third-party libraries, executables and sources that were used in the creation of Intel® Software Development Products or are required for operation of those. Intel provides this software pursuant to their applicable licenses.

 

Required for Operation of Intel® Software Development Products

The following products require additional third-party software for operation.

Intel® Parallel Studio XE 2015 Composer Edition for C++ Windows* and
Intel® System Studio 2015 Composer Edition for Windows*:

The following binutils package is required for operation with Intel® Graphics Technology:
Downloadbinutils_setup.zip
Please see Release Notes of the product for detailed instructions on using the binutils package.

The above binutils package is subject to various licenses. Please see the corresponding sources for more information:
Downloadbinutils_src.zip
 

Used within Intel® Software Development Products

The following products contain Intel® Application Debugger, Intel® Many Integrated Core Architecture Debugger and/or Intel® JTAG Debugger tools which are using third party libraries as listed below.

Products and Versions:

Intel® Composer XE 2013 SP1 for Linux*

  • Intel® C++ Composer XE 2013 SP1 for Linux*/Intel® Fortran Composer XE 2013 SP1 for Linux*
    (Initial Release and higher; 13.0 Intel® Application Debugger)

Intel® Composer XE 2013 for Linux*

  • Intel® C++ Composer XE 2013 for Linux*/Intel® Fortran Composer XE 2013 for Linux*
    (Initial Release and higher; 13.0 Intel® Application Debugger)

Intel® Composer XE 2011 for Linux*

  • Intel® C++ Composer XE 2011 for Linux*/Intel® Fortran Composer XE 2011 for Linux*
    (Update 6 and higher; 12.1 Intel® Application Debugger)
  • Intel® C++ Composer XE 2011 for Linux*/Intel® Fortran Composer XE 2011 for Linux*
    (Initial Release and up to Update 5; 12.0 Intel® Application Debugger)

Intel® Compiler Suite Professional Edition for Linux*

  • Intel® C++ Compiler for Linux* 11.1/Intel® Fortran Compiler for Linux* 11.1
  • Intel® C++ Compiler for Linux* 11.0/Intel® Fortran Compiler for Linux* 11.0
  • Intel® C++ Compiler for Linux* 10.1/Intel® Fortran Compiler for Linux* 10.1

Intel® Embedded Software Development Tool Suite for Intel® Atom™ Processor:

  • Version 2.3 (Initial Release and up to Update 2)
  • Version 2.2 (Initial Release and up to Update 2)
  • Version 2.1
  • Version 2.0

Intel® Application Software Development Tool Suite for Intel® Atom™ Processor:

  • Version 2.2 (Initial Release and up to Update 2)
  • Version 2.1
  • Version 2.0

Intel® C++ Software Development Tool Suite for Linux* OS supporting Mobile Internet Devices (Intel® MID Tools):

  • Version 1.1
  • Version 1.0

Intel AppUp™ SDK Suite for MeeGo*

  • Initial Release (Version 1.0)

Used third-party libraries:
Please see the attachments for a complete list of third-party libraries.

Note: The packages posted here are unmodified copies from the respective distributor/owner and are made available for ease of access. Download or installation of those is not required to operate any of the Intel® Software Development Products. The packages are provided as is, without warranty or support.

What is new with IDE Integration for Android* 1.2 Update in Intel® INDE (OS X* host)?

$
0
0

Overview

IDE Integration for Android* provides productivity-oriented design, coding, and debugging tools
for applications targeting Android* on ARM* and Intel® architecture (x86) devices, including
smartphones and tablets. The tools are compatible with Android Studio*, Microsoft* Visual
Studio* and Eclipse* and support popular Android SDKs including the Android* Native
Development Kit (NDK).

What is new in the IDE Integration for Android* 1.2?

Update available for Intel® INDE IDE Integration. This update includes support for Yosemite Apple OSX* 10.10 and extends Intel® HAXM support to 64-bit development.

Check the Release Notes for a full set of features.

For additional questions please check INDE Support page or post your questions in the forum


Some Helpful Tips For Graphics Analysis and Optimization on Android*

$
0
0

If you’re developing a graphics-intensive application and you’re not satisfied with the performance, read on for what to do to improve it.

Pre-work

The first step to do when analyzing performance is to check whether your application is CPU or GPU bound. You can use Graphics Performance Analyzers (GPA) to do that.

GPA is a tool for graphics analysis and optimization of Microsoft DirectX* applications and Android* OpenGL ES* applications. You can find more about it here: https://software.intel.com/en-us/articles/gpa-which-version.

You can also find a simple intro here: https://software.intel.com/en-us/android/articles/using-the-intel-gpa-system-analyzer-to-improve-android-apps

For purposes of Android optimization I prefer GPA console client. You can read about it here: https://software.intel.com/en-us/android/articles/using-intel-graphics-performance-analyzers-console-client-for-android-application

  • If you discover that your application is GPU bound, continue using GPA.
  • If your application is CPU bound, use Intel® VTune™ Amplifier for Android. You can read more here: https://software.intel.com/en-us/node/496918
  • If your app is CPU and GPU bound, use GPA Platform Analyzer.
     

    How to determine it?

    Check FPS metric. While chacking it go to “state overright” and disable “draw calls”. If you do collect FPS with disable “draw calls” it means that only CPU part is working. So, you have to analyze the difference in FPS befor and after the disabling. For more deep analysis please use GPA Frame Debugger.

Possible Problems and Their Solutions

So, how do you optimize an app that is GPU bound?

Check out the following tips to see if one will help you:

  1. Try to find a GPU module that affects the performance by simplifying the graphics workload using the System Analyzer “State Overrides” feature.
  2. Use the GPA Frame Analyzer tool to deeply analyze the specific frame and check how each draw call affects the performance. You may need to experiment -> learn -> repeat several times to find which draw call is degrading performance.
  3. Compress any large textures in your application. Read more about that here: https://software.intel.com/en-us/android/articles/android-texture-compression
  4. Simplify any complex shaders (the part of an app used to do shading) in your application. Read about shaders here: https://software.intel.com/en-us/articles/efficient-order-independent-transparency-on-android-using-fragment-shader-ordering
    or here: https://software.intel.com/en-us/articles/shadow-mapping-algorithm-for-android
  5. Writing too many pixels to the screen per second is a complex issue. One of the possible ways to improve the graphics performance is to reduce the picture resolution.
  6. Sometimes you have small texture that is reading many times chaotically. It is recommended to limit calls of problematic small textures.
  7. Too many draw calls. To be more cache friendly you need to group draw calls.
     

    The next two pictures demonstrate this idea:
    Non-optimal:

    Cache friendly:

About the Author

Stanislav Pavlov works in the Software & Service Group at Intel Corporation. He has 10+ years of experience in technologies. His main interest is optimization of performance, power consumption, and parallel programming. In his current role as a Senior Application Engineer providing technical support for Intel®-based devices, Stanislav works closely with software developers and SoC architects to help them achieve the best possible performance on Intel® platforms. Stanislav holds a Master's degree in Mathematical Economics from the National Research University Higher School of Economics. He is currently pursuing an MBA in the Moscow Business School.

Starting from Scratch: How VirtualDJ* 8 mixes Music and Technology

$
0
0

Abstract

Atomix Productions video and music mixer, VirtualDJ* 8,  was rewritten from scratch with an emphasis on a flexible user interface. These enhancements include multi-point touch support, use of a second screen for videos, and a transforming interface for different device form factors.;


Figure 1: VirtualDJ 8 Video

Introduction

How do you make an already popular application attractive to even more customers?  For Atomix Productions, the answer was to expand its app to provide a great experience on new form factors using multi-point touch and second screen video capabilities.

Atomix Productions promotes a user-centric design attitude for its products. From the Virtual DJ website http://www.virtualdj.com/products/virtualdj/why.html:
     "Our philosophy has always been to use cutting-edge technology to build tools that make DJing more accessible and help existing DJs mix better… we don't mind relegating the technical side of the mix to the machine, and help you focus on the creative and artistic side of your skills." 

This philosophy has led the program to become extremely popular with DJs. Atomix Productions website claims that they have had over 150 million downloads of their product and it is currently being used by more than 6 million different people every day.

But rather than rest on its success, Atomix Productions chose to stop focusing on feature additions to existing code and instead to rewrite the code from the ground up. Here’s what Gwen Roelants, Atomix lead developer, said in our interview : 

“It has been a very big undertaking…. but it was required to make the software ready for the future. The old code had grown over the years, and it would have gotten more and more difficult to keep the code clean and maintainable if we would just have continued putting new features in it. The biggest benefit is of course a clean codebase and a good architecture that is ready for the future. I don't know if we would do it again, but for now we should be good for years to come.” 

Gwen Roelants    
 Atomix Productions    

The Technology

Using a PC to DJ requires a lot of technology.  VirtualDJ 8 is much more than a media player and more than a mixer. DJs don’t just scratch songs and add many types of beat-aware effects. They need drops and loops, a sandbox to work on the next track before it goes live, and samplers that can act as sequencers. Today’s DJs want to record mixes as podcasts or broadcast live to Internet radio and edit and play video as well as audio while merging live performance and production. Just the points of interest (cue points, saved loops, automix points, beatgrid anchors, macro points and more) require extensive mapping and controls in the UI. Additionally the application has to be plug-and-play compatible with many DJ physical controllers and include an internal sound engine to process audio and run internal audio components including pitch stretching, limiter, equalizers, and filters. And now Atomix Productions has added multi-screen and multi-touch support and a transformable interface to make their product as easy to use and as powerful as possible. 

In addition to the feature enhancements, Atomix Productions made specific user interface enhancements in VirtualDJ 8 that make it more accessible and more powerful. Here’s more information on some of the technological innovations integrated into VirtualDJ 8, and how these changes were accomplished: 

Multiple screens running independent content: VirtualDJ allows audio mixing on the DJ’s screen while playing videos, live feed, or Karaoke on a big screen. Either screen can be run independently or VirtualDJ 8 can be tied to the audio mix, even fade between two music videos matching the fade over of the music. VirtualDJ 8 uses Windows* extended screen mode through
the QueryDeviceConfig API. And by using the standard implementation, VirtualDJ 8 is automatically capable of using a wireless display via Miracast* or Intel® Wireless Display.

But with two screens, there’s thousands of potential screen sizes and resolutions that the UI must fit while keeping the aspect ratio and performance intact. As Gwen noted “It has helped a lot that we considered multi-touch and various resolutions from the beginning. To take benefit of the new high-DPI screens we made sure that text is always rendered at the native resolution even when scaling the user interface to different resolutions."                                                                 

Multiple Physical Formats: For an app to run on a variety of devices from All-in-Ones, clamshells, and tablets, to 2 in 1s (laptop to tablet convertibles);  it’s not just a matter of screen size and resolution or landscape vs. portrait orientation. Figure 4 shows some of the challenges. It’s important for VirtualDJ 8 to detect the screen orientation in a rapidly changing environment. VirtualDJ 8 listens for the WM_SETTINGCHANGE event, as documented at https://software.intel.com/en-us/articles/detecting-slateclamshell-mode-screen-orientation-in-convertible-pc. Again to quote Gwen:

“Of course the exact same interface will not be optimally suited for touch screens and using mouse and keyboard, so for touch screens we designed a different interface. On the 2 in 1 laptops that can work in both tablet and keyboard mode, we listen for the ConvertibleSlateMode setting change and automatically change to the appropriate interface for the current mode.“ 

Multi-point touch: Given the historic hands-on nature of DJing, multi-point touch brings the virtual mixer back to its roots. But programming multi-point touch interaction takes a lot of planning, both for the interactive layout and for the proper sizing to ensure usable buttons and sliders.

From Gwen: "For multi-point touch we also ensured
that our core (code) was ready for this in a platform-independent way. It was very easy to then use the standard Windows API (WM_TOUCH) for multi-touch
to capture the different touches and pass them to the interface.”   

See https://software.intel.com/en-us/articles/ultrabook-device-and-tablet-windows-touch-developer-guide for
all the info you need to implement multi-point touch in your app.
                                       

Varying compute power:  Just like the requirement to work on various physical formats, modern applications must also work on systems with varying compute power from the minimal to the very powerful while maximizing the available compute power. One example is running 2 platters on tablets while a laptop or 2 in 1 may run up to 6 platters.Gwen said “As computers get faster, different trade-offs can be made in terms of speed vs quality. Developments in computing power towards multi-core and GPUs also require some thought and this can be much better taken care of if it had been thought about from the base."

Cloud CapabilitiesDJs need quick access to thousands of songs as well as karaoke and music videos, even when the sheer volume of music on the Internet can be overwhelming to search. Atomix provides a ContentUnlimited service for a monthly fee that auto searches for music, karaoke, and video. 

Scripting: VirtualDJ 8 provides a scripting language that DJs can use to tweak the many provided functions.  For more info see http://www.virtualdj.com/wiki/VDJscript.html.


Figure 5: VDJscript sample

       
  SDK and Community Sharing: Atomix Productions provides a Developer SDK with sections for Skins, Plug-ins, and Component Developers and hosts the community site for sharing skins, controllers, effects, as well as mixes and blogs. http://wwww.virtualdj.com/community/index.html

Figure 6: Community Sharing Site at VirtualDJ.com

 

By deciding to update its app to work best on the many popular consumer devices available today, and to adapt to the evolving needs of its users, Atomix Productions has ensured that this version of VirtualDJ will continue the series' remarkable success. Make sure that your app is ready, too, by using the resources provided in this article.

Resources:


About the Author

Colleen Culbertson is a Platform Application Engineer with the Developer Relations Division, who authors articles and a regular blog on the Intel® Developer Zone.

Notices

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

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark* and MobileMark*, 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.

Any software source code reprinted in this document is furnished under a software license and may only be used or copied in accordance with the terms of that license.

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.

Copyright © 2014 Intel Corporation. All rights reserved.

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

Intel® Intelligent Storage Acceleration Library (Intel® ISA-L) Performance Under a Virtual Machine

$
0
0

Intel® ISA-L provides the tools to help accelerate and optimize storage on Intel® architecture (IA) for everything from small office NAS appliances to enterprise storage systems.  Intel® ISA-L can run on various Intel® server processors and provides operation acceleration through the following instruction sets:

In today’s private or public cloud infrastructure, software defined storage (SDS) uses some form of storage virtualization.  To answer questions from various storage developers who wanted to know how Intel® ISA-L performs under a virtual machine (VM), Intel ran ISA-L on a barebones system and under a VM. This experiment demonstrated that the performance running under a VM is as good as that when running on a barebones system.  This blog captures all the performance data and setup instructions for developers interested in reproducing this experiment in their own environment.  

The performance data in Figure 1 shows almost identical results (delta < 1%) when running Intel® ISA-L on a VM (via KVM) and on a barebones system. The data has been converted to - raw data (MB/s) running with VM / raw data (MB/s) running on the barebones system:

Figure 1- Running Intel® ISA-L on a barebones system vs. under a virtual machine

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark, 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. For more information go to http://www.intel.com/performance

How to Set Up a System Using a VM For Performance Tests with KVM

  • Use Ubuntu* 14.04LTS for the guest OS of the KVM.   Install packages using apt-get.
  • Important: Ensure BIOS settings and kernel modules are correct, or the system will fall back to QEMU emulation for a VM, which will be very slow and won’t enable AVX/AVX2 and other CPU extensions.

1. Install cpu-checker
    sudo apt-get install cpu-checker

2. Run sudo kvm-ok. You will either see that KVM acceleration can be used      

Figure 2: Successful KVM test

Or get this warning saying KVM acceleration can NOT be used. If you get this message, follow step 2b.


Figure 3: Failed KVM test

2b: If you get the “can NOT warning”, enable vmx / VT in the BIOS (example)

Figure 4: Enable Virtualization in the BIOS

3.  Install the KVM packages
    sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager
    sudo virsh –c qemu:///system list 
            - If the command works, it will just show an empty list
            - Note: if you get errors trying to view the console and the machine is inside a firewall, make sure to run " export no_proxy=127.0.0.1"

4. Create a Virtual Machine (VM)

    Figure 5 - Create a Virtual Machine

          a) Enter a name for the VM
          b) Ensure that the Connection:  line says localhost (QEMU/KVM)
          c) Choose the location of your VM's ISO image
          d) Once booted, the VM will install itself

    5. Ensure the KVM Hypervisor is used

        

    Figure 6: Confirm KVM as the hypervisor

    6. Ensure the CPU configuration is correct. If Model: Haswell, set 'avx' to 'require'.

    Figure 7:- Confirm the CPU configuration

    • Note: If you change settings, you may need to restart the VM

    7. Once booted, run"cat/proc/cpuinfo | grep aux" to check for cpu flags. If "avx', 'avx2' and etc. are not listed, you will have to fix the VM configuration.

    Figure 8:- Confirm the CPU configuration

    How To Set Up Intel® ISA-L On the System (with or without a VM)

    1. To access the full suite of Intel® Storage Acceleration Library functions, please fill out and submit this request form.
      You will receive an email that provides information on how to get the complete ISA-L zip file.
    2. Download and unzip the library source into the OS. The folder should contain the following:

     

    Figure 9: Unzipped ISA-L directory listing

    3. Read the ISA-L_Getting_Started.pdf and Release_notes.txt supplied with the source. From the Guide, choose and follow the instructions to build the source depending on your needs.
    4. Note: Don't run ISA-L as root.

    How to Run the Benchmarks

    1. Run "make perfs". This will build all unit function tests set for 'cache cold - larger data set exceeds LLC size'
      Or
      Run "make perfs D="CACHED_TEST"" ('cache - smaller data set fits within cache')
    2. Run "make perf_report". This will run each unit test supported by the platform architecture. Performance results will be output on the console.

    Optional: Run “make other”. This will build additional functions including compression functions and unit tests. Compression tests (igzip_file_perf and igzip_stateless_file_perf) are run using each file of a standard corpus -The Calgary Corpus - as an input. It is available here

    ISA-L Performance Reporting

    The following unit test results are reported in the above snapshot/overview data table:

    (Unit tests run and data reported will depend on platform architecture and instructions supported)

    • aes_xts_128_dec_cold:
    • aes_xts_256_dec_cold:
    • crc16_t10dif_cold:
    • crc32_ieee_cold:
    • crc32_iscsi_cold:
    • erasure_code_decode_cold:
    • md5_mb_avx2_cold:
    • pq_gen_avx2_cold:
    • sha1_avx2_mb_cold:
    • sha256_avx2_cold:
    • sha512_avx2_cold:
    • xor_gen_avx_cold:
    • igzip_file_perf with Calgary Corpus* as an input
    • igzip_stateless_file_perf with Calgary Corpus* as an input

    Each unit test will report results in MB/s. For normalization across platforms, cycle/B is reported based on the throughput and system frequency.

    Compression test results are reported as a weighted average of the results from each file being compressed. The throughput is then also calculated to cycle/B.

    Below is the platform configuration:

    CPU & Chipset

    1 CPU,  2.3 GHz Intel® Xeon® E5-2650 v3 processor

    • # of cores per chip: 10
    • # of sockets: 1
    • Chipset: Intel® C610 "Wellsburg" series chipset, QS (B-1 step)
    • System bus: 9.6GT/s QPI

    Platform

    Brand/model: Aztec City CRB

    • Baseboard: Aztec City
    • Board revision: G69033-201
    • BIOS: GRNDCRB1.86B.0038.R01.1409040644
    • DIMM slots: 16
    • Power supply: 750W

    Memory

    Memory Size: 32 GB DDR4 2133 / Single registered 8GB RDIMM per channel

    Brand/model: Micron* MTA18ASF1G72PDZ-2G1A1JG, NUMA Memory Configuration

    Mass storage

    Brand & model: Western Digital* Caviar Blue (WD800AAJS)

    Number/size/RPM/Cache:  1ea - 80GB

    Operating system

    Fedora* 19 64-bit OS.  Linux*- 3.13.11-100, 

    Virtualization Environment: Hypervisor: Fedora* 19 64-bit OS, Linux*-3.13.11-100.  QEMU/KVM Version 1.4.2, libvirtd version 1.0.5.9.   VM: CPU Features: avx,avx2=require, CPU’s: 1, Memory: 1024MB, Hypervisor: kvm, Arch: x86_64, Emulator: qemu-kvm.  OS: Ubuntu 14.04LTS, Kernel 3.13.0-36-generic.

    Compiled under gcc 4.8.2 and yasm 1.2.0,

    Test functions run from user space.  Functions average multiple cycles.  Functions run “cache cold” conditions.  For some functions “cache warm” conditions may result in higher performance.

    Figure 10 - Tested system configuration

    Related Links and Resources Notices

    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.

    A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS.

    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, the Intel logo, AVX2, AVX, SIMD, AES-NI, Intel® ISA-L, and Intel® Xeon® are trademarks of Intel Corporation in the U.S. and other countries.

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

    Copyright© 2014 Intel Corporation. All rights reserved.

    This sample source code is released under the Intel Sample Source Code License Agreement

     

    Optimization Notice

    Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors.  These optimizations include SSE2, SSE3, and SSE3 instruction sets and other optimizations.  Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel.

    Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors.  Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors.  Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. 

    Notice revision #20110804

     

     

    1. Enter a name for the VM

    2. Ensure that the Connection: line says localhost (QEMU/KVM)

    3. Choose the location of your VM’s ISO image.

    4. Once booted, the VM will install itself.

    5. Ensure the KVM hypervisor is used

    6. Ensure the CPU configuration is correct. If Model: Haswell, set ‘avx’ to ‘require’.

    • Note: If you change settings, you may need to restart the VM.
    1.  Once booted, run “cat /proc/cpuinfo | grep aux” to check for cpu flags. If ‘avx’, ‘avx2’ etc. are not listed, you will have to fix the VM configuration.
    2. To access the full suite of Intel® Storage Acceleration Library functions, please fill out and submit this request form.
      You will receive an email that provides information on how to get the ISA-L zip file.

    3. Download and unzip the library source into the OS. The folder should contain the following:

    4. Read the ISA-L_Getting_Started.pdf and Release_notes.txt. From the Guide, choose and follow the instructions to build the source depending on your needs.

    5. Don’t run ISA-L as root.

    6. Run “make perfs”. This will build all unit function tests set for ‘cache cold – larger data set exceeds LLC size’

      Or

      Run “make perfs D=”CACHED_TEST”” (‘cache – smaller data set fits within cache’)

    7. Run “make perf_report”. This will run each unit test supported by the platform architecture. Performance results will be output on the console.

    An Overview of the Storage Plugin for Intel® Enterprise Edition for Lustre* Software (Intel® EE for Lustre* Software)

    $
    0
    0

    In today’s data centers, big data has put greater demands on the performance of storage systems. The Lustre* file system was purposely built to provide sustained storage performance and stability on a large scale for high-performance computing (HPC) systems.  Intel designed the Intel® Enterprise Edition for Lustre* software to enable fully parallel I/O throughput across clients, servers, and storage devices. Metadata and data are stored on separate servers to allow optimization of each system for different workloads. For ease of use, Intel® EE for Lustre* software includes the Intel® Manager for Lustre* software to configure, monitor, troubleshoot, and manage the storage systems. To adopt this technology with customized storage hardware, the storage developer will need to build a plugin for Intel® EE for Lustre* software.  This blog will provide a high level overview of the storage plugin components which are illustrated in the lower right corner of Figure-1.

     

    Figure 1- Intel(R) Enterprise Edition for Lustre Software components

    Where to get more information on the Storage Plug-in

    For more information and access to the developer guide, check online and contact our partners or an Intel representative listed at:

    http://www.intel.com/content/www/us/en/software/intel-enterprise-edition-for-lustre-software.html

    What are the Storage Plugins for?

    Storage plugins are responsible for delivering information about entities (ex. Storage devices) to the manager server.  The manager server web interface and command line interface (CLI) included with the Intel® Manager for Lustre* software are built on the REST API, which is accessed via HTTP. This API is available for integration with third party applications. The API is designed to minimize the lines of code required to write a plugin, minimize the duplication of effort between different plugins, and make as much of the plugin code as possible declarative in style,  to minimize the need for per-plugin testing. For example, rather than having plugins procedurally check for resources that are in bad states during an update, we provide the means to declare conditions that are automatically checked. Similarly, rather than requiring explicit notification from the plugin when a resource attribute is changed, we detect assignments to attributes and schedule transmission of updates in the background.

    To present device information to the manager server, a Python* module is written using the Storage Plugin API:

    • The objects to be reported are described by declaring a series of Python classes: Declare Resources

    • Certain of these objects are used to store the contact information such as IP addresses for managed devices: Declare a ScannableResource

    • A main plugin class is implemented to provide required hooks for initialization and teardown: Implement the Plugin

    High level components for building and running a Plugin

    Below are the high level steps of how to build and run the plugin feature of the Intel® EE for Lustre* software. This blog is not intended to replace the Storage Plugin Developer’s Guide for Intel® Manager for Lustre* software and the REST API for Intel® Manager for Lustre* software documents.  These documents are available with access to the Intel® EE for Lustre* software.  See the section above on Where to Get More Information on the Storage Plugin for contact information..

    1.Declare The Storage Resources

    A Resource may be a physical device such as a physical hard drive, or a virtual object such as a storage pool or virtual machine. In general, storage resources may inherit from Resource directly, but optionally they may inherit from a built-in resource class as a way of identifying common resource types for presentation purposes. The plugin can import attributes, identifiers, plugins, relations, resources, and statistics from chrome_core.lib.storage_plugin.api

    2.Declare a ScannableResource

    Certain storage resources are considered ‘scannable’:

    • They can be added by the administrator using the manager server user interface
    • They are the resource contacted by other Plugins to learn about resources
    • This resource ‘owns’ some other resources declaring a ScannableResource

    A typical scannable resource is a storage controller or couplet of storage controllers.

    3.Implement a Plugin

    The Resource classes are simply declarations of what resources can be reported by the plugin and what properties they will have.  The plugin must be able to initialize, update, create, scan, teardown, and remove the resources.  The plugin must follow standard Python* logging.

    4.Present Metadata

    Sensible defaults are used wherever possible when presenting UI elements relating to storage resources. By default, attribute names are transformed to capitalized text. For example, `file_size`` is transformed to File size. The plugin must use a default human readable version of the class name followed by their identifier attributes.

    5.Run the Plugin

    Before running the plugin as part of a manager server instance, use validate_storage_plugin to validate it. The plugin needs to be able to run separately so that it can be stopped and started quickly.    

    6.Correlate Controller Resources

    The plugin must be able to link up resources between different plugins, or between storage controllers and Linux hosts by using the resource attributes.  

    Conclusion

    The Storage Plugin allows storage developers to use their customized storage hardware running in a Lustre environment using the Intel® EE for Lustre* software.  The information in this blog is to introduce the basic components of the Storage Plugin to the developer community.  For more details about the storage plugin beyond the information provided in this blog, see your Intel representative.

    References
    Notices

    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.

    A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS.

    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, the Intel logo, AVX2, AVX, SIMD, AES-NI, Intel® ISA-L, and Intel® Xeon® are trademarks of Intel Corporation in the U.S. and other countries.

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

    Copyright© 2014 Intel Corporation. All rights reserved.

    This sample source code is released under the Intel Sample Source Code License Agreement

     

    Optimization Notice

    Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors.  These optimizations include SSE2, SSE3, and SSE3 instruction sets and other optimizations.  Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel.

    Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors.  Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors.  Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. 

    Notice revision #20110804

     

    Intel® Parallel Computing Center at Environmental Molecular Sciences Laboratory Pacific Northwest National Laboratory

    $
    0
    0

    Principal Investigators:

    Karol Kowalski
    Senior Research Scientist at Environmental Molecular Sciences Laboratory (EMSL) at Pacific Northwest National Lab

    Co-PIs: Edoardo Apra, Eric Bylaska, Niranjan Govind, and Huub van Dam (Senior Research Scientists at EMSL)

    Description:

    The main goal of the Center is to modernize the NWChem suite of computational chemistry codes towards effective utilization of the emergent hybrid parallel computer systems based on the Intel Many Integrated Core Architecture (Intel MIC) technology. The proposed research presents a unique opportunity to make major breakthroughs in performance enhancements of several key implementations of many-body techniques which are indispensable for a comprehensive understanding of complex chemical transformations. Modernized codes will be applicable to several science drivers like, studies of aerosol particles, soil chemistry, biosystems, hormone-cofactor functionality in proteins, ionic liquids in cells, spectroscopies, new materials, and large-scale reaction mechanisms.

    The emergence of heterogeneous systems will have a transformative impact on the landscape of high performance scientific computing. In particular, Intel MIC technology supports higher computational performance at lower cost and power consumption. We propose to develop new codes capable of taking advantage of these technological advancements.

    A significant rewriting of algorithms is expected to take advantage of the new architecture. We plan to do these coding efforts in such a way that they will be easily available to integrate into other open-source computational chemistry software efforts. The extent to which code needs to be rewritten versus the extent to which code can be cleverly reused if the main challenges can be addressed or avoided depends to some degree on what the compilers for this platform afford. We will address the performance of several computational drivers in NWChem:

    1. Gaussian DFT and TDDFT methods
    2. Plane wave DFT formulations
    3. Multi-reference coupled cluster methods

    We envision a major reworking of these codes with four major aims in mind: improvement of the parallelization up to hundreds of thousands of cores, modifications of the intra-node parallelization by using threading approaches, a complete rewrite of the major-kernels in order to better exploit the wide vector units available in the present and upcoming computer architectures, and reducing the computational cost for large scale ground and excited-state simulations.

    Related websites:

    http://www.nwchem-sw.org/index.php/Main_Page

    Viewing all 3384 articles
    Browse latest View live


    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>