GPI-2  1.0.0
GASPI.h File Reference

The GPI-2 interface. More...

Go to the source code of this file.

Classes

struct  gaspi_config
 A structure with configuration. More...

Macros

#define GASPI_MAJOR_VERSION   (1)
#define GASPI_MINOR_VERSION   (0)
#define GASPI_REVISION   (0)
#define GASPI_BLOCK   (0xffffffff)
#define GASPI_TEST   (0x0)
#define GASPI_MAX_NODES   (65536)
#define GASPI_SN_PORT   (10840)
#define GASPI_MAX_GROUPS   (32)
#define GASPI_MAX_MSEGS   (32)
#define GASPI_GROUP_ALL   (0)
#define GASPI_MAX_QP   (16)
#define GASPI_COLL_QP   (GASPI_MAX_QP)
#define GASPI_PASSIVE_QP   (GASPI_MAX_QP+1)
#define GASPI_MAX_TSIZE_C   ((1ul<<31ul)-1ul)
#define GASPI_MAX_TSIZE_P   ((1ul<<16ul)-1ul)
#define GASPI_MAX_QSIZE   (4096)
#define GASPI_MAX_NOTIFICATION   (65536)

Typedefs

typedef char gaspi_char
typedef unsigned char gaspi_uchar
typedef short gaspi_short
typedef unsigned short gaspi_ushort
typedef int gaspi_int
typedef unsigned int gaspi_uint
typedef long gaspi_long
typedef unsigned long gaspi_ulong
typedef float gaspi_float
typedef double gaspi_double
typedef unsigned int gaspi_timeout_t
typedef unsigned short gaspi_rank_t
typedef unsigned char gaspi_group_t
typedef unsigned int gaspi_number_t
typedef void * gaspi_pointer_t
typedef void * gaspi_state_t
typedef unsigned char * gaspi_state_vector_t
typedef unsigned char gaspi_queue_id_t
typedef unsigned long gaspi_size_t
typedef unsigned long gaspi_alloc_t
typedef unsigned char gaspi_segment_id_t
typedef unsigned long gaspi_offset_t
typedef unsigned long gaspi_atomic_value_t
typedef unsigned long gaspi_time_t
typedef unsigned short gaspi_notification_id_t
typedef unsigned int gaspi_notification_t
typedef unsigned int gaspi_statistic_counter_t
typedef char * gaspi_string_t
typedef struct gaspi_config gaspi_config_t
 A structure with configuration.
typedef gaspi_return_t(* gaspi_reduce_operation_t )(gaspi_pointer_t const operand_one, gaspi_pointer_t const operand_two, gaspi_pointer_t const result, gaspi_state_t const state, const gaspi_number_t num, const gaspi_size_t element_size, const gaspi_timeout_t timeout_ms)

Enumerations

enum  gaspi_return_t { GASPI_ERROR = -1, GASPI_SUCCESS = 0, GASPI_TIMEOUT = 1 }
 Functions return type.
enum  gaspi_network_t { GASPI_IB = 0, GASPI_ETHERNET = 1, GASPI_GEMINI = 2, GASPI_ARIES = 3 }
 Network type. More...
enum  gaspi_operation_t { GASPI_OP_MIN = 0, GASPI_OP_MAX = 1, GASPI_OP_SUM = 2 }
 Operations for Collective communication. More...
enum  gaspi_datatype_t {
  GASPI_TYPE_INT = 0, GASPI_TYPE_UINT = 1, GASPI_TYPE_FLOAT = 2, GASPI_TYPE_DOUBLE = 3,
  GASPI_TYPE_LONG = 4, GASPI_TYPE_ULONG = 5
}
 Element types for Collective communication.
enum  gaspi_qp_state_t { GASPI_STATE_HEALTHY = 0, GASPI_STATE_CORRUPT = 1 }
 State of queue.
enum  gaspi_alloc_policy_flags { GASPI_MEM_UNINITIALIZED = 0, GASPI_MEM_INITIALIZED = 1 }
 Memory allocation policy. More...
enum  gaspi_statistic_argument_t { GASPI_STATISTIC_ARGUMENT_NONE }
 Statistical information. More...

Functions

gaspi_return_t gaspi_config_get (gaspi_config_t *const config)
 Get configuration structure.
gaspi_return_t gaspi_config_set (const gaspi_config_t new_config)
 Set configuration values.
gaspi_return_t gaspi_version (float *version)
 Get version number.
gaspi_return_t gaspi_proc_init (const gaspi_timeout_t timeout_ms)
 Initialization procedure to start GPI-2.
gaspi_return_t gaspi_proc_term (const gaspi_timeout_t timeout_ms)
 Shutdown procedure.
