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.h File Reference
#include <json-c/json.h>

Go to the source code of this file.

Macros

#define MU_MAX(A, B)   (((A)>(B))?(A):(B))
 
#define MU_SeqIdx3(i, j, k, Ni, Nj)   MACSIO_UTILS_LogicalIJKIndexToSequentialIndex(i,j,k,Ni,Nj)
 
#define MU_SeqIdx2(i, j, Ni)   MACSIO_UTILS_LogicalIJIndexToSequentialIndex (i,j, Ni )
 
#define MU_SeqIdx1(i)   MACSIO_UTILS_LogicalIIndexToSequentialIndex (i )
 
#define MU_LogIdx3(s, Ni, Nj, a, b, c)
 
#define MU_LogIdx2(s, Ni, a, b)
 
#define MU_LogIdx1(s, a)
 
#define MU_PrByts(B, FMT, STR, N)   MACSIO_UTILS_PrintBytes(B,FMT,STR,N)
 
#define MU_PrSecs(S, FMT, STR, N)   MACSIO_UTILS_PrintSeconds(S,FMT,STR,N)
 
#define MU_PrBW(B, S, FMT, STR, N)   MACSIO_UTILS_PrintBandwidth(B,S,FMT,STR,N)
 

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)
 
char const * MACSIO_UTILS_PrintBytes (unsigned long long bytes, char const *fmt, char *str, int n)
 
char const * MACSIO_UTILS_PrintSeconds (double seconds, 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)
 

Variables

char MACSIO_UTILS_UnitsPrefixSystem [32]
 

Macro Definition Documentation

#define MU_MAX (   A,
 
)    (((A)>(B))?(A):(B))

Definition at line 35 of file macsio_utils.h.

#define MU_SeqIdx3 (   i,
  j,
  k,
  Ni,
  Nj 
)    MACSIO_UTILS_LogicalIJKIndexToSequentialIndex(i,j,k,Ni,Nj)

Definition at line 38 of file macsio_utils.h.

#define MU_SeqIdx2 (   i,
  j,
  Ni 
)    MACSIO_UTILS_LogicalIJIndexToSequentialIndex (i,j, Ni )

Definition at line 39 of file macsio_utils.h.

#define MU_SeqIdx1 (   i)    MACSIO_UTILS_LogicalIIndexToSequentialIndex (i )

Definition at line 40 of file macsio_utils.h.

#define MU_LogIdx3 (   s,
  Ni,
  Nj,
  a,
  b,
 
)
Value:
{ int q0,q1,q2; \
a=q0;b=q1;c=q2; \
}
void MACSIO_UTILS_SequentialIndexToLogicalIJKIndex(int s, int Ni, int Nj, int *i, int *j, int *k)
Definition: macsio_utils.c:184

Definition at line 41 of file macsio_utils.h.

#define MU_LogIdx2 (   s,
  Ni,
  a,
 
)
Value:
{ int q0,q1; \
a=q0;b=q1; \
}
void MACSIO_UTILS_SequentialIndexToLogicalIJIndex(int s, int Ni, int *i, int *j)
Definition: macsio_utils.c:190

Definition at line 46 of file macsio_utils.h.

#define MU_LogIdx1 (   s,
 
)
Value:
{ int q0; \
a=q0; \
}
void MACSIO_UTILS_SequentialIndexToLogicalIIndex(int s, int *i)
Definition: macsio_utils.c:195

Definition at line 51 of file macsio_utils.h.

#define MU_PrByts (   B,
  FMT,
  STR,
 
)    MACSIO_UTILS_PrintBytes(B,FMT,STR,N)

Definition at line 57 of file macsio_utils.h.

#define MU_PrSecs (   S,
  FMT,
  STR,
 
)    MACSIO_UTILS_PrintSeconds(S,FMT,STR,N)

Definition at line 58 of file macsio_utils.h.

#define MU_PrBW (   B,
  S,
  FMT,
  STR,
 
)    MACSIO_UTILS_PrintBandwidth(B,S,FMT,STR,N)

Definition at line 59 of file macsio_utils.h.

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.

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_PrintSeconds ( double  seconds,
char const *  fmt,
char *  str,
int  n 
)

Definition at line 376 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.

Variable Documentation

char MACSIO_UTILS_UnitsPrefixSystem[32]

Definition at line 34 of file macsio_utils.c.