Miscellaneous functions for IO operations.
More...
#include "al_hidden.h"
#include <string.h>
int AL_File_close |
( |
int |
sz_ptr | ) |
|
Close a file associate with and array
- Parameters
-
[in] | sz_ptr | integer pointer to array descriptor |
int AL_File_open |
( |
char * |
filename, |
|
|
int |
sz_ptr |
|
) |
| |
Open a file associated with a distributed array
- Parameters
-
[in] | filename | name of the file |
[in] | sz_ptr | integer pointer to the distributed array descriptor |
- Returns
- ifp pointer to integer file pointer
int AL_Read_array |
( |
void * |
va, |
|
|
int |
sz_ptr, |
|
|
int |
istag |
|
) |
| |
Read a distributed array to a file in parallel using synchronous and collective IO operations
- Parameters
-
[in] | buffer | pointer to the buffer to write |
[in] | sz_ptr | integer pointer to a distributed array descriptor |
[in] | istag | set it to -1 for centred variables, set to 0,1,2 for staggered field in the x,y,z direction |
Bugs fixed on Aug 26, 2012:
- nelem has been declared long long in order to manage dbl and flt output 'single_file' in which each PLUTO variable is >= 4GB
- the updating of nelem after the writing of a variable has been modified from ''nelem *= (long long)(s->arrdim[i] +(istag == i));'' to ''nelem *= (long long)(s->arrdim[i]);'' because when a staggered variable is written, in the sz_ptr descriptor there is the information about the really number of element of this variable. This appens because the function AL_Set_staggered_dim is called for a staggered array.
int AL_Write_array |
( |
void * |
va, |
|
|
int |
sz_ptr, |
|
|
int |
istag |
|
) |
| |
Write a distributed array to a file in parallel using synchronous and collective IO operations
- Parameters
-
[in] | buffer | pointer to the buffer to write |
[in] | sz_ptr | integer pointer to the distributed array descriptor |
[in] | istag | set it to -1 for centred variables, set to 0,1,2 for staggered field in the x,y,z direction |
Bugs fixed on Aug 26, 2012:
- nelem has been declared long long in order to manage dbl and flt output 'single_file' in which each PLUTO variable is >= 4GB
- the updating of nelem after the writing of a variable has been modified from ''nelem *= (long long)(s->arrdim[i] +(istag == i));'' to ''nelem *= (long long)(s->arrdim[i]);'' because when a staggered variable is written, in the sz_ptr descriptor there is the information about the really number of element of this variable. This appens because the function AL_Set_staggered_dim is called for a staggered array.