Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qcdio.h

Go to the documentation of this file.
00001 #include<config.h>
00002 CPS_START_NAMESPACE
00003 /*----------------------------------------------------------*/
00009 /*2  A.N.Jackson: ajackson@epcc.ed.ac.uk                      
00010   -----------------------------------------------------------
00011    CVS keywords
00012  
00013    $Author: chulwoo $
00014    $Date: 2008/06/18 16:07:10 $
00015    $Header: /space/cvs/cps/cps++/include/util/qcdio.h,v 1.10 2008/06/18 16:07:10 chulwoo Exp $
00016    $Id: qcdio.h,v 1.10 2008/06/18 16:07:10 chulwoo Exp $
00017    $Name: v5_0_8 $
00018    $Locker:  $
00019    $RCSfile: qcdio.h,v $
00020    $Revision: 1.10 $
00021    $Source: /space/cvs/cps/cps++/include/util/qcdio.h,v $
00022    $State: Exp $  */
00023 /*----------------------------------------------------------*/
00024 
00025 #ifndef INCLUDED_QCDIO_H_
00026 #define INCLUDED_QCDIO_H_
00027 
00028 CPS_END_NAMESPACE
00029 #include <stdio.h>
00030 #include <stdarg.h>
00031 #include <util/data_types.h>
00032 #include <util/lattice.h>
00033 #include <util/qcdio_qprintf.h>
00034 #include <util/ReadLatticePar.h>
00035 #include <util/WriteLatticePar.h>
00036 CPS_START_NAMESPACE
00037 
00038 #ifndef GAUGE_CONF_PREC
00039 
00040 #define GAUGE_CONF_PREC (sizeof(Float))
00041 #endif
00042 
00043 #ifndef SWAP_BYTE_ORDER
00044 
00047 #define SWAP_BYTE_ORDER 0
00048 #endif
00049 
00050 #ifndef TRANSPOSE_THE_MATRICES
00051 
00054 #define TRANSPOSE_THE_MATRICES 1
00055 #endif
00056 
00057   /* ------------------------------------------------------
00058         Gauge configuration I/O:
00059     ------------------------------------------------------ */
00060   
00062   void qcdio_set_normalize( int );
00063 
00065   void qload_gauge( char* fprefix, Lattice& lat,
00066              int prec = GAUGE_CONF_PREC,
00067              int swap = SWAP_BYTE_ORDER,
00068              int transp = TRANSPOSE_THE_MATRICES );
00069 
00071   void qsave_gauge( char* fprefix, Lattice& lat,
00072              int prec = GAUGE_CONF_PREC,
00073              int swap = SWAP_BYTE_ORDER,
00074              int transp = TRANSPOSE_THE_MATRICES );
00075 
00076 // File IO
00077 
00081 
00082 enum FileIoType{
00083     ZERO_ONLY,          
00084     ADD_ID,              
00086     ALL_NODES
00087 };
00088 
00090 
00106 FILE *Fopen( FileIoType type, const char *filename, const char *mode);
00107 
00109 
00118 int Fclose( FileIoType type, FILE *stream);
00119 
00121 
00136 size_t Fwrite( const void *ptr, size_t size, size_t n, FILE *stream);
00137 size_t Fread(void *ptr, size_t size, size_t n, FILE *stream);
00138 
00140 
00154 int Fprintf( FileIoType type, FILE *stream, const char *format,...);
00155 
00157 
00171 int Vfprintf( FileIoType type, FILE *stream, const char *format, va_list ap);
00172 
00174 
00183 inline FILE *Fopen( const char *filename, const char *mode)
00184     { return Fopen( ZERO_ONLY, filename, mode);}
00185 
00187 
00195 inline int Fclose( FILE *stream){return Fclose(ZERO_ONLY,stream);}
00196 
00198 
00212 int Fprintf( FILE *stream, const char *format,...);
00213 
00215 
00228 inline int Vfprintf( FILE *stream, const char *format, va_list ap)
00229     { return Vfprintf(ZERO_ONLY,stream, format, ap);}
00230 
00231 #endif
00232 
00235 CPS_END_NAMESPACE

Generated on Sat Oct 10 14:11:14 2009 for Columbia Physics System by  doxygen 1.3.9.1