Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo / sample code update #1666

Closed
wants to merge 9 commits into from
Closed

Commits on Jul 2, 2024

  1. a few more functionalities

    vasudeva8 committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    66b0e14 View commit details
    Browse the repository at this point in the history
  2. merge

    vasudeva8 committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    a238a75 View commit details
    Browse the repository at this point in the history
  3. update based on reviews

    update with correction
    
    fixed issues
    vasudeva8 committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    a73aaea View commit details
    Browse the repository at this point in the history
  4. Improve qtask_ordered sample program

    Use hts_tpool_next_result_wait() in threadfn_orderedwrite() so it
    blocks properly when it has nothing to do.  Remove lock and
    conditional that are no longer needed.  Use a sentinel job to
    tell threadfn_orderedwrite() that there is no more data and it can
    terminate.
    
    Improve error handling.  Add a data::result field so that
    threadfn_orderedwrite() can report back to the main thread if
    it encountered a problem.  Ensure everything is cleaned up
    correctly if either the main thread or threadfn_orderedwrite()
    fail, and in the right order.  Set the return value to EXIT_FAILURE
    if either sam_close() or threadfn_orderedwrite() report failure.
    
    Ensure error messages are written to stderr.
    daviesrob authored and vasudeva8 committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    c553f40 View commit details
    Browse the repository at this point in the history
  5. update to make faster

    vasudeva8 committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    9ce3917 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. update

    vasudeva8 committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    2492496 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. Configuration menu
    Copy the full SHA
    d1c9efa View commit details
    Browse the repository at this point in the history
  2. Improve indentation and program flow in DEMO.md

    The "..." to indicate clipped out code is useful as it removes a lot
    of the unnecessary boiler plate, especially error checking, and allows
    us to drill down to the essense of what we're trying to teach.
    However without indentation it's not clear what bits are being
    removed.
    
    Also there are times when the code removed is an error handler plus
    a subsequent else clause, which gives the false impression with the
    indentation that the if-clause has been negated.  Eg:
    
        ...
        //select required field alone, this is useful for CRAM alone
        if (hts_set_opt(infile, CRAM_OPT_REQUIRED_FIELDS, SAM_FLAG) < 0) {
        ...
           //read header
           in_samhdr = sam_hdr_read(infile);
        ...
    
    Clearly the `sam_hdr_read` is not within the if-clause of
    `hts_set_opt` returning < 0, but it's how it reads because "..."
    hid too much.  (In the above case just indenting the ... and
    un-indenting the hdr read call reverses the mental image.)
    
    My approach here is to replace all `...` error handlers with `... // error`
    and to indent them accordingly.
    
    Also where we only have a one line thing, removing open curly braces
    if we've cut the close curly brace gives a more sensible view.
    
    None of this is really changing the code we're showing, but presenting
    it in a more obvious manner to those that don't understand what is and
    isn't an error case.
    jkbonfield committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    cecc7a7 View commit details
    Browse the repository at this point in the history
  3. update based on reviews

    vasudeva8 committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    7d0c19e View commit details
    Browse the repository at this point in the history