Running Intel® Inspector on Applications Launched from Scripts

Published: 04/16/2019  

Last Updated: 04/16/2019

By Alexandra Marie Shinsel

Problem:

Running Intel® Inspector on a script that launches and provides input to the application of interest produces the message

Error: Cannot find analysis results. Suggestion: Make sure that application launched your executable of interest

 

Example:

The python file a.py is used to start the executable of interest, test_memory:

import os
os.system("./test_memory")

Running Inspector on it produces an error:

> inspxe-cl -collect mi3 -executable-of-interest test_memory -- python a.py
Error: Cannot find analysis results. Suggestion: Make sure that application launched your executable of interest test_memory

 

Root Cause:

When the script uses the system call to launch the target process, it might run in another shell. Inspector cannot profile a target application which runs in a different shell than the launched application (in this case, python a.py).

 

Solution:

Ensure that the application is launched in the same shell as the called script.

  • For a shell script, the problem can be fixed by removing the "#!/bin/sh" line.
  • For a Python script, the issue can be resolved by using a subroutine call:
    import subprocess
    subprocess.call("./test_memory")

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.