3
$\begingroup$

I'd like to profile some Mathematica code to figure out why it's running slowly. Since the code takes about a day to run, I can't use the Wolfram Workbench GUI. Is there a way to run Wolfram Workbench in batch mode, or another way to profile code that is compatible with being called from the command-line? I haven't been able to find an equivalent to Mathematica's math command for Wolfram Workbench, does one exist?

$\endgroup$
6
  • 1
    $\begingroup$ Maybe a better question would be: how to profile Mathematica code (using the WW profiler or other) when running in command line mode? $\endgroup$
    – Szabolcs
    Apr 22, 2015 at 17:00
  • 1
    $\begingroup$ I think you should follow Szabolcs advice and reformulate the question and especially the title. Running profiles in batch might attract a lot more people who might be able to help you... $\endgroup$ Apr 22, 2015 at 18:13
  • $\begingroup$ Duly edited. Don't suppose you know the answer to that question instead? $\endgroup$
    – Matt
    Apr 23, 2015 at 18:03
  • $\begingroup$ Do you HAVE to run it through the WB? It's easy to run a M program in batch/command line mode. But you keep referring to the WB. As you have all the .m and .nb files on the local file system anyway, why don't you just run it in batch/command line mode from there? I don't see the dependence on the WB for what you are trying to accomplish. And the simply put some Print statements with time stamps or wrapping AbsoluteTime interspersed throughout the code (or include code that dumps time stamps into some log file), and then run several times to encircle the salient parts of the code. $\endgroup$ Apr 23, 2015 at 19:00
  • 1
    $\begingroup$ The whole reason that WB exists/has a profiling function is because it's nontrivial to take existing code, exhaustively wrap everything that could possibly be relevant, and have them all dump their output somewhere useful. $\endgroup$
    – Matt
    Apr 24, 2015 at 19:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.