mpitune and regexp

mpitune and regexp

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.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

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:

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

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

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today