PaStiX Handbook  6.3.2
Auto-extensible integer vector structure

Data Structures

struct  ExtendVectorINT_s
 The extend integer array structure. More...
 

Typedefs

typedef struct ExtendVectorINT_s ExtendVectorINT
 The extend integer array structure.
 

Functions

pastix_int_textendint_Init (ExtendVectorINT *vec, pastix_int_t size)
 Initialize the extendVector structure with the initial size given. More...
 
void extendint_Exit (ExtendVectorINT *vec)
 Free the extendVector structure. More...
 
void extendint_Add (ExtendVectorINT *vec, pastix_int_t elt)
 Add an element elt to the end of the vector. More...
 
pastix_int_t extendint_Size (const ExtendVectorINT *vec)
 Return the number of element stored in the vector. More...
 
pastix_int_t extendint_Read (const ExtendVectorINT *vec, pastix_int_t eltnum)
 Return the element of index eltnum. More...
 
void extendint_Clear (ExtendVectorINT *vec)
 Cleanup the vector. More...
 
void extendint_ToSize (ExtendVectorINT *vec, pastix_int_t size)
 Reallocate the vector to the given size. More...
 
void extendint_incr (ExtendVectorINT *vec)
 Increment the number of element stored. More...
 

Detailed Description

This module contains all subroutines to manage the extend int vector arrays. This structure manage a vector of integer automatically extensible when elements are added. This is used in the simulation algorithm to store the available tasks per worker.


Data Type Documentation

◆ ExtendVectorINT_s

struct ExtendVectorINT_s

The extend integer array structure.

Definition at line 29 of file extendVector.h.

Data Fields
pastix_int_t vecsize

The size of the vector

pastix_int_t eltnbr

The number of elements stored

pastix_int_t * inttab

The actual array with the elements

Function Documentation

◆ extendint_Init()

pastix_int_t * extendint_Init ( ExtendVectorINT vec,
pastix_int_t  size 
)

Initialize the extendVector structure with the initial size given.

Parameters
[in,out]vecThe allocated pointer to initialize.
[in]sizeThe initial size of the vector.
Returns
The pointer to the internal integer array.

Definition at line 45 of file extendVector.c.

References ExtendVectorINT_s::eltnbr, ExtendVectorINT_s::inttab, pastix_int_t, and ExtendVectorINT_s::vecsize.

Referenced by graphComputeProjection(), graphIsolateRange(), orderSupernodes(), simuInit(), and thread_reorder().

◆ extendint_Exit()

void extendint_Exit ( ExtendVectorINT vec)

Free the extendVector structure.

Parameters
[in,out]vecThe allocated pointer to free.

Definition at line 66 of file extendVector.c.

References ExtendVectorINT_s::inttab.

Referenced by graphComputeProjection(), graphIsolateRange(), orderSupernodes(), simuExit(), simuRealloc(), and thread_reorder().

◆ extendint_Add()

void extendint_Add ( ExtendVectorINT vec,
pastix_int_t  elt 
)

Add an element elt to the end of the vector.

Parameters
[in,out]vecThe pointer to the extend vector. Might be extended if there is not enough space..
[in]eltThe value to store in the vector

Definition at line 90 of file extendVector.c.

References ExtendVectorINT_s::eltnbr, extendint_incr(), and ExtendVectorINT_s::inttab.

Referenced by graph_iRange_fill_outptr(), graphComputeProjection(), order_tasks(), orderSupernodes(), and simuRun().

◆ extendint_Size()

pastix_int_t extendint_Size ( const ExtendVectorINT vec)

Return the number of element stored in the vector.

Parameters
[in]vecThe extend vector structure.
Returns
The number of element stored.

Definition at line 112 of file extendVector.c.

References ExtendVectorINT_s::eltnbr.

Referenced by graph_iRange_fill_outptr(), graphComputeProjection(), orderSupernodes(), and thread_preorder_zigzag_stategy().

◆ extendint_Read()

pastix_int_t extendint_Read ( const ExtendVectorINT vec,
pastix_int_t  eltnum 
)

Return the element of index eltnum.

Parameters
[in]vecThe extend vector structure.
[in]eltnumThe index of the element to return.
Returns
The value of the eltnum^th element.

Definition at line 136 of file extendVector.c.

References ExtendVectorINT_s::inttab.

Referenced by graph_iRange_fill_outptr(), graphComputeProjection(), orderSupernodes(), and thread_preorder_zigzag_stategy().

◆ extendint_Clear()

void extendint_Clear ( ExtendVectorINT vec)

Cleanup the vector.

Set the number of elements to 0. Does NµOT free the sturcture.

Parameters
[in,out]vecThe extend vector to clear.

Definition at line 220 of file extendVector.c.

References ExtendVectorINT_s::eltnbr.

Referenced by extendint_ToSize(), graph_iRange_fill_outptr(), graphComputeProjection(), and orderSupernodes().

◆ extendint_ToSize()

void extendint_ToSize ( ExtendVectorINT vec,
pastix_int_t  size 
)

Reallocate the vector to the given size.

Parameters
[in,out]vecThe extend vector structure to realloc.
[in]sizeThe new size of the vector. If the size is smaller than the actual size of the vector, nothing is done. Otherwise the vectore is enlarged and the values are kept.

Definition at line 159 of file extendVector.c.

References extendint_Clear(), ExtendVectorINT_s::inttab, pastix_int_t, and ExtendVectorINT_s::vecsize.

◆ extendint_incr()

void extendint_incr ( ExtendVectorINT vec)

Increment the number of element stored.

This is the internal function that reallocate the vector.

Parameters
[in,out]vecThe extend vector structure to realloc.

if the vector is not big enough, make it bigger !!

Definition at line 189 of file extendVector.c.

References ExtendVectorINT_s::eltnbr, ExtendVectorINT_s::inttab, pastix_int_t, and ExtendVectorINT_s::vecsize.

Referenced by extendint_Add().