Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Check and display proper usage of example executables #51

@rconnorlawson

Description

@rconnorlawson

Most test executables have the following command line form:

./hornet_xxx_test <graph> <batch_size>

This behavior is not documented. If you leave off the file argument, this error occurs:

HOST error
/home/rlawson6/workspace/hornet/xlib/src/Host/FileUtil.cpp(67) [ check_regular_file ]

Unable to read file

This is fairly straightforward to sort out, but it requires spelunking in the source code to figure out the command syntax.

If you leave off the batch size, however, this much more cryptic error occurs:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
[1]    10646 abort (core dumped)  ./build/hornet_insert_test ../../example/rome99.gr

Since this is an uncaught exception, getting reasonable debug info out of GDB is challenging. As a new user, I had no way of knowing if this is due to operator error (it was) or due to some instability in the library itself. After some pain I discovered that one can get a reasonable exception call stack by breaking on __ctx_throw(), an internal C++ function that begins the exception handling procedure. Only then did I realize that, in fact, I just needed to supply a batch size on the command line.

A preferable and simple behavior would be to check for the correct number of arguments before continuing, and output a usage message if incorrect. This won't catch malformatted arguments, but it at least gives new users more of a signpost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions