Documentation for module swarm_message

Swarm-message, a convenient data-container for with build-in serialization.

source: swarm_message.F
Loading...

public Types:

swarm_message_type
...

Generic procedures:

swarm_message_add
swarm_message_get

public Subroutines/Functions:

FUNCTION
LOGICAL
swarm_message_equal (msg1, msg2)
Checks if two swarm-messages are equal
Reads a swarm-message from a given file / unit.
Write a swarm-message to a given file / unit.
SUBROUTINE
swarm_message_free (msg)
Deallocates all entries contained in a swarm-message.
FUNCTION
LOGICAL
swarm_message_haskey (msg, key)
Checks if a swarm-message contains an entry with the given key.
Broadcasts a swarm message via MPI.
Receives a swarm message via MPI.
Sends a swarm message via MPI.

public Types:

TYPE :: swarm_message_type

...


POINTER :: root => NULL() ...


Generic procedure swarm_message_add

Addes an entry from a swarm-message.

INTENT(inout)
:: msg × × × × × × × × ×
CHARACTER(*),
INTENT(in)
:: key × × × × × × × × ×
CHARACTER(*),
INTENT(in)
:: value ×
INTEGER(int_4),
INTENT(in)
:: value ×
INTEGER(int_8),
INTENT(in)
:: value ×
REAL(real_4),
INTENT(in)
:: value ×
REAL(real_8),
INTENT(in)
:: value ×
INTEGER(int_4),
INTENT(in)
:: value(:) ×
INTEGER(int_8),
INTENT(in)
:: value(:) ×
REAL(real_4),
INTENT(in)
:: value(:) ×
REAL(real_8),
INTENT(in)
:: value(:) ×

Generic procedure swarm_message_get

Returns an entry from a swarm-message.

INTENT(in)
:: msg × × × × × × × × ×
CHARACTER(*),
INTENT(in)
:: key × × × × × × × × ×
:: value ×
INTEGER(int_4),
INTENT(out)
:: value ×
INTEGER(int_8),
INTENT(out)
:: value ×
REAL(real_4),
INTENT(out)
:: value ×
REAL(real_8),
INTENT(out)
:: value ×
INTEGER(int_4),
POINTER
:: value(:) ×
INTEGER(int_8),
POINTER
:: value(:) ×
REAL(real_4),
POINTER
:: value(:) ×
REAL(real_8),
POINTER
:: value(:) ×

FUNCTIONswarm_message_equal(msg1, msg2)

Checks if two swarm-messages are equal

Return Value ::
LOGICAL
Arguments:
INTENT(in)
:: msg1 ...
INTENT(in)
:: msg2 ...

SUBROUTINEswarm_message_file_read(msg, parser, at_end)

Reads a swarm-message from a given file / unit.

Arguments:
INTENT(out)
:: msg ...
POINTER
:: parser ...
LOGICAL,
INTENT(inout)
:: at_end ...

SUBROUTINEswarm_message_file_write(msg, unit)

Write a swarm-message to a given file / unit.

Arguments:
INTENT(in)
:: msg ...
INTEGER,
INTENT(in)
:: unit ...

SUBROUTINEswarm_message_free(msg)

Deallocates all entries contained in a swarm-message.

Arguments:
INTENT(inout)
:: msg ...

FUNCTIONswarm_message_haskey(msg, key)

Checks if a swarm-message contains an entry with the given key.

Return Value ::
LOGICAL
Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...

SUBROUTINEswarm_message_mpi_bcast(msg, src, group)

Broadcasts a swarm message via MPI.

Arguments:
INTENT(inout)
:: msg ...
INTEGER,
INTENT(in)
:: src ...
INTEGER,
INTENT(in)
:: group ...

SUBROUTINEswarm_message_mpi_recv(msg, group, src, tag)

Receives a swarm message via MPI.

Arguments:
INTENT(inout)
:: msg ...
INTEGER,
INTENT(in)
:: group ...
INTEGER,
INTENT(inout)
:: src ...
INTEGER,
INTENT(inout)
:: tag ...

SUBROUTINEswarm_message_mpi_send(msg, group, dest, tag)

Sends a swarm message via MPI.

Arguments:
INTENT(in)
:: msg ...
INTEGER,
INTENT(in)
:: group ...
INTEGER,
INTENT(in)
:: dest ...
INTEGER,
INTENT(in)
:: tag ...

SUBROUTINEswarm_message_add_str(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
CHARACTER(*),
INTENT(in)
:: value ...

SUBROUTINEswarm_message_add_i4(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_4),
INTENT(in)
:: value ...

SUBROUTINEswarm_message_add_i8(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_8),
INTENT(in)
:: value ...

SUBROUTINEswarm_message_add_r4(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_4),
INTENT(in)
:: value ...

SUBROUTINEswarm_message_add_r8(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_8),
INTENT(in)
:: value ...

SUBROUTINEswarm_message_add_1d_i4(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_4),
INTENT(in)
:: value(:) ...

SUBROUTINEswarm_message_add_1d_i8(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_8),
INTENT(in)
:: value(:) ...

SUBROUTINEswarm_message_add_1d_r4(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_4),
INTENT(in)
:: value(:) ...

SUBROUTINEswarm_message_add_1d_r8(msg, key, value)

Addes an entry from a swarm-message.

Arguments:
INTENT(inout)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_8),
INTENT(in)
:: value(:) ...

SUBROUTINEswarm_message_get_str(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
:: value ...

SUBROUTINEswarm_message_get_i4(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_4),
INTENT(out)
:: value ...

SUBROUTINEswarm_message_get_i8(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_8),
INTENT(out)
:: value ...

SUBROUTINEswarm_message_get_r4(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_4),
INTENT(out)
:: value ...

SUBROUTINEswarm_message_get_r8(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_8),
INTENT(out)
:: value ...

SUBROUTINEswarm_message_get_1d_i4(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_4),
POINTER
:: value(:) ...

SUBROUTINEswarm_message_get_1d_i8(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
INTEGER(int_8),
POINTER
:: value(:) ...

SUBROUTINEswarm_message_get_1d_r4(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_4),
POINTER
:: value(:) ...

SUBROUTINEswarm_message_get_1d_r8(msg, key, value)

Returns an entry from a swarm-message.

Arguments:
INTENT(in)
:: msg ...
CHARACTER(*),
INTENT(in)
:: key ...
REAL(real_8),
POINTER
:: value(:) ...

private Parameters/Types:

Parameters:

INTEGER
:: key_length = 20
private Types:

TYPE :: message_entry_type

...


CHARACTER(key_length)
:: key ...
POINTER :: next => NULL() ...
POINTER :: value_str => NULL() ...
INTEGER(int_4),
POINTER :: value_i4 => NULL() ...
INTEGER(int_8),
POINTER :: value_i8 => NULL() ...
REAL(real_4),
POINTER :: value_r4 => NULL() ...
REAL(real_8),
POINTER :: value_r8 => NULL() ...
INTEGER(int_4),
DIMENSION(:), POINTER :: value_1d_i4 => NULL() ...
INTEGER(int_8),
DIMENSION(:), POINTER :: value_1d_i8 => NULL() ...
REAL(real_4),
DIMENSION(:), POINTER :: value_1d_r4 => NULL() ...
REAL(real_8),
DIMENSION(:), POINTER :: value_1d_r8 => NULL() ...