SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
Macros | Functions
sion_internal_seek.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include "sion.h"
#include "sion_debug.h"
#include "sion_error_handler.h"
#include "sion_internal.h"
#include "sion_metadata.h"
#include "sion_filedesc.h"
#include "sion_fd.h"
#include "sion_file.h"
#include "sion_printts.h"
#include "sion_buffer.h"
#include "sion_internal_seek.h"
Include dependency graph for sion_internal_seek.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   700
 
#define DFUNCTION   "_sion_seek_on_all_ranks_read"
 
#define DFUNCTION   "_sion_seek_on_all_ranks_read_master"
 
#define DFUNCTION   "_sion_seek_on_current_rank_read"
 
#define DFUNCTION   "_sion_seek_on_all_ranks_read_mapped"
 
#define DFUNCTION   "_sion_seek_on_all_ranks_write"
 
#define DFUNCTION   "_sion_seek_on_all_ranks_write_mapped"
 
#define DFUNCTION   "_sion_seek_on_current_rank_write"
 
#define DFUNCTION   "_sion_seek_search_abs_pos"
 
#define DFUNCTION   "_sion_seek_search_end_pos"
 

Functions

int _sion_seek_on_all_ranks_read (_sion_filedesc *sion_filedesc, int rank, int blocknr, sion_int64 posinblk)
 Function to set the file pointer to a new position, updates internal data structure. More...
 
int _sion_seek_on_all_ranks_read_master (_sion_filedesc *sion_filedesc, int rank, int blocknr, sion_int64 posinblk)
 Function to set the file pointer to a new position, updates internal data structure. More...
 
int _sion_seek_on_current_rank_read (_sion_filedesc *sion_filedesc, int rank, int blocknr, sion_int64 posinblk)
 Function to set the file pointer to a new position in the same rank, updates internal data structure. More...
 
int _sion_seek_on_all_ranks_read_mapped (_sion_filedesc *sion_filedesc_master, int rank, int blocknr, sion_int64 posinblk)
 Function to set the file pointer to a new position, updates internal data structure. More...
 
int _sion_seek_on_all_ranks_write (_sion_filedesc *sion_filedesc, int rank, int blocknr, sion_int64 posinblk)
 Function to set the file pointer to a new position, updates internal data structure. More...
 
int _sion_seek_on_all_ranks_write_mapped (_sion_filedesc *sion_filedesc_master, int rank, int blocknr, sion_int64 posinblk)
 Function to set the file pointer to a new position, updates internal data structure. More...
 
int _sion_seek_on_current_rank_write (_sion_filedesc *sion_filedesc, int rank, int blocknr, sion_int64 posinblk)
 Function to set the file pointer to a new position in the same rank, updates internal data structure. More...
 
int _sion_seek_search_abs_pos (_sion_filedesc *sion_filedesc, sion_int64 abspos, int *newblocknr, sion_int64 *newposinblk)
 Find block and position inside block for absolute position abspos. More...
 
int _sion_seek_search_end_pos (_sion_filedesc *sion_filedesc, sion_int64 posend, int *newblocknr, sion_int64 *newposinblk)
 Find block and position inside block position relative to end. More...
 

Function Documentation

◆ _sion_seek_on_all_ranks_read()

int _sion_seek_on_all_ranks_read ( _sion_filedesc sion_filedesc,
int  rank,
int  blocknr,
sion_int64  posinblk 
)

Function to set the file pointer to a new position, updates internal data structure.

This function works on a SINGLE SION file

Parameters
[in,out]sion_filedescsion data structure
[in]rankrank number of the process (SION_CURRENT_RANK to select the current rank)
[in]blocknrblock number (SION_CURRENT_BLK to select the current block)
[in]posinblkposition in the block (SION_CURRENT_POS to select the current position)
Return values
1if file pointer can be moved to new position 0 otherwise

Definition at line 52 of file sion_internal_seek.c.

◆ _sion_seek_on_all_ranks_read_mapped()

int _sion_seek_on_all_ranks_read_mapped ( _sion_filedesc sion_filedesc_master,
int  rank,
int  blocknr,
sion_int64  posinblk 
)

Function to set the file pointer to a new position, updates internal data structure.

This function works on a SINGLE SION file, Multi-files have to be handle in upper layer

Parameters
[in,out]sion_filedesc_mastersion data structure
[in]rankrank number of the process (SION_CURRENT_RANK to select the current rank)
[in]blocknrblock number (SION_CURRENT_BLK to select the current block)
[in]posinblkposition in the block (SION_CURRENT_POS to select the current position)
Return values
1if file pointer can be moved to new position 0 otherwise

Definition at line 389 of file sion_internal_seek.c.

◆ _sion_seek_on_all_ranks_read_master()