gaspi_return_t gaspi_proc_rank (gaspi_rank_t *const rank)
 Get the process rank.
gaspi_return_t gaspi_proc_num (gaspi_rank_t *const proc_num)
 Get the number of processes (ranks) started by the application.
gaspi_return_t gaspi_proc_kill (const gaspi_rank_t rank, const gaspi_timeout_t timeout_ms)
 Kill a given process (rank).
gaspi_return_t gaspi_connect (const gaspi_rank_t rank, const gaspi_timeout_t timeout_ms)
 Connect to a determined rank to be able to communicate.
gaspi_return_t gaspi_disconnect (const gaspi_rank_t rank, const gaspi_timeout_t timeout_ms)
 Disconnect from a particular rank.
gaspi_return_t gaspi_group_create (gaspi_group_t *const group)
 Create a group.
gaspi_return_t gaspi_group_delete (const gaspi_group_t group)
 Delete a given group.
gaspi_return_t gaspi_group_add (const gaspi_group_t group, const gaspi_rank_t rank)
 Add a given rank to a group.
gaspi_return_t gaspi_group_commit (const gaspi_group_t group, const gaspi_timeout_t timeout_ms)
 Establish a group by committing it.
gaspi_return_t gaspi_group_num (gaspi_number_t *const group_num)
 Get the current number of created groups.
gaspi_return_t gaspi_group_size (const gaspi_group_t group, gaspi_number_t *const group_size)
 Get the size of a given group.
gaspi_return_t gaspi_group_ranks (const gaspi_group_t group, gaspi_rank_t *const group_ranks)
 Get the list of ranks forming a given group.
gaspi_return_t gaspi_group_max (gaspi_number_t *const group_max)
 Get the maximum number of groups allowed to be created.
gaspi_return_t gaspi_segment_alloc (const gaspi_segment_id_t segment_id, const gaspi_size_t size, const gaspi_alloc_t alloc_policy)
 Allocate a segment.
gaspi_return_t gaspi_segment_delete (const gaspi_segment_id_t segment_id)
 Delete a given segment.
gaspi_return_t gaspi_segment_register (const gaspi_segment_id_t segment_id, const gaspi_rank_t rank, const gaspi_timeout_t timeout_ms)
 Register a segment for communication.
gaspi_return_t gaspi_segment_create (const gaspi_segment_id_t segment_id, const gaspi_size_t size, const gaspi_group_t group, const gaspi_timeout_t timeout_ms, const gaspi_alloc_t alloc_policy)
 Create a segment.
gaspi_return_t gaspi_segment_num (gaspi_number_t *const segment_num)
 Get the number of allocated segments.
gaspi_return_t gaspi_segment_list (const gaspi_number_t num, gaspi_segment_id_t *const segment_id_list)
 Get a list of locally allocated segments ID's.
gaspi_return_t gaspi_segment_ptr (const gaspi_segment_id_t segment_id, gaspi_pointer_t *ptr)
 Get the pointer to the location of a given segment.
gaspi_return_t gaspi_segment_size (const gaspi_segment_id_t segment_id, const gaspi_rank_t rank, gaspi_size_t *const size)
 Get the size of a given segment.
gaspi_return_t gaspi_segment_max (gaspi_number_t *const segment_max)
 Get the maximum number of segments allowed to be allocated/created.
gaspi_return_t gaspi_barrier (const gaspi_group_t group, const gaspi_timeout_t timeout_ms)
 Barrier.
gaspi_return_t gaspi_allreduce (gaspi_pointer_t const buffer_send, gaspi_pointer_t const buffer_receive, const gaspi_number_t num, const gaspi_operation_t operation, const gaspi_datatype_t datatyp, const gaspi_group_t group, const gaspi_timeout_t timeout_ms)
 All Reduce collective operation.
