KMR
Data Types | Functions/Subroutines | Variables
kmrf.F90 File Reference

KMR Fortran Binding. More...

Go to the source code of this file.

Data Types

interface  kmrf::kmr_add_kv
 (See kmr_add_kv() in C). More...
 
interface  kmrf::kmr_add_kv_done
 (See kmr_add_kv_done() in C). More...
 
interface  kmrf::kmr_create_kvs7_ff
 
interface  kmrf::kmr_dblint
 Converts a double to a long for key/value (ill-mannered). More...
 
interface  kmrf::kmr_dump_kvs
 (See kmr_dump_kvs() in C). More...
 
interface  kmrf::kmr_fin
 (See kmr_fin() in C). More...
 
interface  kmrf::kmr_fix_bits_endian_ff
 Fixes little-endian bits used in Fortran to host-endian. More...
 
interface  kmrf::kmr_free_context
 (See kmr_free_context() in C). More...
 
interface  kmrf::kmr_free_kvs
 (See kmr_free_kvs() in C). More...
 
interface  kmrf::kmr_get_context_of_kvs
 (See kmr_get_context_of_kvs() in C). More...
 
interface  kmrf::kmr_get_element_count
 (See kmr_get_element_count() in C). More...
 
interface  kmrf::kmr_get_key_type
 
interface  kmrf::kmr_get_nprocs
 Gets MPI nprocs from a key-value stream. More...
 
interface  kmrf::kmr_get_rank
 Gets MPI rank from a key-value stream. More...
 
interface  kmrf::kmr_get_spawner_communicator_ff
 
interface  kmrf::kmr_get_value_type
 
interface  kmrf::kmr_intdbl
 Converts in reverse of kmr_dblint. More...
 
interface  kmrf::kmr_intptr
 Converts in reverse of kmr_ptrint. More...
 
interface  kmrf::kmr_intstr
 Converts in reverse of kmr_strint(). More...
 
type  kmrf::kmr_kv_box
 struct kmr_kv_box {int klen; int vlen; unit_sized k; unit_sized v;}; More...
 
interface  kmrf::kmr_local_element_count
 Returns the element count local on each node. More...
 
interface  kmrf::kmr_map_once_ff
 
interface  kmrf::kmr_map_via_spawn_ff
 
interface  kmrf::kmr_mapfn
 Type of map-function. More...
 
interface  kmrf::kmr_ptrint
 Converts a pointer to a long for key/value (ill-mannered). More...
 
interface  kmrf::kmr_ptrstr
 Converts in reverse of kmr_strptr. More...
 
interface  kmrf::kmr_redfn
 Type of reduce-function. More...
 
interface  kmrf::kmr_replicate_ff
 
interface  kmrf::kmr_reverse_ff
 
interface  kmrf::kmr_shuffle_ff
 
interface  kmrf::kmr_sort_ff
 
interface  kmrf::kmr_sort_locally_ff
 
type  kmrf::kmr_spawn_info
 
interface  kmrf::kmr_strint
 Converts a character array to a (pointer value) integer for key/value (it is casting in C). More...
 
interface  kmrf::kmr_strptr
 Converts a string to a C pointer (ill-mannered). More...
 

Functions/Subroutines

subroutine kmrf::kmr_assert (v, expr)
 Asserts the expression to be true. More...
 
type(c_ptr) function kmrf::kmr_create_context (comm, info)
 (See kmr_create_context() in C). More...
 
type(c_ptr) function kmrf::kmr_create_kvs (mr, kf, vf)
 (See kmr_create_kvs() in C). More...
 
integer(c_long) function kmrf::kmr_fixopt (b)
 Fixes bits-endian of option bits. More...
 
integer(c_int) function kmrf::kmr_get_spawner_communicator (mr, ii, comm)
 (See kmr_get_spawner_communicator() in C). More...
 
integer(c_int) function kmrf::kmr_init ()
 (See kmr_init() in C). More...
 
integer(c_int) function kmrf::kmr_map (kvi, kvo, p, opt, m)
 (See kmr_map() in C). More...
 
integer(c_int) function kmrf::kmr_map_ms (kvi, kvo, p, opt, m)
 (See kmr_map_ms() in C). More...
 
integer(c_int) function kmrf::kmr_map_on_rank_zero (kvo, p, opt, m)
 (See kmr_map_on_rank_zero() in C). More...
 
integer(c_int) function kmrf::kmr_map_once (kvo, p, opt, rankzeroonly, m)
 (See kmr_map_once() in C). More...
 
integer(c_int) function kmrf::kmr_map_via_spawn (kvi, kvo, p, info, opt, m)
 (See kmr_map_via_spawn() in C). More...
 
