Commit 16005eb3 authored by fabianw's avatar fabianw

post fixes (minor)

parent 15e6229b
......@@ -18,12 +18,11 @@ CUBISM_NAMESPACE_BEGIN
extern "C"
{
// FIXME: [fabianw@mavt.ethz.ch; Sat Nov 24 2018 11:25:37 PM (+0100)] CubismZ
// dependence
#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>
inline size_t ZZdecompress(unsigned char * inputbuf, size_t ninputbytes, int layout[4], unsigned char * outputbuf, const size_t maxsize)
......
......@@ -17,8 +17,8 @@
#include <cstdlib>
#include <random> // C++11
#include "MeshMap.h"
#include "ArgumentParser.h"
#include "Cubism/MeshMap.h"
#include "Cubism/ArgumentParser.h"
CUBISM_NAMESPACE_BEGIN
......
......@@ -24,10 +24,6 @@ typedef struct _header_serial
long size[8];
} 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:
// TStreamer::NCHANNELS : Number of data elements (1=Scalar, 3=Vector, 9=Tensor)
......@@ -114,7 +110,7 @@ void DumpZBin(const TGrid &grid,
unsigned int max = local_bytes;
// int layout[4] = {NCHANNELS, NX, NY, NZ};
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);
......@@ -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);
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);
#if DBG
printf("size = %ld (%ld)\n", decompressed_bytes, local_bytes); fflush(0);
......
......@@ -29,10 +29,6 @@ typedef struct _header
long size[8];
} 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:
// TStreamer::NCHANNELS : Number of data elements (1=Scalar, 3=Vector, 9=Tensor)
......@@ -42,7 +38,7 @@ template<typename TStreamer, typename TGrid>
void DumpZBin_MPI(
const TGrid &grid,
const int iCounter,
const TGrid::Real t,
const typename TGrid::Real t,
const std::string &f_name,
const std::string &dump_path = ".",
const bool bDummy = false)
......@@ -140,7 +136,7 @@ void DumpZBin_MPI(
unsigned int max = local_bytes;
// int layout[4] = {NCHANNELS, NX, NY, NZ};
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
printf("Writing %ld bytes of Compressed data (cr = %.2f)\n", compressed_bytes, local_bytes*1.0/compressed_bytes);
#endif
......@@ -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] = {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);
#if DBG
printf("rank %d, offset = %ld, size = %ld (%ld)\n", rank, offset, decompressed_bytes, local_bytes); fflush(0);
......
#include "Cubism/ArgumentParser.h"
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <regex> // C++11
#include "Cubism/ArgumentParser.h"
CUBISM_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////
......
......@@ -7,12 +7,13 @@
* Copyright 2012 ETH Zurich. All rights reserved.
*
*/
#include "Histogram.h"
#include <fstream>
#include <assert.h>
#include <math.h>
#include <iostream>
#include "Cubism/Histogram.h"
using namespace std;
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