ASCOT5
Loading...
Searching...
No Matches
Data Structures | Functions
offload.h File Reference

Header file for offload.h. More...

Go to the source code of this file.

Data Structures

struct  offload_package
 Struct to keep track of the offload array length and unpack status. More...
 

Functions

void offload_init_offload (offload_package *o, real **pack_array, int **int_array)
 Initialize offload package.
 
void offload_free_offload (offload_package *o, real **pack_array, int **int_array)
 Free offload array and set offload_package to clean state.
 
void offload_pack (offload_package *o, real **offload_array, real *pack_array, size_t pack_length, int **int_offload_array, int *int_pack_array, size_t int_pack_length)
 Pack an offload array to package array.
 
void offload_unpack (offload_package *o, real *pack_array, size_t pack_length, int *int_offload_array, size_t int_pack_length, real **ptr, int **intptr)
 Unpack offload array from the package.
 

Detailed Description

Header file for offload.h.

Definition in file offload.h.

Function Documentation

◆ offload_init_offload()

void offload_init_offload ( offload_package * o,
real ** offload_array,
int ** int_offload_array )

Initialize offload package.

Sets offload_package.pack_array_length and offload_package.unpack_pos to zero and assigns NULL to offload_array pointer.

Parameters
ouninitialized offload package
offload_arraypointer to packarray
int_offload_arraypointer to int packarray

Definition at line 31 of file offload.c.

◆ offload_free_offload()

void offload_free_offload ( offload_package * o,
real ** offload_array,
int ** int_offload_array )

Free offload array and set offload_package to clean state.

Parameters
ooffload package
offload_arraypointer to offload_array
int_offload_arraypointer to int packarray

Definition at line 49 of file offload.c.

◆ offload_pack()

void offload_pack ( offload_package * o,
real ** offload_array,
real * pack_array,
size_t pack_length,
int ** int_offload_array,
int * int_pack_array,
size_t int_pack_length )

Pack an offload array to package array.

Reallocates the offload array so that the new data from the package array can be appended. Once the data has been appended, the old offload array is freed. The new length of the offload array is stored to offload_package struct.

Parameters
ooffload package
offload_arraypointer to offload array where data will be packed
pack_arraypack array containing the data to be appended
pack_lengthlength of the offload_array
int_offload_arraypointer to offload array where integer data will be packed
int_pack_arraypack array containing the integer data to be appended
int_pack_lengthlength of the int_offload_array

Definition at line 78 of file offload.c.

◆ offload_unpack()

void offload_unpack ( offload_package * o,
real * offload_array,
size_t pack_length,
int * int_offload_array,
size_t int_pack_length,
real ** ptr,
int ** intptr )

Unpack offload array from the package.

The data is not actually moved anywhere. Unpacking means that pointers to the start of packed offload arrays are returned. Unpacking must be done in the same order as data was packed.

Parameters
ooffload package
offload_arrayoffload array
pack_lengthlength of the data that is unpacked
int_offload_arrayint offload array
int_pack_length
ptrpointer where the unpacked data begins
intptrpointer where the unpacked int data begins

Definition at line 137 of file offload.c.