Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

mpitune and regexp

FC_
Beginner
488 Views

I am attempting to use mpitune for application specific tuning.  It works fine using the total runtime, but I cannot get it to work using the -ar regexp option, which if I understood correctly should take a number from the screen output of my code to optimise on, instead of the total runtime.  I am only interested in optimising the main loop, because the code has many initialisations using MPI which are not relevant to the optimisation. 

My code outputs a timing to the screen output which inlucdes a line that looks like the following:

                 "(main loop time):   2.00497388839722"

I run mpitune with any of the following

mpitune -avd min -ar \"main loop time\):[ ]*[0-9]*.[0-9]*" --application \"mpirun -n 32 ./myapp.x\" -of ./dum.conf

mpitune -trf outfile -avd min -ar \"main loop time\):[ ]*[0-9]*.[0-9]*" --application \"mpirun -n 32 ./myapp.x\" -of ./dum.conf

mpitune -trf out -avd min -ar \"main loop time\):\s*\d.\d\" --application \"mpirun -n 32 ./myapp.x\" -of ./dum.conf

Nothing matches, and I always get the message (aside: the English of these outputs and the help page could certainly be cleaned up):

"No value from output of the application was obtained. Please check output of the application and passed regular expression. Comparation mode by execution time is used now."

All of the following match with grep but not inside mpitune:

grep "main loop time):[ ]*[0-9]*.[0-9]*" outfile

grep -E "main loop time\):[ ]*[0-9]*.[0-9]*" outfile

grep -P "main loop time\):\s*\d.\d" outfile

Any ideas what I am doing wrong ?  Apologies for what is probably a stupid reg-exp question, but the documentation is not very clear what is happening here.  Should I be using BRE or ERE or perl or what ?  If it is relevant, I am using the bash shell, which means one has to escape the brackets.  But I also tried removing the brackets althogether from the output, and I still can't get it to work.

Any help greatly appreciated: Thanks in advance.

0 Kudos
3 Replies
FC_
Beginner
488 Views

In case it is relevant, I am using version 4.1.0 of IntelMPI

0 Kudos
James_T_Intel
Moderator
488 Views

There are two problems with what you're doing.  First, you don't have enough escapes.  Second, you need to enclose what you are trying to extract in parentheses:

[plain]\"main loop time\\\):[ ]*\([0-9]*.[0-9]*\)\"[/plain]

I'm currently writing a more detailed article with some examples of how to use the regular expressions for mpitune.  I'll post an update here once I have it ready.

Sincerely,
James Tullos
Technical Consulting Engineer
Intel® Cluster Tools

0 Kudos
James_T_Intel
Moderator
488 Views

The article I mentioned is now published at http://software.intel.com/en-us/articles/using-regular-expressions-with-the-intel-mpi-library-automatic-tuner

Sincerely,
James Tullos
Technical Consulting Engineer
Intel® Cluster Tools

0 Kudos
Reply