Skip to content

Logger2 - Changes mostly to make output thread and Asynchronous iO safe #244

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

Closed
wants to merge 59 commits into from

Conversation

wclodius2
Copy link
Contributor

Changed three files:

  • /src/stdlib_logger.f90
    • Fixed typos: Rrea_only_error to read_only_error, shortened lines to under 80 columns
    • Made output thread and asynchronous IO safe by making it a single string formatted using the new_line function
  • /doc/specs/stdlib_logger.md documented the changes in API in stdlib_logger.f90
  • /doc/specs/index.md included the logger in the index.

wclodius2 and others added 30 commits September 29, 2020 17:05
Added stdlib_bitsets.f90, stdlib_bitset_64.f90, and stdlib_bitset_large.f90 and modified CMakeLists.txt and Makefile.manual so they should compile the files.

[ticket: X]
Added tests/bitsets/test_stdlib_bitset*.f90, tests/bitsets/CMakeLists.txt,
and tests/bitsets/Makefile.manual and modified tests/CMakeLists.txt and
tests/Makefile.manual to compile the test programs.

[ticket: X]
Eliminated unused variables in stdlib_bitset_64.f90, stdlib_bitset_large.f90
and rename variables called ablock to block_ in stdlib_bitset_large.f90

[ticket: X]
Added stdlib/doc/specs/stdlib_bitsets.md

[ticket: X]
…set*.f90

Changed makeefiles to preprocess ths stdlib_bitset*.fypp files to stdlib_bitset*.f90 files.

[ticket: X]
Renamed files stdlib_bitset*.f90 to fypp preprocessor stdlib_bitset*.fypp files

[ticket: X]
Changed stdlib_bitsets.fypp, stdlib_bitset_64.fypp, and stdlib_bitset_large.fypp
to generate the assignment procedures of logical arrays to and from bitsets.

[ticket: X]
Removed stdlib_bitsets.f90, stdlib_bitset_64.f90, and stdlib_bitset_large.f90 as
they are now generated by the preprocessor.

[ticket: X]
Defined an error_handler subroutine in stdlib_bitsets.fypp and used it to handle
errors in stdlib_bitset_64.fypp and stdlib_bitset_large.fypp. Also was more
consistent in documenting status argument results. Added
char_string_too_large_error to status results.

[ticket: X]
Was more consistent in using bulleted lists in documenting status error codes.
Added char_string_too_large_error to the error codes.

[ticket: X]
Working with fypp made it easier to add unwanted trailing blanks. I removed them.

[ticket: X]
In all my editing I dropped a return in stdlib_bitset_64.fypp and failed
to run test_stdlib_bitset_64.

[ticket: X]
Fixed typo in four places

[ticket: X]
Changed the kind of bit from bits_kind to int64 to silence a spurious warning.

[ticket: X]
Changing bit's kind to int64 and not putting it in the int conversion made the
arguments to clear and set of kind int64, for wwhich there was no specific
interface.

[ticket: X]
Deleted two returns at the end of procedures.

[ticket: X]
Deleted return at the end of a procedure.

[ticket: X]
Unindented ```fortran and added trailing ``` to the example codes in the FORD comments,

[ticket: X]
Implemented most of the suggestions of Jeremie Vandenplas:
1. Rephrased the first paragraph adding a definition of bits and changed
'a sequence' to 'as a seqauence' and 'a subset' to 'as a subset'
2. Changed 'constants all integers' to 'integer constants'
3. Changed 'up 64 bits' to 'up to 64 bits'
4. Changed i'th to i-th
5. Made the summary of operations into a bulleted list
6. Moved the discussion of assignments to later in the text
7. Merged discussions of result character and result value for functions/operators
8. Remove `if ( bits(set0) /= 33)...`
9. Added commas
10. Changed `Result = ...` to `result = ...`
11. Changed state type of the result for the value function from logical to integer

[ticket: X]
Changed stdlib_bitset_64.fypp and stdlib_bitset_large.fypp to
stdlib_bitsets_64.fypp and stdlib_bitsets_large.fypp.

[ticket: X]
wclodius2 and others added 26 commits October 15, 2020 14:46
Changed stdlib_bitsest_64.fypp to stdlib_bitsets_64.fypp in Makefile.manual.

[ticket: X]
Fixed various typos found in stdlib_bitsets.fypp by Jeremie. Modified
stdlib_bitsets_large.fypp so it whould work for bits_kind==int64.

[ticket: X]
For digit_count in stdlib_bitsets_large.fypp replaced the select case construct
with a do loop and a divide by ten.

[ticket: X]
Added dependence of stdlib_bitsets.f90 on stdlib_kinds.f90.

[ticket: X]
Made constants in max et al bits_kind to match variables kind, fixed digit_count
in stdlib_bitsets_64.fypp.

[ticket: X]
 Made many constants of kind bits_kind so the pertinent procedures would be
 recognized.

[ticket: X]
Added discussion of the undefined behavior that can occur when the bitset
"sizes" for the two bitset arguments to "binary" procedures do not agree.

[ticket: X]
Changed procedure to its plural procedures.

[ticket: X]
Addedl line refering to the fitsets source file.

[ticket: X]
Introduced the parameters max_digits and overflow_bits to be used in checking
for overflows on reads and writes. The parameters need to be changed if
bits_kind is changed, and preferred parameters for bits_kind==int64 are
defined, but commented out.

[ticket: X]
Replaced go to 100 with exit in both stdlib_bitsets_64.fypp and
stdlib_bitsets_large.fypp.

[ticket: X]
Replaced the use of iso_fortran_env with stdlib_kinds.

[ticket: X]
Changed handling of potential integer overflows on reads for bits_kind==int64,
changing max_digits from 20 to 19. Removed comment that my treatment may not be
quite right. Also fixed a typo in an error message.

[ticket: X]
Jeremie suggested numerous changes. I implemented most of them.

[ticket: X]
At the suggestion of Jeremie I replaced a number of go tos.

[ticket: X]
Kreplaced go tos at the suggestion of Jeremie.

[ticket: X]
Documented the use of the "named" forms, .EQ., .NE., .GT., .GE., .LT., .LE., as
alternatives to the symbolic forms, ==, /=, >, >=, <, <= of the comparison
operations.

[ticket: X]
Change `Rrea_only_error` to `read_only_error` and changed some lines that were
longer than 80 columns wide to be shorter.

[ticket: X]
Added stdlib_logger.html to ./doc/specs/index.md

[ticket: X]
Added a blank after a comma to the output of one line.

[ticket: X]
Changed the code so the main output is a single character string with formatting
from insertions of new_line so the output cannot be broken up by other writes to
the same file.

[ticket: X]
@jvdp1
Copy link
Member

jvdp1 commented Nov 16, 2020

Thanks @wclodius2 for this PR. It seems that the branch logger2 is on top of bitset3, which makes things difficult to review. Would it be possible to rebase logger2 on master? @certik @milancurcic any tips on how to this?

@milancurcic
Copy link
Member

Assuming upstream is https://github.com/fortran-lang/stdlib and origin is [email protected]:wclodius2/stdlib (if using SSH keys auth) or https://github.com/wclodius2/stdlib (if using password auth), then in William's local git repo, I think this is the procedure:

git checkout master # go to master branch in the local repo
git fetch upstream # fetch updates from the remote repo (fortran-lang/stdlib)
git merge upstream/master # merge updates into local master
git checkout -b logger-safe-async-io # create and switch to the new branch
# make changes to the files
git add <changed-file> && git commit -m "commit message" # for each meaningful unit of change
git push origin logger-safe-async-io

@milancurcic
Copy link
Member

Closing in favor of #245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants