Commit 16005eb3 authored by fabianw's avatar fabianw

post fixes (minor)

parent 15e6229b
...@@ -18,12 +18,11 @@ CUBISM_NAMESPACE_BEGIN ...@@ -18,12 +18,11 @@ CUBISM_NAMESPACE_BEGIN
extern "C" extern "C"
{ {
// FIXME: [fabianw@mavt.ethz.ch; Sat Nov 24 2018 11:25:37 PM (+0100)] CubismZ
// dependence
#include "myfpzip.h" #include "myfpzip.h"
} }
inline size_t ZZcompress(unsigned char *buf, unsigned len, int layout[4], unsigned *max);
inline size_t ZZdecompress(unsigned char * inputbuf, size_t ninputbytes, int layout[4], unsigned char * outputbuf, const size_t maxsize);
template <typename Real> template <typename Real>
inline size_t ZZdecompress(unsigned char * inputbuf, size_t ninputbytes, int layout[4], unsigned char * outputbuf, const size_t maxsize) inline size_t ZZdecompress(unsigned char * inputbuf, size_t ninputbytes, int layout[4], unsigned char * outputbuf, const size_t maxsize)
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include <cstdlib> #include <cstdlib>
#include <random> // C++11 #include <random> // C++11
#include "MeshMap.h" #include "Cubism/MeshMap.h"
#include "ArgumentParser.h" #include "Cubism/ArgumentParser.h"
CUBISM_NAMESPACE_BEGIN CUBISM_NAMESPACE_BEGIN
......
...@@ -24,10 +24,6 @@ typedef struct _header_serial ...@@ -24,10 +24,6 @@ typedef struct _header_serial
long size[8]; long size[8];
} header_serial; } header_serial;
/*
inline size_t ZZcompress(unsigned char *buf, unsigned len, int layout[4], unsigned *max)
inline size_t ZZdecompress(unsigned char * inputbuf, size_t ninputbytes, int layout[4], unsigned char * outputbuf, const size_t maxsize);
*/
// The following requirements for the data TStreamer are required: // The following requirements for the data TStreamer are required:
// TStreamer::NCHANNELS : Number of data elements (1=Scalar, 3=Vector, 9=Tensor) // TStreamer::NCHANNELS : Number of data elements (1=Scalar, 3=Vector, 9=Tensor)
...@@ -114,7 +110,7 @@ void DumpZBin(const TGrid &grid, ...@@ -114,7 +110,7 @@ void DumpZBin(const TGrid &grid,
unsigned int max = local_bytes; unsigned int max = local_bytes;
// int layout[4] = {NCHANNELS, NX, NY, NZ}; // int layout[4] = {NCHANNELS, NX, NY, NZ};
int layout[4] = {NX, NY, NZ, 1}; int layout[4] = {NX, NY, NZ, 1};
long compressed_bytes = ZZcompress((unsigned char *)array_all, local_bytes, layout, &max); // "in place" long compressed_bytes = ZZcompress<typename TGrid::Real>((unsigned char *)array_all, local_bytes, layout, &max); // "in place"
printf("Writing %ld bytes of Compressed data (cr = %.2f)\n", compressed_bytes, NX*NY*NZ*sizeof(Real)*NCHANNELS*1.0/compressed_bytes); printf("Writing %ld bytes of Compressed data (cr = %.2f)\n", compressed_bytes, NX*NY*NZ*sizeof(Real)*NCHANNELS*1.0/compressed_bytes);
...@@ -191,7 +187,7 @@ void ReadZBin(TGrid &grid, const std::string& f_name, const std::string& read_pa ...@@ -191,7 +187,7 @@ void ReadZBin(TGrid &grid, const std::string& f_name, const std::string& read_pa
size_t rb_data = fread(tmp, 1, compressed_bytes, file_id); size_t rb_data = fread(tmp, 1, compressed_bytes, file_id);
int layout[4] = {NX, NY, NZ, 1}; int layout[4] = {NX, NY, NZ, 1};
size_t decompressed_bytes = ZZdecompress(tmp, compressed_bytes, layout, (unsigned char *)array_all, local_bytes); size_t decompressed_bytes = ZZdecompress<typename TGrid::Real>(tmp, compressed_bytes, layout, (unsigned char *)array_all, local_bytes);
free(tmp); free(tmp);
#if DBG #if DBG
printf("size = %ld (%ld)\n", decompressed_bytes, local_bytes); fflush(0); printf("size = %ld (%ld)\n", decompressed_bytes, local_bytes); fflush(0);
......
...@@ -29,10 +29,6 @@ typedef struct _header ...@@ -29,10 +29,6 @@ typedef struct _header
long size[8]; long size[8];
} header; } header;
/*
inline size_t ZZcompress(unsigned char *buf, unsigned len, int layout[4], unsigned *max)
inline size_t ZZdecompress(unsigned char * inputbuf, size_t ninputbytes, int layout[4], unsigned char * outputbuf, const size_t maxsize);
*/
// The following requirements for the data TStreamer are required: // The following requirements for the data TStreamer are required:
// TStreamer::NCHANNELS : Number of data elements (1=Scalar, 3=Vector, 9=Tensor) // TStreamer::NCHANNELS : Number of data elements (1=Scalar, 3=Vector, 9=Tensor)
...@@ -42,7 +38,7 @@ template<typename TStreamer, typename TGrid> ...@@ -42,7 +38,7 @@ template<typename TStreamer, typename TGrid>
void DumpZBin_MPI( void DumpZBin_MPI(
const TGrid &grid, const TGrid &grid,
const int iCounter, const int iCounter,
const TGrid::Real t, const typename TGrid::Real t,
const std::string &f_name, const std::string &f_name,
const std::string &dump_path = ".", const std::string &dump_path = ".",
const bool bDummy = false) const bool bDummy = false)
...@@ -140,7 +136,7 @@ void DumpZBin_MPI( ...@@ -140,7 +136,7 @@ void DumpZBin_MPI(
unsigned int max = local_bytes; unsigned int max = local_bytes;
// int layout[4] = {NCHANNELS, NX, NY, NZ}; // int layout[4] = {NCHANNELS, NX, NY, NZ};
int layout[4] = {NX, NY, NZ, 1}; int layout[4] = {NX, NY, NZ, 1};
long compressed_bytes = ZZcompress((unsigned char *)array_all, local_bytes, layout, &max); // "in place" long compressed_bytes = ZZcompress<typename TGrid::Real>((unsigned char *)array_all, local_bytes, layout, &max); // "in place"
#if DBG #if DBG
printf("Writing %ld bytes of Compressed data (cr = %.2f)\n", compressed_bytes, local_bytes*1.0/compressed_bytes); printf("Writing %ld bytes of Compressed data (cr = %.2f)\n", compressed_bytes, local_bytes*1.0/compressed_bytes);
#endif #endif
...@@ -253,7 +249,7 @@ void ReadZBin_MPI(TGrid &grid, const std::string& f_name, const std::string& rea ...@@ -253,7 +249,7 @@ void ReadZBin_MPI(TGrid &grid, const std::string& f_name, const std::string& rea
// int layout[4] = {NCHANNELS, NX, NY, NZ}; // int layout[4] = {NCHANNELS, NX, NY, NZ};
int layout[4] = {NX, NY, NZ, 1}; int layout[4] = {NX, NY, NZ, 1};
size_t decompressed_bytes = ZZdecompress(tmp, compressed_bytes, layout, (unsigned char *)array_all, local_bytes); size_t decompressed_bytes = ZZdecompress<typename TGrid::Real>(tmp, compressed_bytes, layout, (unsigned char *)array_all, local_bytes);
free(tmp); free(tmp);
#if DBG #if DBG
printf("rank %d, offset = %ld, size = %ld (%ld)\n", rank, offset, decompressed_bytes, local_bytes); fflush(0); printf("rank %d, offset = %ld, size = %ld (%ld)\n", rank, offset, decompressed_bytes, local_bytes); fflush(0);
......
#include "Cubism/ArgumentParser.h"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <regex> // C++11 #include <regex> // C++11
#include "Cubism/ArgumentParser.h"
CUBISM_NAMESPACE_BEGIN CUBISM_NAMESPACE_BEGIN
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
......
...@@ -7,12 +7,13 @@ ...@@ -7,12 +7,13 @@
* Copyright 2012 ETH Zurich. All rights reserved. * Copyright 2012 ETH Zurich. All rights reserved.
* *
*/ */
#include "Histogram.h"
#include <fstream> #include <fstream>
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <iostream> #include <iostream>
#include "Cubism/Histogram.h"
using namespace std; using namespace std;
CUBISM_NAMESPACE_BEGIN CUBISM_NAMESPACE_BEGIN
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment