Commit 5c0246ff authored by Brian Barran's avatar Brian Barran
Browse files

send reporting to stderr; update default compression settings

parent 888101ca
......@@ -182,7 +182,7 @@ target_link_libraries(openvds_objects PUBLIC ${CUDA_LIBRARIES})
EXECUTE_PROCESS(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCH)
set(BITCOMP_ROOT "/workspace/bitcomp" CACHE PATH "")
set(BITCOMP_ROOT "/workspace/compression" CACHE PATH "")
set(BITCOMP_STATIC_LIB "${BITCOMP_ROOT}/lib/linux_${ARCH}/cuda10.1/libbitcomp.a")
add_library(lib_bitcomp STATIC IMPORTED)
......
......@@ -456,7 +456,7 @@ void CreateVolumeDataLayout(VDS &vds)
actualValueRangeChannel,
actualValueRange,
VolumeDataHash::GetUniqueHash(),
CompressionMethod::BitcompLossless,
CompressionMethod::BitcompLossyToSigned,
0.001,
false,
0));
......
......@@ -387,7 +387,7 @@ bool DeserializeVolumeData(const std::vector<uint8_t> &serializedData, VolumeDat
}
if (!InitializeDataBlock(*dataBlockDescriptor, dataBlock, error))
{
printf("Could not initialize data block\n");
fprintf(stderr, "Could not initialize data block\n");
return false;
}
......@@ -809,6 +809,16 @@ VolumeDataStore::SerializeVolumeData(const VolumeDataChunk& chunk, const DataBlo
hostUncompressed = (char *)tmpdata.get();
destinationBuffer.resize(maxCompressedSize + sizeof(dataBlockHeader) + sizeof(size_t));
hostCompressed = (char *)destinationBuffer.data();
memcpy(hostCompressed, &dataBlockHeader, sizeof(dataBlockHeader));
hostCompressed += sizeof(dataBlockHeader);
size_t *compressedSize = (size_t *)hostCompressed;
hostCompressed += sizeof(size_t);
cudaError_t cudaError;
if ((cudaError = cudaMalloc((void **)&deviceUncompressed, unCompressedSize)) != cudaSuccess ||
......@@ -818,19 +828,11 @@ VolumeDataStore::SerializeVolumeData(const VolumeDataChunk& chunk, const DataBlo
errorStr.append(cudaGetErrorString(cudaError));
errorStr.append(")");
throw std::runtime_error(errorStr);
}
destinationBuffer.resize(maxCompressedSize + sizeof(dataBlockHeader) + sizeof(size_t));
hostCompressed = (char *)destinationBuffer.data();
memcpy(hostCompressed, &dataBlockHeader, sizeof(dataBlockHeader));
hostCompressed += sizeof(dataBlockHeader);
fprintf(stderr, "%s", errorStr.c_str());
size_t *compressedSize = (size_t *)hostCompressed;
hostCompressed += sizeof(size_t);
throw std::runtime_error(errorStr);
}
if ((cudaError = cudaMemcpy(deviceUncompressed, hostUncompressed, unCompressedSize, cudaMemcpyHostToDevice)) != cudaSuccess)
{
......@@ -839,6 +841,8 @@ VolumeDataStore::SerializeVolumeData(const VolumeDataChunk& chunk, const DataBlo
errorStr.append(cudaGetErrorString(cudaError));
errorStr.append(")");
fprintf(stderr, "%s", errorStr.c_str());
throw std::runtime_error(errorStr);
}
......@@ -866,6 +870,8 @@ VolumeDataStore::SerializeVolumeData(const VolumeDataChunk& chunk, const DataBlo
if (bitcompCreatePlan(&plan, unCompressedSize, dataType, mode, algo) != BITCOMP_SUCCESS)
{
fprintf(stderr, "Creation failed");
throw std::runtime_error("Bistream plan creation failed");
}
......@@ -897,11 +903,15 @@ VolumeDataStore::SerializeVolumeData(const VolumeDataChunk& chunk, const DataBlo
if (compressionResult != BITCOMP_SUCCESS ||
cudaDeviceSynchronize() != cudaSuccess)
{
fprintf(stderr, "Compression failure");
throw std::runtime_error("Bitcomp compression failure");
}
if (bitcompGetCompressedSize(deviceCompressed, compressedSize) != BITCOMP_SUCCESS)
{
fprintf(stderr, "Compression size failure");
throw std::runtime_error("Bitcomp get compressed size failure");
}
......@@ -912,6 +922,8 @@ VolumeDataStore::SerializeVolumeData(const VolumeDataChunk& chunk, const DataBlo
errorStr.append(cudaGetErrorString(cudaError));
errorStr.append(")");
fprintf(stderr, "%s", errorStr.c_str());
throw std::runtime_error(errorStr);
}
......@@ -922,6 +934,8 @@ VolumeDataStore::SerializeVolumeData(const VolumeDataChunk& chunk, const DataBlo
if (bitcompDestroyPlan(plan) != BITCOMP_SUCCESS)
{
fprintf(stderr, "Destroy plan failure");
throw std::runtime_error("Bitcomp destroy plan failure");
}
......
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