Interactive SuperComputing


 

Star-P® Function Analyzer

 
   

Star-P® Function Analyzer Script Download

The attached Function Analyzer script analyzes one or more .m files (and their dependencies) or all .m files in a directory structure. Each file is parsed into a list of individual "words" representing the function names and variable names used in your application. Each word in the list is then compared to a table containing the complete set of functions provided by The MathWorks™. The script's output consists of a list of function names that were found and how many times each function was used in all of your application's .m files. The script operates in a read-only mode and hence maintains the integrity of your application(s).

To obtain the most relevant information regarding functional coverage of task-parallel operations in Star-P, we advise that you run the script on the file(s) that contain the most time consuming for-loops.

Running the Function Analyzer script:

  1. Determine the file or directory/folder which contains the .m code of your application(s). If you have more than one application, please run the script once for each application.
  2. Save a copy of the "FunctionAnalyzer.m" in that directory/folder, or make sure that the "FunctionAnalyzer.m" is in a location that is part of the MATLAB® search path.
  3. Start MATLAB®
  4. Type FunctionAnalyzer in the MATLAB® command window and follow the instructions presented in the dialog windows.
  5. Please review the script output "outputFunctionAnalyzer.txt" and send the file to ISC at

The following is the help string of the Function Analyzer script:
>> help FunctionAnalyzer

The FUNCTIONANALYZER script analyzes one or more .m files or all .m files in a directory/folder and its subdirectories and gathers the frequency of calls to MATLAB functions. It does so by parsing the user .m files and comparing the function names against a predefined function-list.

Output of Script

The attached FunctionAnalyzer script produces an ASCII file as its output. A sample of the content generated by the script is shown below.

#
# Results file of FunctionAnalyzer
#
# User Information
#
# Date and Time : 21-May-2008 11:13:44
# Windows : 0
# Number of paths searched : 0
# Number of files searched : 2
# Average file length : 3.500000
#
# Column Descriptions
# Column 1: Function Name
# Column 2: MATLAB(R) Toolbox
# Column 3: Number of times this function was called
# Column 4: Number of times this function was called as part of a ppeval call
# Column 5: Number of files that contain this function #
bintprog,Optimization,1,0,1
fmincon,Optimization,8,0,1
fsolve,Optimization,1,0,1
color,Optimization,64,0,11
summary,Statistics,1,0,1
dataset,Statistics,6,0,2
moment,Statistics,3,2,3
range,Statistics,9,0,7
prctile,Statistics,7,3,7
nanmean,Statistics,2,0,1
normpdf,Statistics,16,5,4


Download the Function Analyzer Script