diff options
author | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2003-08-06 12:23:27 +0000 |
---|---|---|
committer | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2003-08-06 12:23:27 +0000 |
commit | bf0225505894535a9ae36f02a3f6efa6642c5c00 (patch) | |
tree | 822a739d2aa7568d819e634ced6e26035991b1ef /doc/html/IOspeed.cc | |
parent | dfcc3d15b8728f2827b323a77e3f8a9e57ca9904 (diff) |
Added FlexIO documentation in HTML format.
Taken from the (almost forgotten) repository /afs/aei/cvsroot/IEEEIO/doc.
Should be the same as on http://zeus.ncsa.uiuc.edu/~jshalf/FlexIO/.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/FlexIO/trunk@50 21a6bef8-4479-4f54-8f8d-0db94a2919ef
Diffstat (limited to 'doc/html/IOspeed.cc')
-rw-r--r-- | doc/html/IOspeed.cc | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/doc/html/IOspeed.cc b/doc/html/IOspeed.cc new file mode 100644 index 0000000..ab72a2b --- /dev/null +++ b/doc/html/IOspeed.cc @@ -0,0 +1,86 @@ +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/times.h> +#include <time.h> +#include "IO.hh" +#include "IEEEIO.hh" +#include "HDFIO.hh" +extern "C" { +void openf77_(); +void writef77_(double *data); +void closef77_(); +} + +void main(){ + double data[64*64*64]; + int dims[3]={64,64,64}; + int i,nds; + puts("--------------IEEE--------------"); + for(i=0,nds=5;i<8;i++,nds+=5){ + time_t stm,etm; + struct tms stms,etms; + time(&stm); + times(&stms); + IObase *file = new IEEEIO("speed.raw",IObase::Write); + fprintf(stderr,"Write %2u:",nds); + for(int n=0;n<nds;n++){ + fprintf(stderr,"*"); + file->write(IObase::Float64,3,dims,data); + } + delete file; + times(&etms); + time(&etm); + printf("\n\tRealtime=%d, UserTime=%d, SystemTime=%d, Combined=%u\n", + etm-stm, + etms.tms_utime-stms.tms_utime, + etms.tms_stime-stms.tms_stime, + etms.tms_utime-stms.tms_utime+etms.tms_stime-stms.tms_stime); + } + + puts("--------------HDF---------------"); + for(i=0,nds=5;i<8;i++,nds+=5){ + time_t stm,etm; + struct tms stms,etms; + time(&stm); + times(&stms); + IObase *file = new HDFIO("speed.hdf",IObase::Write); + fprintf(stderr,"Write %2u:",nds); + for(int n=0;n<nds;n++){ + fprintf(stderr,"*"); + file->write(IObase::Float64,3,dims,data); + } + delete file; + times(&etms); + time(&etm); + printf("\n\tRealtime=%d, UserTime=%d, SystemTime=%d, Combined=%u\n", + etm-stm, + etms.tms_utime-stms.tms_utime, + etms.tms_stime-stms.tms_stime, + etms.tms_utime-stms.tms_utime+etms.tms_stime-stms.tms_stime); + } + + puts("-------------F77 Unformatted---------------"); + for(i=0,nds=5;i<8;i++,nds+=5){ + time_t stm,etm; + struct tms stms,etms; + time(&stm); + times(&stms); + fprintf(stderr,"Write %2u:",nds); + openf77_(); + // writef77_(dat,&nds); + for(int n=0;n<nds;n++){ + fprintf(stderr,"*"); + writef77_(data); + } + closef77_(); + times(&etms); + time(&etm); + printf("\n\tRealtime=%d, UserTime=%d, SystemTime=%d, Combined=%u\n", + etm-stm, + etms.tms_utime-stms.tms_utime, + etms.tms_stime-stms.tms_stime, + etms.tms_utime-stms.tms_utime+etms.tms_stime-stms.tms_stime); + } +} + |