gaspi_return_t gaspi_allreduce_user (gaspi_pointer_t const buffer_send, gaspi_pointer_t const buffer_receive, const gaspi_number_t num, const gaspi_size_t element_size, gaspi_reduce_operation_t const reduce_operation, gaspi_state_t const reduce_state, const gaspi_group_t group, const gaspi_timeout_t timeout_ms)
One-sided communication.
gaspi_return_t gaspi_write (const gaspi_segment_id_t segment_id_local, const gaspi_offset_t offset_local, const gaspi_rank_t rank, const gaspi_segment_id_t segment_id_remote, const gaspi_offset_t offset_remote, const gaspi_size_t size, const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 One-sided write.
gaspi_return_t gaspi_read (const gaspi_segment_id_t segment_id_local, const gaspi_offset_t offset_local, const gaspi_rank_t rank, const gaspi_segment_id_t segment_id_remote, const gaspi_offset_t offset_remote, const gaspi_size_t size, const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 One-sided read.
gaspi_return_t gaspi_write_list (const gaspi_number_t num, gaspi_segment_id_t *const segment_id_local, gaspi_offset_t *const offset_local, const gaspi_rank_t rank, gaspi_segment_id_t *const segment_id_remote, gaspi_offset_t *const offset_remote, gaspi_size_t *const size, const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 List of writes.
gaspi_return_t gaspi_read_list (const gaspi_number_t num, gaspi_segment_id_t *const segment_id_local, gaspi_offset_t *const offset_local, const gaspi_rank_t rank, gaspi_segment_id_t *const segment_id_remote, gaspi_offset_t *const offset_remote, gaspi_size_t *const size, const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 List of reads.
gaspi_return_t gaspi_wait (const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 Wait for requests posted to a given queue.
Atomic operations.
gaspi_return_t gaspi_atomic_fetch_add (const gaspi_segment_id_t segment_id, const gaspi_offset_t offset, const gaspi_rank_t rank, const gaspi_atomic_value_t val_add, gaspi_atomic_value_t *const val_old, const gaspi_timeout_t timeout_ms)
 Atomic fetch-and-add.
gaspi_return_t gaspi_atomic_compare_swap (const gaspi_segment_id_t segment_id, const gaspi_offset_t offset, const gaspi_rank_t rank, const gaspi_atomic_value_t comparator, const gaspi_atomic_value_t val_new, gaspi_atomic_value_t *const val_old, const gaspi_timeout_t timeout_ms)
 Atomic compare-and-swap.
Passive communication (2-sided).
gaspi_return_t gaspi_passive_send (const gaspi_segment_id_t segment_id_local, const gaspi_offset_t offset_local, const gaspi_rank_t rank, const gaspi_size_t size, const gaspi_timeout_t timeout_ms)
 Send data of a given size to a given rank.
gaspi_return_t gaspi_passive_receive (const gaspi_segment_id_t segment_id_local, const gaspi_offset_t offset_local, gaspi_rank_t *const rem_rank, const gaspi_size_t size, const gaspi_timeout_t timeout_ms)
 Receive data of a given size from any rank.
Weak synchronisation
gaspi_return_t gaspi_notify (const gaspi_segment_id_t segment_id_remote, const gaspi_rank_t rank, const gaspi_notification_id_t notification_id, const gaspi_notification_t notification_value, const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 Post a notification with a particular value to a given rank.
gaspi_return_t gaspi_notify_waitsome (const gaspi_segment_id_t segment_id_local, const gaspi_notification_id_t notification_begin, const gaspi_number_t num, gaspi_notification_id_t *const first_id, const gaspi_timeout_t timeout_ms)
 Wait for some notification.
gaspi_return_t gaspi_notify_reset (const gaspi_segment_id_t segment_id_local, const gaspi_notification_id_t notification_id, gaspi_notification_t *const old_notification_val)
 Reset a given notification (and retrieve its value).
gaspi_return_t gaspi_write_notify (const gaspi_segment_id_t segment_id_local, const gaspi_offset_t offset_local, const gaspi_rank_t rank, const gaspi_segment_id_t segment_id_remote, const gaspi_offset_t offset_remote, const gaspi_size_t size, const gaspi_notification_id_t notification_id, const gaspi_notification_t notification_value, const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 Write data to a given node and notify it.
gaspi_return_t gaspi_write_list_notify (const gaspi_number_t num, gaspi_segment_id_t *const segment_id_local, gaspi_offset_t *const offset_local, const gaspi_rank_t rank, gaspi_segment_id_t *const segment_id_remote, gaspi_offset_t *const offset_remote, gaspi_size_t *const size, const gaspi_segment_id_t segment_id_notification, const gaspi_notification_id_t notification_id, const gaspi_notification_t notification_value, const gaspi_queue_id_t queue, const gaspi_timeout_t timeout_ms)
 Write to different locations and notify that particular rank.
Utilities and informations
gaspi_return_t gaspi_queue_size (const gaspi_queue_id_t queue, gaspi_number_t *const queue_size)
 Get the current number of elements on a given queue.
gaspi_return_t gaspi_queue_num (gaspi_number_t *const queue_num)
 Get the number of queue available for communication.
gaspi_return_t gaspi_queue_size_max (gaspi_number_t *const queue_size_max)
 Get the maximum number of elements that can be posted to a queue (outstanding requests).
gaspi_return_t gaspi_transfer_size_min (gaspi_size_t *const transfer_size_min)
 Get the minimum size (in bytes) that can be communicated in a single request (write, read, etc.)
gaspi_return_t gaspi_transfer_size_max (gaspi_size_t *const transfer_size_max)
 Get the maximum size (in bytes) that can be communicated in a single request (read, write, etc.).
gaspi_return_t gaspi_notification_num (gaspi_number_t *const notification_num)
 Get the number of available notifications.
gaspi_return_t gaspi_passive_transfer_size_max (gaspi_size_t *const passive_transfer_size_max)
 Get the maximum allowed size (in bytes) allowed in passive communication.
gaspi_return_t gaspi_allreduce_buf_size (gaspi_size_t *const buf_size)
 Get the internal buffer size for gaspi_allreduce_user.
gaspi_return_t gaspi_allreduce_elem_max (gaspi_number_t *const elem_max)
 Get the maximum number of elements allowed in gaspi_allreduce.
gaspi_return_t gaspi_rw_list_elem_max (gaspi_number_t *const elem_max)
 Get the maximum number of elements allowed in list (read, write) operations.
gaspi_return_t gaspi_network_type (gaspi_network_t *const network_type)
 Get the network type.
gaspi_return_t gaspi_time_ticks (gaspi_time_t *const ticks)
 Get the number of cycles (ticks).
gaspi_return_t gaspi_cpu_frequency (gaspi_float *const cpu_mhz)
 Get the CPU frequency.
gaspi_return_t gaspi_machine_type (char const machine_type[16])
 Get the machine type (CPU, accelerator...)
gaspi_return_t gaspi_state_vec_get (gaspi_state_vector_t state_vector)
 Get the state vector.
void gaspi_printf (const char *fmt,...)
 GASPI printf to print the gaspi_logger.
void gaspi_print_affinity_mask ()
 Print the CPU's affinity mask.
gaspi_return_t gaspi_set_socket_affinity (const gaspi_uchar socket)
 Set socket affinity.
Profiling interface
gaspi_return_t gaspi_statistic_verbosity_level (gaspi_number_t _verbosity_level)
 Set the verbosity level.
gaspi_return_t gaspi_statistic_counter_max (gaspi_statistic_counter_t *counter_max)
 Get the maximum number of statistics counters.
gaspi_return_t gaspi_statistic_counter_info (gaspi_statistic_counter_t counter, gaspi_statistic_argument_t *counter_argument, gaspi_string_t *counter_name, gaspi_string_t *counter_description, gaspi_number_t *verbosity_level)
 Get information about a counter.
gaspi_return_t gaspi_statistic_counter_get (gaspi_statistic_counter_t counter, gaspi_number_t argument, gaspi_number_t *value)
 Get statistical counter.
gaspi_return_t gaspi_statistic_counter_reset (gaspi_statistic_counter_t counter)
 Reset a counter (set to 0).

Detailed Description

The GPI-2 interface.

Enumeration Type Documentation

Memory allocation policy.

Enumerator:
GASPI_MEM_UNINITIALIZED 

Memory will not be initialized.

GASPI_MEM_INITIALIZED 

Memory will be initialized (zero-ed)

Network type.

Enumerator:
GASPI_IB 

Infiniband.

GASPI_ETHERNET 

RoCE.

GASPI_GEMINI 

Cray Gemini (not implemented)

GASPI_ARIES 

Cray Aries (not implemented)

Operations for Collective communication.

Enumerator:
GASPI_OP_MIN 

Minimum.

GASPI_OP_MAX 

Maximum.

GASPI_OP_SUM 

Sum.

Statistical information.

Function Documentation

gaspi_return_t gaspi_allreduce ( gaspi_pointer_t const  buffer_send,
gaspi_pointer_t const  buffer_receive,
const gaspi_number_t  num,
const gaspi_operation_t  operation,
const gaspi_datatype_t  datatyp,
const gaspi_group_t  group,
const gaspi_timeout_t  timeout_ms 
)

All Reduce collective operation.

Parameters
buffer_sendThe buffer with data for the operation.
buffer_receiveThe buffer to receive the result of the operation.
numThe number of data elements in the buffer.
operationThe type of operations (see gaspi_operation_t).
datatypType of data (see gaspi_datatype_t).
groupThe group involved in the operation.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_allreduce_buf_size ( gaspi_size_t *const  buf_size)

Get the internal buffer size for gaspi_allreduce_user.

Parameters
buf_sizeOutput parameter with the buffer size.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_allreduce_elem_max ( gaspi_number_t *const  elem_max)

Get the maximum number of elements allowed in gaspi_allreduce.

Parameters
elem_maxOutput parameter with the maximum number of elements.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_atomic_compare_swap ( const gaspi_segment_id_t  segment_id,
const gaspi_offset_t  offset,
const gaspi_rank_t  rank,
const gaspi_atomic_value_t  comparator,
const gaspi_atomic_value_t  val_new,
gaspi_atomic_value_t *const  val_old,
const gaspi_timeout_t  timeout_ms 
)

Atomic compare-and-swap.

Parameters
segment_idSegment identifier of data.
offsetOffset of data.
rankThe rank where to perform the operation.
comparatorThe comparison value for the operation.
val_newThe new value to swap if comparison is successful.
val_oldOutput parameter with the old value (before the operation).
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_atomic_fetch_add ( const gaspi_segment_id_t  segment_id,
const gaspi_offset_t  offset,
const gaspi_rank_t  rank,
const gaspi_atomic_value_t  val_add,
gaspi_atomic_value_t *const  val_old,
const gaspi_timeout_t  timeout_ms 
)

Atomic fetch-and-add.

Parameters
segment_idSegment identifier where data is located.
offsetOffset where data is located.
rankThe rank where to perform the operation.
val_addThe value to add.
val_oldOutput parameter with the old value (before the add operation).
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Warning
The offset must be 8 bytes aligned.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_barrier ( const gaspi_group_t  group,
const gaspi_timeout_t  timeout_ms 
)

Barrier.

Parameters
groupThe group involved in the barrier.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_config_get ( gaspi_config_t *const  config)

Get configuration structure.

Parameters
configOutput configuration structure.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_config_set ( const gaspi_config_t  new_config)

Set configuration values.

Parameters
new_configThe new configuration to be set.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_connect ( const gaspi_rank_t  rank,
const gaspi_timeout_t  timeout_ms 
)

Connect to a determined rank to be able to communicate.

It builds the required infrastructure for communication.

Parameters
rankRank to connect to.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_cpu_frequency ( gaspi_float *const  cpu_mhz)

Get the CPU frequency.

Parameters
cpu_mhzOutput parameter with the frequency.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_disconnect ( const gaspi_rank_t  rank,
const gaspi_timeout_t  timeout_ms 
)

Disconnect from a particular rank.

Parameters
rankRank to disconnect from.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_group_add ( const gaspi_group_t  group,
const gaspi_rank_t  rank 
)

Add a given rank to a group.

Parameters
groupGroup to add.
rankRank to add to the group.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_group_commit ( const gaspi_group_t  group,
const gaspi_timeout_t  timeout_ms 
)

Establish a group by committing it.

A group needs to be committed in order to use collective operations on such group.

Parameters
groupGroup to commit.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_group_create ( gaspi_group_t *const  group)

Create a group.

In case of success, a empty group is created (without members).

Parameters
groupThe created group.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_group_delete ( const gaspi_group_t  group)

Delete a given group.

Parameters
groupGroup to delete.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_group_max ( gaspi_number_t *const  group_max)

Get the maximum number of groups allowed to be created.

Parameters
group_maxOutput parameter with the maximum number of groups.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_group_num ( gaspi_number_t *const  group_num)

Get the current number of created groups.

Parameters
group_numOutput paramter with the number of groups.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_group_ranks ( const gaspi_group_t  group,
gaspi_rank_t *const  group_ranks 
)

Get the list of ranks forming a given group.

Parameters
groupThe group we are interested in.
group_ranksOutput parameter: an array with the ranks belonging to the given group.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_group_size ( const gaspi_group_t  group,
gaspi_number_t *const  group_size 
)

Get the size of a given group.

It returns the number of processes (ranks) in the group.

Parameters
groupThe group from which we want to know the size.
group_sizeOutput parameter with the group size.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_machine_type ( char const  machine_type[16])

Get the machine type (CPU, accelerator...)

Parameters
machine_typeOutput parameter with machine type.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_network_type ( gaspi_network_t *const  network_type)

Get the network type.

Parameters
network_typeOutput parameter with the network type.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_notification_num ( gaspi_number_t *const  notification_num)

Get the number of available notifications.

Parameters
notification_numOutput parameter with the number of available notifications.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_notify ( const gaspi_segment_id_t  segment_id_remote,
const gaspi_rank_t  rank,
const gaspi_notification_id_t  notification_id,
const gaspi_notification_t  notification_value,
const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

Post a notification with a particular value to a given rank.

Parameters
segment_id_remoteThe remote segment id.
rankThe rank to notify.
notification_idThe notification id.
notification_valueThe notification value.
queueThe queue to post the notification request.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_notify_reset ( const gaspi_segment_id_t  segment_id_local,
const gaspi_notification_id_t  notification_id,
gaspi_notification_t *const  old_notification_val 
)

Reset a given notification (and retrieve its value).

Parameters
segment_id_localThe segment identifier.
notification_idThe notification identifier to reset.
old_notification_valOutput parameter with the value of the notification (before the reset).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_notify_waitsome ( const gaspi_segment_id_t  segment_id_local,
const gaspi_notification_id_t  notification_begin,
const gaspi_number_t  num,
gaspi_notification_id_t *const  first_id,
const gaspi_timeout_t  timeout_ms 
)

Wait for some notification.

Parameters
segment_id_localThe segment identifier.
notification_beginThe notification id where to start to wait.
numThe number of notifications to wait for.
first_idOutput parameter with the identifier of a received notification.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_passive_receive ( const gaspi_segment_id_t  segment_id_local,
const gaspi_offset_t  offset_local,
gaspi_rank_t *const  rem_rank,
const gaspi_size_t  size,
const gaspi_timeout_t  timeout_ms 
)

Receive data of a given size from any rank.

Parameters
segment_id_localThe segment where to place the received data.
offset_localThe local offset where to place the received data.
rem_rankOutput parameter with the sender (rank).
sizeThe size to receive.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_passive_send ( const gaspi_segment_id_t  segment_id_local,
const gaspi_offset_t  offset_local,
const gaspi_rank_t  rank,
const gaspi_size_t  size,
const gaspi_timeout_t  timeout_ms 
)

Send data of a given size to a given rank.

Parameters
segment_id_localThe local segment identifier.
offset_localThe offset where the data to send is located.
rankThe rank to send to.
sizeThe size of the data to send.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_passive_transfer_size_max ( gaspi_size_t *const  passive_transfer_size_max)

Get the maximum allowed size (in bytes) allowed in passive communication.

Parameters
passive_transfer_size_maxOutput parameter with the maximum allowed size (in bytes) for passive communication.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
void gaspi_printf ( const char *  fmt,
  ... 
)

GASPI printf to print the gaspi_logger.

Parameters
fmtprintf parameters.
gaspi_return_t gaspi_proc_init ( const gaspi_timeout_t  timeout_ms)

Initialization procedure to start GPI-2.

It is a non-local synchronous time-based blocking procedure.

Parameters
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_proc_kill ( const gaspi_rank_t  rank,
const gaspi_timeout_t  timeout_ms 
)

Kill a given process (rank).

Parameters
rankRank to kill.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_proc_num ( gaspi_rank_t *const  proc_num)

Get the number of processes (ranks) started by the application.

Parameters
proc_numThe number of processes (ranks) started by the application.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_proc_rank ( gaspi_rank_t *const  rank)

Get the process rank.

Parameters
rankRank of calling process.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_proc_term ( const gaspi_timeout_t  timeout_ms)

Shutdown procedure.

It is a synchronous local time-based blocking operation that releases resources and performs the required clean-up.

Parameters
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_queue_num ( gaspi_number_t *const  queue_num)

Get the number of queue available for communication.

Parameters
queue_numOutput parameter with the number of queues.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_queue_size ( const gaspi_queue_id_t  queue,
gaspi_number_t *const  queue_size 
)

Get the current number of elements on a given queue.

Parameters
queueThe queue to get the size.
queue_sizeOutput parameter with the size/elements in the queue.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_queue_size_max ( gaspi_number_t *const  queue_size_max)

Get the maximum number of elements that can be posted to a queue (outstanding requests).

Parameters
queue_size_maxOutput parameter with the maximum number of requests that can be posted to a queue.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_read ( const gaspi_segment_id_t  segment_id_local,
const gaspi_offset_t  offset_local,
const gaspi_rank_t  rank,
const gaspi_segment_id_t  segment_id_remote,
const gaspi_offset_t  offset_remote,
const gaspi_size_t  size,
const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

One-sided read.

Parameters
segment_id_localThe local segment id where data will be placed.
offset_localThe local offset where the data will be placed.
rankThe rank from which we want to read.
segment_id_remoteThe remote segment id to read from.
offset_remoteThe remote offset where to read from.
sizeThe size of data to read.
queueThe queue where to post the read request.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_read_list ( const gaspi_number_t  num,
gaspi_segment_id_t *const  segment_id_local,
gaspi_offset_t *const  offset_local,
const gaspi_rank_t  rank,
gaspi_segment_id_t *const  segment_id_remote,
gaspi_offset_t *const  offset_remote,
gaspi_size_t *const  size,
const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

List of reads.

Parameters
numThe number of list elements.
segment_id_localList of local segments where data will be placed.
offset_localList of local offsets where data will be placed.
rankRank from which will be read.
segment_id_remoteList of remote segments to read from.
offset_remoteList of remote offsets to read from.
sizeList of sizes to read.
queueThe queue where to post the list.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_rw_list_elem_max ( gaspi_number_t *const  elem_max)

Get the maximum number of elements allowed in list (read, write) operations.

Parameters
elem_maxOutput parameter with the maximum number of elements.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_segment_alloc ( const gaspi_segment_id_t  segment_id,
const gaspi_size_t  size,
const gaspi_alloc_t  alloc_policy 
)

Allocate a segment.

Parameters
segment_idThe segment identifier to be created.
sizeThe size of the segment to be created.
alloc_policyThe allocation policy.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_segment_create ( const gaspi_segment_id_t  segment_id,
const gaspi_size_t  size,
const gaspi_group_t  group,
const gaspi_timeout_t  timeout_ms,
const gaspi_alloc_t  alloc_policy 
)

Create a segment.

It is semantically equivalent to a collective aggregation of gaspi_segment_ alloc, gaspi_segment_register and gaspi_barrier involving all of the mem- bers of a given group.

Parameters
segment_idThe segment id to identify the segment.
sizeThe size of the segment (in bytes).
groupThe group of ranks with which the segment should be registered.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
alloc_policyMemory allocation policy.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_segment_delete ( const gaspi_segment_id_t  segment_id)

Delete a given segment.

Parameters
segment_idThe segment identifier to be deleted.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_segment_list ( const gaspi_number_t  num,
gaspi_segment_id_t *const  segment_id_list 
)

Get a list of locally allocated segments ID's.

Parameters
numThe number of segments.
segment_id_listOutput parameter with an array wit the id's of the allocated segments.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_segment_max ( gaspi_number_t *const  segment_max)

Get the maximum number of segments allowed to be allocated/created.

Parameters
segment_maxOutput paramter with the maximum number of segments.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_segment_num ( gaspi_number_t *const  segment_num)

Get the number of allocated segments.

Parameters
segment_numOutput parameter with the number of allocated segments.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_segment_ptr ( const gaspi_segment_id_t  segment_id,
gaspi_pointer_t *  ptr 
)

Get the pointer to the location of a given segment.

Parameters
segment_idThe segment identifier.
ptrOutput parameter with the pointer to the memory segment.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_segment_register ( const gaspi_segment_id_t  segment_id,
const gaspi_rank_t  rank,
const gaspi_timeout_t  timeout_ms 
)

Register a segment for communication.

In case of success, the segment can be used for communication between the involved ranks.

Parameters
segment_idSegment identified to be registered.
rankThe rank to register this segment with.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_segment_size ( const gaspi_segment_id_t  segment_id,
const gaspi_rank_t  rank,
gaspi_size_t *const  size 
)

Get the size of a given segment.

Parameters
segment_idThe segment id we are interested in.
rankThe rank.
sizeOutput parameter with the size of the segment.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_set_socket_affinity ( const gaspi_uchar  socket)

Set socket affinity.

gaspi_return_t gaspi_state_vec_get ( gaspi_state_vector_t  state_vector)

Get the state vector.

Parameters
state_vectorVector with state of each rank. The vector must be allocated with enough place to hold the state of all ranks.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_statistic_counter_get ( gaspi_statistic_counter_t  counter,
gaspi_number_t  argument,
gaspi_number_t *  value 
)

Get statistical counter.

Parameters
counterthe counter to be retrieved.
argumentthe argument for the counter.
valueOutput paramter with the current value of the counter.
Returns
GASPI_SUCCESS in case of SUCCESS, GASPI_ERROR in case of error.
gaspi_return_t gaspi_statistic_counter_info ( gaspi_statistic_counter_t  counter,
gaspi_statistic_argument_t counter_argument,
gaspi_string_t *  counter_name,
gaspi_string_t *  counter_description,
gaspi_number_t *  verbosity_level 
)

Get information about a counter.

Parameters
counterthe counter.
counter_argumentOutput parameter with meaning of the counter.
counter_nameOutput parameter with the name of the counter.
counter_descriptionOutput parameter with a more detailed description of the counter.
verbosity_levelOutput parameter with the minumum verbosity level to activate the counter.
Returns
GASPI_SUCCESS in case of SUCCESS, GASPI_ERROR in case of error.
gaspi_return_t gaspi_statistic_counter_max ( gaspi_statistic_counter_t *  counter_max)

Get the maximum number of statistics counters.

Parameters
counter_maxOutput parameter with the maximum number of counters.
Returns
GASPI_SUCCESS in case of SUCCESS, GASPI_ERROR in case of error.
gaspi_return_t gaspi_statistic_counter_reset ( gaspi_statistic_counter_t  counter)

Reset a counter (set to 0).

Parameters
counterThe counter to reset.
Returns
GASPI_SUCCESS in case of SUCCESS, GASPI_ERROR in case of error.
gaspi_return_t gaspi_statistic_verbosity_level ( gaspi_number_t  _verbosity_level)

Set the verbosity level.

Parameters
_verbosity_levelthe level of desired verbosity
Returns
GASPI_SUCCESS in case of SUCCESS, GASPI_ERROR in case of error.
gaspi_return_t gaspi_time_ticks ( gaspi_time_t *const  ticks)

Get the number of cycles (ticks).

Parameters
ticksOutput paramter with the ticks.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_transfer_size_max ( gaspi_size_t *const  transfer_size_max)

Get the maximum size (in bytes) that can be communicated in a single request (read, write, etc.).

Parameters
transfer_size_maxOutput parameter with the maximum transfer size.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_transfer_size_min ( gaspi_size_t *const  transfer_size_min)

Get the minimum size (in bytes) that can be communicated in a single request (write, read, etc.)

Parameters
transfer_size_minOutput parameter with the minimum size that be transfered.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_version ( float *  version)

Get version number.

Parameters
versionOutput parameter with version number.
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error.
gaspi_return_t gaspi_wait ( const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

Wait for requests posted to a given queue.

Parameters
queueQueue to wait for.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_write ( const gaspi_segment_id_t  segment_id_local,
const gaspi_offset_t  offset_local,
const gaspi_rank_t  rank,
const gaspi_segment_id_t  segment_id_remote,
const gaspi_offset_t  offset_remote,
const gaspi_size_t  size,
const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

One-sided write.

Parameters
segment_id_localThe local segment id with the data to write.
offset_localThe local offset with the data to write.
rankThe rank to which we want to write.
segment_id_remoteThe remote segment id to write to.
offset_remoteThe remote offset where to write to.
sizeThe size of data to write.
queueThe queue where to post the write request.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_write_list ( const gaspi_number_t  num,
gaspi_segment_id_t *const  segment_id_local,
gaspi_offset_t *const  offset_local,
const gaspi_rank_t  rank,
gaspi_segment_id_t *const  segment_id_remote,
gaspi_offset_t *const  offset_remote,
gaspi_size_t *const  size,
const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

List of writes.

Parameters
numThe number of list elements.
segment_id_localList of local segments with data to be written.
offset_localList of local offsets with data to be written.
rankRank to which will be written.
segment_id_remoteList of remote segments to write to.
offset_remoteList of remote offsets to write to.
sizeList of sizes to write.
queueThe queue where to post the list.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_write_list_notify ( const gaspi_number_t  num,
gaspi_segment_id_t *const  segment_id_local,
gaspi_offset_t *const  offset_local,
const gaspi_rank_t  rank,
gaspi_segment_id_t *const  segment_id_remote,
gaspi_offset_t *const  offset_remote,
gaspi_size_t *const  size,
const gaspi_segment_id_t  segment_id_notification,
const gaspi_notification_id_t  notification_id,
const gaspi_notification_t  notification_value,
const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

Write to different locations and notify that particular rank.

Parameters
numThe number of elements in the list.
segment_id_localThe list of local segments where data is located.
offset_localThe list of local offsets where data to write is located.
rankThe rank where to write the list and notification.
segment_id_remoteThe list of remote segments where to write.
offset_remoteThe list of remote offsets where to write.
sizeThe list of sizes to write.
segment_id_notificationThe segment id used for notification.
notification_idThe notification identifier to use.
notification_valueThe notification value to send.
queueThe queue where to post the request.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.
gaspi_return_t gaspi_write_notify ( const gaspi_segment_id_t  segment_id_local,
const gaspi_offset_t  offset_local,
const gaspi_rank_t  rank,
const gaspi_segment_id_t  segment_id_remote,
const gaspi_offset_t  offset_remote,
const gaspi_size_t  size,
const gaspi_notification_id_t  notification_id,
const gaspi_notification_t  notification_value,
const gaspi_queue_id_t  queue,
const gaspi_timeout_t  timeout_ms 
)

Write data to a given node and notify it.

Parameters
segment_id_localThe segment identifier where data to be written is located.
offset_localThe offset where the data to be written is located.
rankThe rank where to write and notify.
segment_id_remoteThe remote segment identifier where to write the data to.
offset_remoteThe remote offset where to write to.
sizeThe size of the data to write.
notification_idThe notification identifier to use.
notification_valueThe notification value used.
queueThe queue where to post the request.
timeout_msTimeout in milliseconds (or GASPI_BLOCK/GASPI_TEST).
Returns
GASPI_SUCCESS in case of success, GASPI_ERROR in case of error, GASPI_TIMEOUT in case of timeout.