When I first saw a session at IDF where masters of the Modern Code were discussing it got me intrigued to think more. Fellow Black Belt Gaston Hillar gave me good insight into it. I had a quick chat also with our Black Belt Program Manager Kathy(Always filled with Energy) she also explained about how cool Code modernization is.
Hence now I started learning about Code Modernization and trying to experiment and learn more.
after a brief stint it came to my picture that Modernization of the code is very useful for our CPU processors because they are multicored and rarely do we use all the cores of CPU and it impacts the way we utilize our program. Now with Code Modernization we can resourcefully use all the cores of the CPU.
To Start with Code Modernization the most important thing or basic thing is knowing the CPU Utilization formula.
U = 100% – (%of time spent in idle task)
% time in idle task = (average period of background task with no load) * 100%/(avg.period of background task with some load)
%time in idle task =(BG loop count measured during 25 ms) *100%/(BG loop count expected in an unloaded CPU)
Actual % = Scaled Percent * (100%)/max value 8 bit value
These formulas are the basis for using your CPU cores and should be given importance.
Lets take a look at Multicore Utilization.
There is already a good article describing the laws in Intel Developer Zone
https://software.intel.com/en-us/articles/predicting-and-measuring-parallel-performance
OpenMP
OpenMP is an interface that helps shared memory multiprocessing in Languages C,C++ and Fortran.
A normal for loop in C
for (i=0; i < 5; i++)
{
for (j=0;j<=i;j++)
{
printf("@”);
}
}
Just add
#include<omp.h>
and add
#pragma omp parallel
you are good to go
Where to get OpenMP
https://www.openmprtl.org/download
Intel TBB
It is a C++ based libray used for Task Parallelism
https://www.threadingbuildingblocks.org/download
Now the entire package can be found at Intel Parallel Studio
https://software.intel.com/en-us/intel-advisor-xe/
Time to time you get access to courses organised by Colfax International and during the course you get remote access to instances of Intel Xeon Machines for practice and trust me as I was a newbie to Modern Code I came to know more accessing the sessions.
After the end of getting the course done we get a certificate.Its a cool one.
The training sessions are just awesome you will get the crunch of the subject. As I have just learnt a bit of Modern Code its now asking questions in my mind to know more .The path to start modern code just keeps you going because there are lot of Modern Operating System questions that gets resolved.
There has been a new dedicated Intel Modern Code Section at Intel Developer Zone plus a new initiative added to Software Innovator Track for Modern Code as we learn more we share come lets grow the Modern Code Section together.
For more such intel Modern Code and tools from Intel, please visit the Intel® Modern Code
Source:https://software.intel.com/en-us/blogs/2016/02/18/my-journey-to-learn-modern-code