integer(c_int) function kmrf::kmr_nullmapfn (kv, kvi, kvo, p, i)
 Places null function. More...
 
integer(c_int) function kmrf::kmr_reduce (kvi, kvo, p, opt, r)
 (See kmr_reduce() in C). More...
 
integer(c_int) function kmrf::kmr_replicate (kvi, kvo, opt)
 (See kmr_replicate() in C). More...
 
integer(c_int) function kmrf::kmr_reverse (kvi, kvo, opt)
 (See kmr_reverse() in C). More...
 
integer(c_int) function kmrf::kmr_shuffle (kvi, kvo, opt)
 (See kmr_shuffle() in C). More...
 
integer(c_int) function kmrf::kmr_sort (kvi, kvo, opt)
 (See kmr_sort() in C). More...
 
integer(c_int) function kmrf::kmr_sort_locally (kvi, kvo, shuffling, opt)
 (See kmr_sort_locally() in C). More...
 

Variables

integer(c_int), parameter kmrf::kmr_each_rank = ishft(1, 0)
 Option bits (OR'ed) to mapping on files (see kmr_file_option). More...
 
integer(c_int), parameter kmrf::kmr_inspect = ishft(1, 1)
 
integer(c_int), parameter kmrf::kmr_keep_open = ishft(1, 2)
 
integer(c_int), parameter kmrf::kmr_key_as_rank = ishft(1, 3)
 
integer(c_int), parameter kmrf::kmr_kv_cstring = 2
 
integer(c_int), parameter kmrf::kmr_kv_float8 = 4
 
integer(c_int), parameter kmrf::kmr_kv_integer = 3
 
integer(c_int), parameter kmrf::kmr_kv_opaque = 1
 Data presentation of keys and values (see kmr_kv_field in C). More...
 
integer(c_int), parameter kmrf::kmr_kv_pointer_owned = 5
 
integer(c_int), parameter kmrf::kmr_kv_pointer_unmanaged = 6
 
integer(c_int), parameter kmrf::kmr_list_file = ishft(1, 2)
 
integer(c_int), parameter kmrf::kmr_nothreading = ishft(1, 0)
 Option bits (OR'ed) to mapping and reduction (see kmr_option). More...
 
integer(c_int), parameter kmrf::kmr_one_by_one = ishft(1, 3)
 
integer(c_int), parameter kmrf::kmr_rank_zero = ishft(1, 4)
 
integer(c_int), parameter kmrf::kmr_reply_each = ishft(1, 1)
 
integer(c_int), parameter kmrf::kmr_reply_root = ishft(1, 2)
 
integer(c_int), parameter kmrf::kmr_separator_space = ishft(1, 0)
 Option bits (OR'ed) to mapping by spawning (see kmr_spawn_option). More...
 
integer(c_int), parameter kmrf::kmr_shuffle_names = ishft(1, 3)
 
integer(c_int), parameter kmrf::kmr_subdirectories = ishft(1, 1)
 

Detailed Description

KMR Fortran Binding.

KMR mixes-up integers, doubles, and pointers in passing key-value pairs as all occupy 8 bytes, and KMR defines bad-mannered converters. See the definition kmr_kv_box in C, where it uses union, but just long in the Fortran binding. Options to mapper/shuffler/reducer are integers (c_int) in Fortran, instead of structures in C. So, zero means no options. Integer options are converted to long-integers (c_int to c_long) before passing to C routines. This conversion is needed because structure options are compatible to long-integers. Conversion is done by kmr_fixopt() defined here.

Definition in file kmrf.F90.

Function/Subroutine Documentation

subroutine kmrf::kmr_assert ( logical, intent(in)  v,
character(len=*), intent(in)  expr 
)

Asserts the expression to be true.

Definition at line 534 of file kmrf.F90.

integer(c_int) function kmrf::kmr_nullmapfn ( type(kmr_kv_box), intent(in), value  kv,
type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
type(c_ptr), intent(in), value  p,
integer(c_long), intent(in), value  i 
)

Places null function.

Use kmr_nullmapfn for a C null function. It is a placeholder and never called.

Definition at line 547 of file kmrf.F90.

integer(c_long) function kmrf::kmr_fixopt ( integer(c_int), intent(in), value  b)

Fixes bits-endian of option bits.

Definition at line 576 of file kmrf.F90.

integer(c_int) function kmrf::kmr_init ( )

(See kmr_init() in C).

Definition at line 583 of file kmrf.F90.

type(c_ptr) function kmrf::kmr_create_context ( integer, intent(in), value  comm,
integer, intent(in), value  info 
)

(See kmr_create_context() in C).

Definition at line 594 of file kmrf.F90.

type(c_ptr) function kmrf::kmr_create_kvs ( type(c_ptr), intent(in), value  mr,
integer(c_int), intent(in), value  kf,
integer(c_int), intent(in), value  vf 
)

(See kmr_create_kvs() in C).

Definition at line 603 of file kmrf.F90.

integer(c_int) function kmrf::kmr_map ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
type(c_ptr), intent(in), value  p,
integer(c_int), intent(in), value  opt,
procedure(kmr_mapfn m 
)

(See kmr_map() in C).

Definition at line 612 of file kmrf.F90.

integer(c_int) function kmrf::kmr_map_on_rank_zero ( type(c_ptr), intent(in), value  kvo,
type(c_ptr), intent(in), value  p,
integer(c_int), intent(in), value  opt,
procedure(kmr_mapfn m 
)

(See kmr_map_on_rank_zero() in C).

Definition at line 623 of file kmrf.F90.

integer(c_int) function kmrf::kmr_map_once ( type(c_ptr), intent(in), value  kvo,
type(c_ptr), intent(in), value  p,
integer(c_int), intent(in), value  opt,
logical, intent(in), value  rankzeroonly,
procedure(kmr_mapfn m 
)

(See kmr_map_once() in C).

Definition at line 636 of file kmrf.F90.

integer(c_int) function kmrf::kmr_map_ms ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
type(c_ptr), intent(in), value  p,
integer(c_int), intent(in), value  opt,
procedure(kmr_mapfn m 
)

(See kmr_map_ms() in C).

Definition at line 654 of file kmrf.F90.

integer(c_int) function kmrf::kmr_map_via_spawn ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
type(c_ptr), intent(in), value  p,
integer, intent(in), value  info,
integer(c_int), intent(in), value  opt,
procedure(kmr_mapfn m 
)

(See kmr_map_via_spawn() in C).

Definition at line 666 of file kmrf.F90.

integer(c_int) function kmrf::kmr_get_spawner_communicator ( type(c_ptr), intent(in), value  mr,
integer(c_long), intent(in), value  ii,
integer, intent(out)  comm 
)

(See kmr_get_spawner_communicator() in C).

MPI_Comm_free() cannot be used on the returned communicator in the Fortran binding.

Definition at line 689 of file kmrf.F90.

integer(c_int) function kmrf::kmr_sort_locally ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
logical(c_bool), intent(in), value  shuffling,
integer(c_int), intent(in), value  opt 
)

(See kmr_sort_locally() in C).

Definition at line 698 of file kmrf.F90.

integer(c_int) function kmrf::kmr_shuffle ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
integer(c_int), intent(in), value  opt 
)

(See kmr_shuffle() in C).

Definition at line 709 of file kmrf.F90.

integer(c_int) function kmrf::kmr_replicate ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
integer(c_int), intent(in), value  opt 
)

(See kmr_replicate() in C).

Definition at line 719 of file kmrf.F90.

integer(c_int) function kmrf::kmr_reduce ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
type(c_ptr), intent(in), value  p,
integer(c_int), intent(in), value  opt,
procedure(kmr_redfn r 
)

(See kmr_reduce() in C).

Definition at line 729 of file kmrf.F90.

integer(c_int) function kmrf::kmr_sort ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
integer(c_int), intent(in), value  opt 
)

(See kmr_sort() in C).

Definition at line 741 of file kmrf.F90.

integer(c_int) function kmrf::kmr_reverse ( type(c_ptr), intent(in), value  kvi,
type(c_ptr), intent(in), value  kvo,
integer(c_int), intent(in), value  opt 
)

(See kmr_reverse() in C).

Definition at line 751 of file kmrf.F90.

Variable Documentation

integer(c_int), parameter kmrf::kmr_kv_opaque = 1

Data presentation of keys and values (see kmr_kv_field in C).

Definition at line 34 of file kmrf.F90.

integer(c_int), parameter kmrf::kmr_nothreading = ishft(1, 0)

Option bits (OR'ed) to mapping and reduction (see kmr_option).

Definition at line 44 of file kmrf.F90.

integer(c_int), parameter kmrf::kmr_each_rank = ishft(1, 0)

Option bits (OR'ed) to mapping on files (see kmr_file_option).

Definition at line 53 of file kmrf.F90.

integer(c_int), parameter kmrf::kmr_separator_space = ishft(1, 0)

Option bits (OR'ed) to mapping by spawning (see kmr_spawn_option).

Definition at line 61 of file kmrf.F90.