| 1 | == Introduction == |
| 2 | The following is a collection of tips for debugging various types of unexpected behavior when building and/or running ISSM. |
| 3 | |
| 4 | NOTE: Some of this information may overlap with the public-facing [https://issm.jpl.nasa.gov ISSM Web site], and in some cases it may be best to simply host it there. |
| 5 | |
| 6 | |
| 7 | === !BinRead.py === |
| 8 | Sometimes you may observe results from ISSM that exceed a given tolerance, differ depending on operating system and/or configuration, or seem to be incorrect altogether. It may be helpful in such cases to use a script designed for marshaling human-readable model settings from binary ISSM input files. |
| 9 | |
| 10 | ==== Running Tests ==== |
| 11 | Individual regression tests (designed for our Jenkins testing suite, but available to all users through the SVN repo) and the drivers for them are located at `test/NightlyRun`. With this as the working directory, tests can be run from within MATLAB with, |
| 12 | {{{ |
| 13 | runme('id',<test_num>) |
| 14 | }}} |
| 15 | Python tests can be run from a Unixy command line by setting first setting the environment with, |
| 16 | {{{ |
| 17 | export PYTHONPATH="$ISSM_DIR/src/m/dev" |
| 18 | export PYTHONSTARTUP="${PYTHONPATH}/devpath.py" |
| 19 | export PYTHONUNBUFFERED=1 |
| 20 | }}} |
| 21 | then calling the Python test driver with options, |
| 22 | {{{ |
| 23 | ./runme.py -i <test_no> |
| 24 | }}} |
| 25 | Various input and output files are generated for such runs, and are located in `execution/test<test_num>-<date>-<time>-<pid>/`. |
| 26 | |
| 27 | NOTE: It may be difficult to sort out which subdirectory of `execution/` corresponds to a given test run. As such, if you are doing multiple runs of the same test with the intention of comparing the results, it is recommended that you make note of the name of the new subdirectory. |
| 28 | |
| 29 | ==== Marshalling Binary Input Files ==== |
| 30 | Now that we have run one or more tests, we can inspect contents of the binary input file by running, |
| 31 | {{{ |
| 32 | scripts/BinRead.py execution/test<test_num>-<date>-<time>-<pid>/test<test_num>.bin |
| 33 | }}} |
| 34 | |
| 35 | If we wish to compare the binary files for, say, MATLAB versus Python runs of the same test, we can redirect the output of `BinRead.py` to a text file, then run, |
| 36 | {{{ |
| 37 | diff /path/to/BinRead_output_1 /path/to/BinRead_output_2 |
| 38 | }}} |