Giter Club home page Giter Club logo

fhash's People

Contributors

jhaiduce avatar lkedward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fhash's Issues

Performance optimisation

Look into replacing the singly-linked lists with either dynamic arrays or recursively allocated types.

GNU extension: Different type kinds

fhash_tbl.f90 contains several calls to the modulo intrinsic function in which different integer kinds are passed, which is not allowed per the Fortran 2008 standard.

If the code is compiled using gfortran with the -std=f2008 option set the following errors are issued:

src/fhash_tbl.f90:298:28:

  298 |   index = modulo(key%hash(),size(tbl%buckets)) + 1
      |                            1
Error: GNU Extension: Different type kinds at (1)
src/fhash_tbl.f90:245:28:

  245 |   index = modulo(key%hash(),size(tbl%buckets)) + 1
      |                            1
Error: GNU Extension: Different type kinds at (1)
src/fhash_tbl.f90:165:28:

  165 |   index = modulo(key%hash(),size(tbl%buckets)) + 1
      |                            1
Error: GNU Extension: Different type kinds at (1)
src/fhash_tbl.f90:133:28:

  133 |   index = modulo(key%hash(),size(tbl%buckets)) + 1
      |                            1
Error: GNU Extension: Different type kinds at (1)

stats initial value

Hi @LKedward. In the following code I'd expect the output num_items : 0

program main
use fhash
implicit none

type(fhash_tbl_t) :: tbl
integer :: num_buckets, num_items, num_collisions, max_depth

call tbl%stats(num_buckets, num_items, num_collisions, max_depth)
print *, 'num_items:', num_items
  
end program main

The result is a big number:

fhash

This happens on Windows 10.

clash with ifort 2021.3.20210609

no problem with the gfortran versions I have, but withifort (IFORT) 2021.3.0 20210609
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

I get the following clash

build/dependencies/fhash/src/fhash_tbl.f90(501): error #5286: Ambiguous generic interface GET: previously declared specific procedure FHASH_TBL_GET_INT32 is not distinguishable from this declaration. [FHASH_TBL_GET_RAW]
subroutine fhash_tbl_get_raw(tbl,key,value,stat)
-----------^
build/dependencies/fhash/src/fhash_tbl.f90(597): catastrophic error: Too many errors, exiting
compilation aborted for build/dependencies/fhash/src/fhash_tbl.f90 (code 1)
STOP 1
<ERROR> Compilation failed for object " build_dependencies_fhash_src_fhash_tbl.f90.o "
<ERROR>stopping due to failed compilation

Issues on Windows/MacOS for release build

When built in release mode on Windows with gfortran 8.1.0 and MacOS with gfortran 9.3.0, the hashing testsuite fails.
See github actions output.

On MacOS the tests run to completion but fail, e.g.:

# Starting int32-hashing ... (3/6)
#     ...int32-hashing                 [FAILED]
#Message:String hash check failed for 32bit integer "           0"
 expected "4B95F515" but got "FFFFFFFF"

On Windows, the tests encounter the same failure as above but segfault in the SLL testsuite before completing.

NB. All tests and demos run fine on Ubuntu with gfortran 9.3.0 when built in release mode.

Edit: Looks like the problem is with int64 overflow behaviour in optimised builds. Failing builds are not wrapping round, but ceiling at huge(int64). Should rewrite hash implementations in C with proper unsigned ints.

Intel fortran build error: intrinsic assignment error

When building a program with fhash as a dependency using fpm specifying ifort as the compiler I received the following error:

$ fpm build --compiler ifort
 + ifort -c app/main.f90 -warn all -check:all:noarg_temp_created -error-limit 1 -O0 -g -assume byterecl -traceback -module build/ifort_BFE5DBA90E3838BC/mapred_project -I build/ifort_BFE5DBA90E3838BC/mapred_project -o build/ifort_BFE5DBA90E3838BC/mapred_project/app_main.f90.o
 + ifort -c build/dependencies/fhash/src/fhash_data_container.f90 -warn all -check:all:noarg_temp_created -error-limit 1 -O0 -g -assume byterecl -traceback -module build/ifort_BFE5DBA90E3838BC/mapred_project -I build/ifort_BFE5DBA90E3838BC/mapred_project -o build/ifort_BFE5DBA90E3838BC/mapred_project/build_dependencies_fhash_src_fhash_data_container.f90.o
build/dependencies/fhash/src/fhash_data_container.f90(96): error #8304: In an intrinsic assignment statement, variable shall not be polymorphic.   [RAW]
      raw = data
------^
build/dependencies/fhash/src/fhash_data_container.f90(244): catastrophic error: Too many errors, exiting
compilation aborted for build/dependencies/fhash/src/fhash_data_container.f90 (code 1)
 Command failed
ERROR STOP 

Error termination. Backtrace:
#0  0x55ccb6e5409c in ???
#1  0x55ccb6e622bb in ???
#2  0x55ccb6e625ac in ???
#3  0x2ba3f5588e8b in GOMP_parallel
	at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1610729750655/work/.build/x86_64-conda-linux-gnu/src/gcc/libgomp/parallel.c:171
#4  0x55ccb6e8a65f in ???
#5  0x55ccb6e97142 in ???
#6  0x55ccb6e2613f in ???
#7  0x2ba3f58fc554 in ???
#8  0x55ccb6e261b8 in ???

Do Concurrent compatability

This falls under feature request instead of issue, but the current implantation of the tbl%get function has a couple 'non pure' subroutines, which block usage in 'Do Concurrent' loops. Not sure how difficult to change, but would be nice to be able to remove that restriction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.