Yet Another eXchange Tool 0.11.2
Loading...
Searching...
No Matches
xt_idxlist.h File Reference

index list declaration More...

#include <stdlib.h>
#include <xt/xt_config.h>
#include <xt/xt_core.h>
#include <xt/xt_stripe.h>
Include dependency graph for xt_idxlist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Xt_bounds
 

Functions

void xt_idxlist_delete (Xt_idxlist idxlist)
 
size_t xt_idxlist_get_pack_size (Xt_idxlist idxlist, MPI_Comm comm)
 
void xt_idxlist_pack (Xt_idxlist idxlist, void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
Xt_idxlist xt_idxlist_unpack (void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
Xt_idxlist xt_idxlist_get_intersection (Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)
 
Xt_idxlist xt_idxlist_get_intersection_custom (Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst, Xt_config config)
 
Xt_idxlist xt_idxlist_copy (Xt_idxlist idxlist)
 
Xt_idxlist xt_idxlist_sorted_copy (Xt_idxlist idxlist)
 
Xt_idxlist xt_idxlist_sorted_copy_custom (Xt_idxlist idxlist, Xt_config config)
 
int xt_idxlist_get_num_indices (Xt_idxlist idxlist)
 
void xt_idxlist_get_indices (Xt_idxlist idxlist, Xt_int *indices)
 
const Xt_intxt_idxlist_get_indices_const (Xt_idxlist idxlist)
 
int xt_idxlist_get_num_index_stripes (Xt_idxlist idxlist)
 
void xt_idxlist_get_index_stripes (Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
 
int xt_idxlist_get_index_at_position (Xt_idxlist idxlist, int position, Xt_int *index)
 
int xt_idxlist_get_indices_at_positions (Xt_idxlist idxlist, const int *positions, int num_pos, Xt_int *indices, Xt_int undef_idx)
 
int xt_idxlist_get_position_of_index (Xt_idxlist idxlist, Xt_int index, int *position)
 
int xt_idxlist_get_positions_of_indices (Xt_idxlist idxlist, const Xt_int *indices, int num_indices, int *positions, int single_match_only)
 
int xt_idxlist_get_pos_exts_of_index_stripes (Xt_idxlist idxlist, int num_stripes, const struct Xt_stripe stripes[num_stripes], int *num_ext, struct Xt_pos_ext **pos_ext, int single_match_only)
 
int xt_idxlist_get_position_of_index_off (Xt_idxlist idxlist, Xt_int index, int *position, int offset)
 
int xt_idxlist_get_positions_of_indices_off (Xt_idxlist idxlist, const Xt_int *indices, int num_indices, int *positions, int *offsets)
 
Xt_int xt_idxlist_get_min_index (Xt_idxlist idxlist)
 
Xt_int xt_idxlist_get_max_index (Xt_idxlist idxlist)
 
int xt_idxlist_get_sorting (Xt_idxlist idxlist)
 
void xt_idxlist_get_bounding_box (Xt_idxlist idxlist, unsigned ndim, const Xt_int global_size[ndim], Xt_int global_start_index, struct Xt_bounds bounds[ndim])
 
Xt_uid xt_idxlist_get_uid (Xt_idxlist idxlist)
 
int xt_idxlist_is_stripe_conversion_profitable (Xt_idxlist idxlist, Xt_config config)
 

Detailed Description

index list declaration

Author
Jörg Behrens behre.nosp@m.ns@d.nosp@m.krz.d.nosp@m.e Moritz Hanke hanke.nosp@m.@dkr.nosp@m.z.de Thomas Jahns jahns.nosp@m.@dkr.nosp@m.z.de

contains declaration for the index list datatype

Definition in file xt_idxlist.h.

Function Documentation

◆ xt_idxlist_copy()

Xt_idxlist xt_idxlist_copy ( Xt_idxlist idxlist)

generates a copy of a given index list

Parameters
[in]idxlistindex list that is to be copied
Returns
copy of the given index list
Examples
test_idxlist_collection.c, test_idxsection.c, test_idxstripes.c, test_idxvec.c, and test_uid.c.

Definition at line 94 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_delete()

void xt_idxlist_delete ( Xt_idxlist idxlist)

destructor for an index list

Parameters
[in]idxlistindex list that is to be destroyed
Examples
idxlist_examples.c, idxsection_examples.c, rrobin.c, test_idxempty.c, test_idxlist_collection.c, test_idxlist_utils.c, test_idxmod.c, test_idxsection.c, test_idxstripes.c, test_idxvec.c, test_redist_collection.c, test_redist_collection_parallel.c, test_redist_collection_static_parallel.c, test_redist_common.c, test_redist_p2p.c, test_redist_p2p_parallel.c, test_redist_repeat_parallel.c, test_uid.c, test_xmap_common.c, test_xmap_common_parallel.c, and test_xmap_intersection_parallel.c.

Definition at line 75 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_bounding_box()

void xt_idxlist_get_bounding_box ( Xt_idxlist idxlist,
unsigned ndim,
const Xt_int global_size[ndim],
Xt_int global_start_index,
struct Xt_bounds bounds[ndim] )

computes an n-dimensional bounding box around the given index list

Parameters
[in]idxlistindex list
[in]ndimnumber of dimension of the bounding box
[in]global_sizeglobal size of the n-dimensional index space for which the bounding box is to be computed
[in]global_start_indexlowest index of the index space (typically 0 or 1)
[out]boundsbounds of the bounding box
Remarks
the behaviour of the routine is undefined in case the given index space does not fit the indices
global_size has to be positive
Examples
test_idxempty.c, test_idxlist_collection.c, test_idxsection.c, test_idxstripes.c, and test_idxvec.c.

Definition at line 379 of file xt_idxlist.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_idxlist_get_index_at_position()

int xt_idxlist_get_index_at_position ( Xt_idxlist idxlist,
int position,
Xt_int * index )

gets the index stored at the specified position in an index list

Parameters
[in]idxlistindex list
[in]positionposition of the index that is to be retrieved
[out]indexindex stored in the index list at the given position
Returns
0 if index could be retrieved
1 if position is out of range
Examples
test_idxlist_utils.c, test_idxstripes.c, and test_idxvec.c.

Definition at line 176 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_index_stripes()

void xt_idxlist_get_index_stripes ( Xt_idxlist idxlist,
struct Xt_stripe ** stripes,
int * num_stripes )

returns the indices stored in an index list the indices are returned in form of stripes

Parameters
[in]idxlistindex list for which the indices are to be returned
[out]stripesarray containing the stripes (user is responsible for freeing the memory associated with the stripes)
[out]num_stripesnumber of stripes in array "stripes"
Examples
test_idxempty.c, test_idxlist_collection.c, test_idxlist_utils.c, test_idxsection.c, test_idxstripes.c, and test_idxvec.c.

Definition at line 135 of file xt_idxlist.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_idxlist_get_indices()

void xt_idxlist_get_indices ( Xt_idxlist idxlist,
Xt_int * indices )

gets the indices stored in an index list

Parameters
[in]idxlistindex list for which the indices are to be returned
[in,out]indicesarray into which the indices are written
Examples
test_idxlist_utils.c, test_redist_collection_parallel.c, test_redist_collection_static_parallel.c, and test_redist_repeat_parallel.c.

Definition at line 113 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_indices_at_positions()

int xt_idxlist_get_indices_at_positions ( Xt_idxlist idxlist,
const int * positions,
int num_pos,
Xt_int * indices,
Xt_int undef_idx )

get indices stored at the specified positions in an index list

Parameters
[in]idxlistindex list
[in]positionspositions of the selected indices
[in]num_posnumber of positions
[out]indicesselected indices
[in]undef_idxfallback value that is used if a position is invalid
Returns
zero if no substitutions were necessary or
number of unresolved positions ( == number of undef values assigned to the result)
Examples
test_idxstripes.c, and test_idxvec.c.

Definition at line 183 of file xt_idxlist.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_idxlist_get_indices_const()

const Xt_int * xt_idxlist_get_indices_const ( Xt_idxlist idxlist)

gets a pointer of the constant indices stored in an index list

Parameters
[in]idxlistindex list for which the indices are to be returned
Returns
pointer to const indices array, or NULL if xt_idxlist_get_num_indices(idxlist) == 0
Examples
test_idxlist_utils.c, and test_idxsection.c.

Definition at line 119 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_intersection()

Xt_idxlist xt_idxlist_get_intersection ( Xt_idxlist idxlist_src,
Xt_idxlist idxlist_dst )

computes the intersection between two index lists

Parameters
[in]idxlist_srcindex list for sender
[in]idxlist_dstindex list for receiver
Returns
return the intersection of idxlist_a and idxlist_b
Remarks
multiple occurrences of an element in idxlist_dst will result in multiple occurrences of the element in the intersection if idxlist_src contains it
the elements in the resulting index list are sorted
Examples
test_idxempty.c, test_idxlist_collection.c, test_idxlist_utils.c, test_idxsection.c, test_idxstripes.c, and test_idxvec.c.

Definition at line 96 of file xt_idxlist_intersection.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_idxlist_get_intersection_custom()

Xt_idxlist xt_idxlist_get_intersection_custom ( Xt_idxlist idxlist_src,
Xt_idxlist idxlist_dst,
Xt_config config )

computes the intersection between two index lists with custom configuration

Parameters
[in]idxlist_srcindex list for sender
[in]idxlist_dstindex list for receiver
[in]configcustom configuration parameters
Returns
return the intersection of idxlist_a and idxlist_b
Remarks
multiple occurrences of an element in idxlist_dst will result in multiple occurrences of the element in the intersection if idxlist_src contains it
the elements in the resulting index list are sorted

Definition at line 104 of file xt_idxlist_intersection.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_max_index()

Xt_int xt_idxlist_get_max_index ( Xt_idxlist idxlist)

gets the largest index stored in the index list

Parameters
[in]idxlistindex list
Returns
biggest index in idxlist
Examples
test_idxlist_utils.c.

Definition at line 354 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_min_index()

Xt_int xt_idxlist_get_min_index ( Xt_idxlist idxlist)

gets the smallest index stored in the index list

Parameters
[in]idxlistindex list
Returns
smallest index in idxlist
Examples
test_idxlist_utils.c.

Definition at line 349 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_num_index_stripes()

int xt_idxlist_get_num_index_stripes ( Xt_idxlist idxlist)

returns the number of stripes needed to represent the indices stored in an index list

Parameters
[in]idxlistindex list for which to query the number of stripes
Returns
num_stripes number of stripes in array "stripes"

Definition at line 129 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_num_indices()

int xt_idxlist_get_num_indices ( Xt_idxlist idxlist)

returns the number of indices stored in the given index list

Parameters
[in]idxlistindex list for which the number of indices is required
Returns
number of indices in the given index list

Definition at line 109 of file xt_idxlist.c.

◆ xt_idxlist_get_pack_size()

size_t xt_idxlist_get_pack_size ( Xt_idxlist idxlist,
MPI_Comm comm )

computes the buffer size in byte that is required to pack the given index list using MPI_Pack

Parameters
[in]idxlistindex list for which the packed size needs to be computed
[in]commMPI communicator that will be used to send the buffer for which the size is computed
Returns
returns an upper bound on the size in bytes of the packed index list
Remarks
You need to provide the same buffer for all related calls of xt_idxlist_get_pack_size , xt_idxlist_pack and xt_idxlist_unpack
See also
xt_idxlist_pack
xt_idxlist_unpack
Examples
test_idxlist_utils.c.

Definition at line 80 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_pos_exts_of_index_stripes()

int xt_idxlist_get_pos_exts_of_index_stripes ( Xt_idxlist idxlist,
int num_stripes,
const struct Xt_stripe stripes[num_stripes],
int * num_ext,
struct Xt_pos_ext ** pos_ext,
int single_match_only )

maps the positions of the first occurrence of the given index stripes in the stored index list

Parameters
[in]idxlistindex list in which the given index is to be searched
[in]num_stripesnumber of stripes in the array stripes
[in]stripesstripes of indices that are to be searched
[out]num_extnumber of extents allocated in pos_exts
[out]pos_extranges of positions for the first occurrence of the indices from stripes in idxlist the pointee is newly allocated and must be freed by the caller
[in]single_match_onlyif true then do not consider a previous matching position again in the next index search - this is required on the target side in order to avoid multiple writes to the same memory position
Returns
0 if every index could be found >0 number of indices which could not be found in idxlist
Examples
test_idxstripes.c.

Definition at line 262 of file xt_idxlist.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_idxlist_get_position_of_index()

int xt_idxlist_get_position_of_index ( Xt_idxlist idxlist,
Xt_int index,
int * position )

gets the position of the first occurrence of the given index in the stored index list

Parameters
[in]idxlistindex list in which the given index is to be searched
[in]indexindex that is to be searched
[out]positionposition of the first occurrence of index in idxlist,
or -1 if there is no match
Returns
0 if index was found 1 if the index could not be found in idxlist
Examples
test_idxlist_utils.c, test_idxsection.c, and test_idxvec.c.

Definition at line 214 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_position_of_index_off()

int xt_idxlist_get_position_of_index_off ( Xt_idxlist idxlist,
Xt_int index,
int * position,
int offset )

gets the position of the first occurrence of the given index following the given offset in the stored index list idxlist

Parameters
[in]idxlistindex list in which the given index is to be searched
[in]indexindex that is to be searched
[out]positionposition of the first occurrence of index in idxlist with a position >= offset
[in]offsetoffset in the index list from which on the search is to be conducted
Returns
0 if index was found
1 if the index could not be found in idxlist
Examples
test_idxlist_utils.c, and test_idxvec.c.

Definition at line 306 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_positions_of_indices()

int xt_idxlist_get_positions_of_indices ( Xt_idxlist idxlist,
const Xt_int * indices,
int num_indices,
int * positions,
int single_match_only )

gets the positions of the first occurrence of the given indices in the stored index list

Parameters
[in]idxlistindex list in which the given index is to be searched
[in]indicesindices that are to be searched
[in]num_indicesnumber of indices in the array "indices"
[out]positionspositions of the first occurrence of the indices in idxlist
[in]single_match_onlyif true then do not consider a previous matching position again in the next index search - this is required on the target side in order to avoid multiple writes to the same memory position
Returns
0 if every index could be found >0 number of indices which could not be found in idxlist
Examples
test_idxlist_utils.c, test_idxsection.c, and test_idxvec.c.

Definition at line 221 of file xt_idxlist.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_idxlist_get_positions_of_indices_off()

int xt_idxlist_get_positions_of_indices_off ( Xt_idxlist idxlist,
const Xt_int * indices,
int num_indices,
int * positions,
int * offsets )

gets the positions of the first occurrence of the given indices following the given offsets in the stored index list

Parameters
[in]idxlistindex list in which the given index is to be searched
[in]indicesindices that are to be searched
[in]num_indicesnumber of indices in that array "indices"
[out]positionspositions of the first occurrence of the indices[i] in idxlist with positions[i] >= offsets[i]
[in]offsetsoffsets in the index list from which on the search is to be conducted
Returns
0 if index was found
1 if the index could not be found in idxlist
Remarks
a call to xt_idxlist_get_position_of_index_off with offset = NULL is the same as a call to xt_idxlist_get_positions_of_indices

Definition at line 314 of file xt_idxlist.c.

◆ xt_idxlist_get_sorting()

int xt_idxlist_get_sorting ( Xt_idxlist idxlist)

Inquires if the indices in a list follow some order.

Parameters
[in]idxlistindex list to query for sort
Returns
1 iff sorted in ascending order 0 iff unsorted and no other value applies -1 iff sorted in descending order 2 iff the index list is empty 3 iff the list contains 1 index or more and all values are identical
Examples
test_idxlist_utils.c.

Definition at line 359 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_get_uid()

Xt_uid xt_idxlist_get_uid ( Xt_idxlist idxlist)

return unique list id, where unique means no other index list will return the same id within the same task, also all valid UIDs are non-zero

Parameters
[in]idxlistindex list of which to query unique id
Returns
unique id
Examples
test_uid.c.

Definition at line 472 of file xt_idxlist.c.

◆ xt_idxlist_is_stripe_conversion_profitable()

int xt_idxlist_is_stripe_conversion_profitable ( Xt_idxlist idxlist,
Xt_config config )

Heuristic to tell if stripe conversion is profitable for an index list.

Parameters
[in]idxlistindex list to query for conversion potential
[in]configcustom configuration parameters
Returns
non-zero if conversion is assumed profitable, 0 if not

Definition at line 495 of file xt_idxlist.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_idxlist_pack()

void xt_idxlist_pack ( Xt_idxlist idxlist,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

packs an index list into previously allocated buffer using MPI_Pack

Parameters
[in]idxlistindex list, which needs be packed into the buffer
[in,out]bufferpreviously allocated buffer into which the index list will be packed
[in]buffer_sizesize of buffer in bytes
[in,out]positionposition in buffer at which the data of idxlist will be copied (position is automatically updated to the first byte after the packed data)
[in]commMPI communicator that will be used to send the buffer
Remarks
The provided buffer needs to have a size that is sufficient for the index list. You can determine the required size using xt_idxlist_get_pack_size .
You need to provide the same buffer for all related calls of xt_idxlist_get_pack_size , xt_idxlist_pack and xt_idxlist_unpack
See also
xt_idxlist_get_pack_size
xt_idxlist_unpack
Examples
test_idxlist_utils.c.

Definition at line 86 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_sorted_copy()

Xt_idxlist xt_idxlist_sorted_copy ( Xt_idxlist idxlist)

generates a sorted copy of a given index list

Parameters
[in]idxlistindex list that is to be copied
Returns
copy of the given index list with all indices sorted from lowest to highest
Examples
test_idxlist_utils.c.

Definition at line 99 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_sorted_copy_custom()

Xt_idxlist xt_idxlist_sorted_copy_custom ( Xt_idxlist idxlist,
Xt_config config )

generates a sorted copy of a given index list

Parameters
[in]idxlistindex list that is to be copied
[in]configcustom configuration parameters
Returns
copy of the given index list with all indices sorted from lowest to highest

Definition at line 104 of file xt_idxlist.c.

Here is the caller graph for this function:

◆ xt_idxlist_unpack()

Xt_idxlist xt_idxlist_unpack ( void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

unpacks an index list from buffer

Parameters
[in]bufferbuffer that contains the packed index list
[in]buffer_sizesize of the buffer in bytes
[in,out]positionposition in the buffer at which the unpacking should start (will automatically be set to the position after the unpacked data)
[in]commMPI communicator that was used to receive the buffer
Remarks
You need to provide the same buffer for all related calls of xt_idxlist_get_pack_size , xt_idxlist_pack and xt_idxlist_unpack
See also
xt_idxlist_pack
Examples
test_idxlist_utils.c.

Definition at line 77 of file xt_idxlist_unpack.c.

Here is the caller graph for this function: