MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
macsio_utils.c File Reference
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <strings.h>
#include <macsio_utils.h>

Go to the source code of this file.

Macros

#define bjhash_mix(a, b, c)
 

Functions

unsigned int MACSIO_UTILS_BJHash (const unsigned char *k, unsigned int length, unsigned int initval)
 
int MACSIO_UTILS_Best2DFactors (int val, int *x, int *y)
 
int MACSIO_UTILS_Best3DFactors (int val, int *x, int *y, int *z)
 
int MACSIO_UTILS_LogicalIJKIndexToSequentialIndex (int i, int j, int k, int Ni, int Nj)
 
int MACSIO_UTILS_LogicalIJIndexToSequentialIndex (int i, int j, int Ni)
 
int MACSIO_UTILS_LogicalIIndexToSequentialIndex (int i)
 
void MACSIO_UTILS_SequentialIndexToLogicalIJKIndex (int s, int Ni, int Nj, int *i, int *j, int *k)
 
void MACSIO_UTILS_SequentialIndexToLogicalIJIndex (int s, int Ni, int *i, int *j)
 
void MACSIO_UTILS_SequentialIndexToLogicalIIndex (int s, int *i)
 
void MACSIO_UTILS_SetDims (int *dims, int nx, int ny, int nz)
 
int MACSIO_UTILS_XDim (int const *dims)
 
int MACSIO_UTILS_YDim (int const *dims)
 
int MACSIO_UTILS_ZDim (int const *dims)
 
void MACSIO_UTILS_SetBounds (double *bounds, double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
 
double MACSIO_UTILS_XRange (double const *bounds)
 
double MACSIO_UTILS_YRange (double const *bounds)
 
double MACSIO_UTILS_ZRange (double const *bounds)
 
double MACSIO_UTILS_XMin (double const *bounds)
 
double MACSIO_UTILS_YMin (double const *bounds)
 
double MACSIO_UTILS_ZMin (double const *bounds)
 
double MACSIO_UTILS_XMax (double const *bounds)
 
double MACSIO_UTILS_YMax (double const *bounds)
 
double MACSIO_UTILS_ZMax (double const *bounds)
 
double MACSIO_UTILS_XDelta (int const *dims, double const *bounds)
 
double MACSIO_UTILS_YDelta (int const *dims, double const *bounds)
 
double MACSIO_UTILS_ZDelta (int const *dims, double const *bounds)
 
json_objectMACSIO_UTILS_MakeDimsJsonArray (int ndims, const int *dims)
 
json_objectMACSIO_UTILS_MakeBoundsJsonArray (double const *bounds)
 
static char const * print_bytes (double val, char const *_fmt, char *str, int n, char const *_persec)
 
char const * MACSIO_UTILS_PrintBytes (unsigned long long bytes, char const *fmt, char *str, int n)
 
char const * MACSIO_UTILS_PrintBandwidth (unsigned long long bytes, double seconds, char const *fmt, char *str, int n)
 
char const * MACSIO_UTILS_PrintSeconds (double seconds, char const *fmt, char *str, int n)
 

Variables

char MACSIO_UTILS_UnitsPrefixSystem [32]
 

Macro Definition Documentation

#define bjhash_mix (   a,
  b,
 
)
Value:
{ \
a -= b; a -= c; a ^= (c>>13); \
b -= c; b -= a; b ^= (a<<8); \
c -= a; c -= b; c ^= (b>>13); \
a -= b; a -= c; a ^= (c>>12); \
b -= c; b -= a; b ^= (a<<16); \
c -= a; c -= b; c ^= (b>>5); \
a -= b; a -= c; a ^= (c>>3); \
b -= c; b -= a; b ^= (a<<10); \
c -= a; c -= b; c ^= (b>>15); \
}

Definition at line 49 of file macsio_utils.c.

Function Documentation

unsigned int MACSIO_UTILS_BJHash ( const unsigned char *  k,
unsigned int  length,
unsigned int  initval 
)

Definition at line 62 of file macsio_utils.c.

int MACSIO_UTILS_Best2DFactors ( int  val,
int *  x,
int *  y 
)

Definition at line 101 of file macsio_utils.c.

int MACSIO_UTILS_Best3DFactors ( int  val,
int *  x,
int *  y,
int *  z 
)

Definition at line 121 of file macsio_utils.c.

int MACSIO_UTILS_LogicalIJKIndexToSequentialIndex ( int  i,
int  j,
int  k,
int  Ni,
int  Nj 
)