int _sion_seek_on_all_ranks_read_master ( _sion_filedesc sion_filedesc,
int  rank,
int  blocknr,
sion_int64  posinblk 
)

Function to set the file pointer to a new position, updates internal data structure.

This function works on Multi-files

Parameters
[in,out]sion_filedescsion data structure
[in]rankrank number of the process (SION_CURRENT_RANK to select the current rank)
[in]blocknrblock number (SION_CURRENT_BLK to select the current block)
[in]posinblkposition in the block (SION_CURRENT_POS to select the current position)
Return values
1if file pointer can be moved to new position 0 otherwise

Definition at line 160 of file sion_internal_seek.c.

◆ _sion_seek_on_all_ranks_write()

int _sion_seek_on_all_ranks_write ( _sion_filedesc sion_filedesc,
int  rank,
int  blocknr,
sion_int64  posinblk 
)

Function to set the file pointer to a new position, updates internal data structure.

This function works on a SINGLE SION file, Multi-files have to be handle in upper layer

Parameters
[in,out]sion_filedescsion data structure
[in]rankrank number of the process (SION_CURRENT_RANK to select the current rank)
[in]blocknrblock number (SION_CURRENT_BLK to select the current block)
[in]posinblkposition in the block (SION_CURRENT_POS to select the current position)
Return values
1if file pointer can be moved to new position 0 otherwise

Definition at line 537 of file sion_internal_seek.c.

◆ _sion_seek_on_all_ranks_write_mapped()

int _sion_seek_on_all_ranks_write_mapped ( _sion_filedesc sion_filedesc_master,
int  rank,
int  blocknr,
sion_int64  posinblk 
)

Function to set the file pointer to a new position, updates internal data structure.

This function works on a SINGLE SION file, Multi-files have to be handle in upper layer

Parameters
[in,out]sion_filedesc_mastersion data structure
[in]rankrank number of the process (SION_CURRENT_RANK to select the current rank)
[in]blocknrblock number (SION_CURRENT_BLK to select the current block)
[in]posinblkposition in the block (SION_CURRENT_POS to select the current position)
Return values
1if file pointer can be moved to new position 0 otherwise

Definition at line 629 of file sion_internal_seek.c.

◆ _sion_seek_on_current_rank_read()

int _sion_seek_on_current_rank_read ( _sion_filedesc sion_filedesc,
int  rank,
int  blocknr,
sion_int64  posinblk 
)

Function to set the file pointer to a new position in the same rank, updates internal data structure.

Parameters
[in,out]sion_filedescsion data structure
[in]rankrank number of the process (SION_CURRENT_RANK to select the current rank)
[in]blocknrblock number (SION_CURRENT_BLK to select the current block)
[in]posinblkposition in the block (SION_CURRENT_POS to select the current position)
Return values
1if file pointer can be moved to new position 0 otherwise

Definition at line 273 of file sion_internal_seek.c.

◆ _sion_seek_on_current_rank_write()

int _sion_seek_on_current_rank_write ( _sion_filedesc sion_filedesc,
int  rank,
int  blocknr,
sion_int64  posinblk 
)

Function to set the file pointer to a new position in the same rank, updates internal data structure.

Parameters
[in,out]sion_filedescsion data structure
[in]rankrank number of the process (SION_CURRENT_RANK to select the current rank)
[in]blocknrblock number (SION_CURRENT_BLK to select the current block)
[in]posinblkposition in the block (SION_CURRENT_POS to select the current position)
Return values
1if file pointer can be moved to new position 0 otherwise

Definition at line 766 of file sion_internal_seek.c.

◆ _sion_seek_search_abs_pos()

int _sion_seek_search_abs_pos ( _sion_filedesc sion_filedesc,
sion_int64  abspos,
int *  newblocknr,
sion_int64 *  newposinblk 
)

Find block and position inside block for absolute position abspos.

Parameters
[in]sion_filedescsion data structure
[in]absposabsolut position in file
[out]newblocknrblock number for absolut position
[out]newposinblkposition in the block for absolut position
Return values
1if abspos lays inside available data 0 otherwise

Definition at line 824 of file sion_internal_seek.c.

◆ _sion_seek_search_end_pos()

int _sion_seek_search_end_pos ( _sion_filedesc sion_filedesc,
sion_int64  posend,
int *  newblocknr,
sion_int64 *  newposinblk 
)

Find block and position inside block position relative to end.

Parameters
[in]sion_filedescsion data structure
[in]posendposition in file relative to end (-1 seeks before last byte)
[out]newblocknrblock number for new position
[out]newposinblkposition in the block for new position
Return values
1if posend lays inside available data 0 otherwise

Definition at line 864 of file sion_internal_seek.c.