McLachlan should use the kranc script instead of calling Mathematica

Issue #575 closed
Ian Hinder created an issue

Kranc provides a command-line interface and some useful code for catching and displaying errors and improving on the default output. This is accessed by running your script using the "kranc" command rather than directly in Mathematica.

The attached patch modifies all the McLachlan scripts to work in this way. Update to the latest Kranc to get proper error behaviour.

OK to apply?

Keyword: McLachlan

Comments (7)

  1. Erik Schnetter
    • removed comment

    Before this patch. the log files are named *.err if there was an error, and *.out if everything went fine. This convention may be a bit odd, but it is useful to indicate problems. This patch changes this, so that the log files are always called *.out, even if there is an error.

    Which behaviour do we want?

  2. Ian Hinder reporter
    • removed comment

    Can you check the patch again? As far as I can tell, the behaviour should not have changed. The relevant code is at the end of runmath.sh, and from my reading of it, the new behaviour should be the same as the old. The output of Kranc is redirected to the error file, and if there is an error, the script exits leaving the output in the error file. If there is no error, the output is moved to the output file. Am I missing something?

    If what you said were correct, the dependency mechanism in the Makefile, which relies on the .out file to tell that the thorn was built successfully, would not work at all.

  3. Erik Schnetter
    • removed comment

    $PIPESTATUS is always 0 for me, even if there is an error.

    Here is my screen output if I introduce an error to WaveToy.m:

    $ make rm -rf ML_WaveToy ./runmath.sh WaveToy.m Mathematica 8.0 for Mac OS X x86 (64-bit) Copyright 1988-2011 Wolfram Research, Inc. User set source language to C Processing tensorial arguments Computing reflection symmetries Creating (component-based) Kranc thorn Processing arguments to CreateKrancThorn Verifying arguments Creating startup file Creating configuration file Creating interface file Creating param file Creating schedule file Creating MoL registration file Creating symmetry registration file Creating differencing header file Creating calculation source files Creating calculation function: WT_Gaussian Creating calculation function: WT_RHS

    Throw::nocatch: Uncaught Throw[The calculation WT_RHS has both assignments to, and derivatives of, the grid functions {u}. This is not allo<<34>> dependent on the ordering of the loop over grid points.] returned to top level.

    In[1]:= PIPESTATUS=[0] for thorn in ML_WaveToy; do \ ./copy-if-changed.sh $thorn ../$thorn; \ done make: * [WaveToy.out] Error 2

    I added a line to output $PIPESTATUS. No directory ML_WaveToy is generated. There is a file WaveToy.out, and no file WaveToy.err.

  4. Log in to comment