Definition at line 180 of file macsio_utils.c.

int MACSIO_UTILS_LogicalIJIndexToSequentialIndex ( int  i,
int  j,
int  Ni 
)

Definition at line 181 of file macsio_utils.c.

int MACSIO_UTILS_LogicalIIndexToSequentialIndex ( int  i)

Definition at line 182 of file macsio_utils.c.

void MACSIO_UTILS_SequentialIndexToLogicalIJKIndex ( int  s,
int  Ni,
int  Nj,
int *  i,
int *  j,
int *  k 
)

Definition at line 184 of file macsio_utils.c.

void MACSIO_UTILS_SequentialIndexToLogicalIJIndex ( int  s,
int  Ni,
int *  i,
int *  j 
)

Definition at line 190 of file macsio_utils.c.

void MACSIO_UTILS_SequentialIndexToLogicalIIndex ( int  s,
int *  i 
)

Definition at line 195 of file macsio_utils.c.

void MACSIO_UTILS_SetDims ( int *  dims,
int  nx,
int  ny,
int  nz 
)

Definition at line 200 of file macsio_utils.c.

int MACSIO_UTILS_XDim ( int const *  dims)

Definition at line 206 of file macsio_utils.c.

int MACSIO_UTILS_YDim ( int const *  dims)

Definition at line 207 of file macsio_utils.c.

int MACSIO_UTILS_ZDim ( int const *  dims)

Definition at line 208 of file macsio_utils.c.

void MACSIO_UTILS_SetBounds ( double *  bounds,
double  xmin,
double  ymin,
double  zmin,
double  xmax,
double  ymax,
double  zmax 
)

Definition at line 210 of file macsio_utils.c.

double MACSIO_UTILS_XRange ( double const *  bounds)

Definition at line 222 of file macsio_utils.c.

double MACSIO_UTILS_YRange ( double const *  bounds)

Definition at line 223 of file macsio_utils.c.

double MACSIO_UTILS_ZRange ( double const *  bounds)

Definition at line 224 of file macsio_utils.c.

double MACSIO_UTILS_XMin ( double const *  bounds)

Definition at line 225 of file macsio_utils.c.

double MACSIO_UTILS_YMin ( double const *  bounds)

Definition at line 226 of file macsio_utils.c.

double MACSIO_UTILS_ZMin ( double const *  bounds)

Definition at line 227 of file macsio_utils.c.

double MACSIO_UTILS_XMax ( double const *  bounds)

Definition at line 228 of file macsio_utils.c.

double MACSIO_UTILS_YMax ( double const *  bounds)

Definition at line 229 of file macsio_utils.c.

double MACSIO_UTILS_ZMax ( double const *  bounds)

Definition at line 230 of file macsio_utils.c.

double MACSIO_UTILS_XDelta ( int const *  dims,
double const *  bounds 
)

Definition at line 231 of file macsio_utils.c.

double MACSIO_UTILS_YDelta ( int const *  dims,
double const *  bounds 
)

Definition at line 236 of file macsio_utils.c.

double MACSIO_UTILS_ZDelta ( int const *  dims,
double const *  bounds 
)

Definition at line 241 of file macsio_utils.c.

json_object* MACSIO_UTILS_MakeDimsJsonArray ( int  ndims,
const int *  dims 
)

Definition at line 248 of file macsio_utils.c.

json_object* MACSIO_UTILS_MakeBoundsJsonArray ( double const *  bounds)

Definition at line 261 of file macsio_utils.c.

static char const* print_bytes ( double  val,
char const *  _fmt,
char *  str,
int  n,
char const *  _persec 
)
static

Definition at line 273 of file macsio_utils.c.

char const* MACSIO_UTILS_PrintBytes ( unsigned long long  bytes,
char const *  fmt,
char *  str,
int  n 
)

Definition at line 365 of file macsio_utils.c.

char const* MACSIO_UTILS_PrintBandwidth ( unsigned long long  bytes,
double  seconds,
char const *  fmt,
char *  str,
int  n 
)

Definition at line 370 of file macsio_utils.c.

char const* MACSIO_UTILS_PrintSeconds ( double  seconds,
char const *  fmt,
char *  str,
int  n 
)

Definition at line 376 of file macsio_utils.c.

Variable Documentation

char MACSIO_UTILS_UnitsPrefixSystem[32]

Definition at line 34 of file macsio_utils.c.