/****************************************************************************
**  SIONLIB     http://www.fz-juelich.de/jsc/sionlib                       **
*****************************************************************************
**  Copyright (c) 2008-2015                                                **
**  Forschungszentrum Juelich, Juelich Supercomputing Centre               **
**                                                                         **
**  See the file COPYRIGHT in the package base directory for details       **
****************************************************************************/
#ifndef SION_SION_GENERIC_INTERNAL
#define SION_SION_GENERIC_INTERNAL

#include "sion_generic_apidesc.h"
#include "sion_flags.h"


/* internal interface routines, containing parallel functionality (e.g. meta data management) */
int _lsion_paropen_generic_one_file(
				   int sid,
				   char  *fname,
				   _sion_flags_store *flags_store,
				   char  *prefix,
				   int   *numFiles,
				   int   *filenumber, 
				   sion_int64  *chunksize,
				   sion_int32  *fsblksize,
				   int    rank,
				   int    ntasks,
				   int   *globalrank,
				   int    flag,
				   FILE **fileptr,
				   _sion_generic_gendata *sion_gendata );

int _lsion_parclose_generic(int sid,
			       int rank,
			       int ntasks,
			       int mapping_size,
			       sion_int32 *mapping,
			       _sion_generic_gendata *sion_gendata );

int _lsion_parreinit_generic(
			    int sid,
			    sion_int64 chunksize,
			    int rank,
			    int ntasks,
			    _sion_generic_gendata *sion_gendata);

/* internal functions */
int _lsion_generic_get_and_distribute_info_from_file(  _sion_generic_gendata *sion_gendata, const char *fname);


#endif
