Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mutex in SZ operator #3137

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6330fab
Merge pull request #3091 from chuckatkins/gha-ci-features
Mar 5, 2022
c9974b9
Merge release_28
Mar 5, 2022
af0a938
moved SscWriter to SscWriterGeneric
JasonRuonanWang Mar 6, 2022
7c6d32c
moved SscReader to SscReaderGeneric
JasonRuonanWang Mar 7, 2022
6999c6f
removed original SscReader code
JasonRuonanWang Mar 7, 2022
e2e94f2
Merge pull request #3092 from JasonRuonanWang/ssc
JasonRuonanWang Mar 7, 2022
336f374
added SscNaive
JasonRuonanWang Mar 8, 2022
25db862
Merge pull request #3090 from anagainaru/cuda-doc
anagainaru Mar 8, 2022
51c041b
Merge release_28
Mar 8, 2022
08c9d13
Merge pull request #3030 from caitlinross/plugin-operator
Mar 8, 2022
7cfaa35
Merge release_28
Mar 8, 2022
9a78e0f
BP5Deserializer GenerateReadRequests fix rank fix
eisenhauer Mar 9, 2022
47049ca
Merge pull request #3096 from eisenhauer/BP5Rank
eisenhauer Mar 9, 2022
3c35a3c
Merge pull request #3099 from pnorbert/bp5-idx-recordformat
pnorbert Mar 10, 2022
98f1081
Merge release_28
Mar 11, 2022
34fd1b9
Merge pull request #3098 from chuckatkins/move-to-release-pr3096
Mar 11, 2022
ab72b6c
Merge release_28
Mar 11, 2022
ea8f50e
Merge pull request #3102 from pnorbert/fix-bp5-params-lowercase
pnorbert Mar 11, 2022
dcb9e78
Merge release_28
Mar 11, 2022
acf6639
Merge pull request #3100 from eschnett/patch-9
Mar 11, 2022
596b62e
Merge release_28
Mar 11, 2022
5318f3b
Bump pillow from 9.0.0 to 9.0.1 in /docs
dependabot[bot] Mar 12, 2022
d48089f
separated SscHelper DeserializeAttribute and DeserializeVariable
JasonRuonanWang Mar 15, 2022
d2340fe
finished metadata process
JasonRuonanWang Mar 15, 2022
f7c14a6
added close logic
JasonRuonanWang Mar 16, 2022
d977f70
ssc base test passed for naive mode
JasonRuonanWang Mar 16, 2022
89a5cd8
added tests for ssc naive
JasonRuonanWang Mar 16, 2022
aa9492a
removed unused variable
JasonRuonanWang Mar 16, 2022
4d82948
Merge pull request #3109 from JasonRuonanWang/ssc
JasonRuonanWang Mar 16, 2022
60ea737
move sodium option to its right place
JasonRuonanWang Mar 16, 2022
6ddfb18
Merge pull request #3112 from JasonRuonanWang/generic
JasonRuonanWang Mar 16, 2022
222b9a1
added zero block test for ssc
JasonRuonanWang Mar 16, 2022
89c5d1f
added bp file reading in MgardPlus
JasonRuonanWang Mar 17, 2022
0c809fa
rerun CI
JasonRuonanWang Mar 17, 2022
9c95a0a
Merge pull request #3103 from ornladios/dependabot/pip/docs/pillow-9.0.1
JasonRuonanWang Mar 17, 2022
032af87
Merge pull request #3113 from JasonRuonanWang/MgardPlus
JasonRuonanWang Mar 17, 2022
2406726
Merge pull request #3111 from JasonRuonanWang/ssc
JasonRuonanWang Mar 17, 2022
afa34ae
fixed a bug in ssc which blocks MPI communications
JasonRuonanWang Mar 18, 2022
8c0b86b
Merge pull request #3114 from JasonRuonanWang/ssc
JasonRuonanWang Mar 18, 2022
988e9b6
clean up SSC logging information for better debugging experience
JasonRuonanWang Mar 18, 2022
7529cff
Merge pull request #3115 from JasonRuonanWang/ssc
JasonRuonanWang Mar 18, 2022
def25cc
temporary workaround for crusher MPI bug
JasonRuonanWang Mar 21, 2022
adf7164
Merge pull request #3117 from JasonRuonanWang/ssc
JasonRuonanWang Mar 21, 2022
ce8c7ce
dill 2022-03-21 (4ea1b7ad)
Mar 21, 2022
3811f60
Merge branch 'upstream-dill' into DILLupstream
eisenhauer Mar 21, 2022
d9ea2b7
Merge pull request #3118 from eisenhauer/DILLupstream
eisenhauer Mar 21, 2022
18617fe
Merge pull request #3104 from pnorbert/fix-bpls-version
pnorbert Mar 14, 2022
ed9d046
Merge release_28
Mar 24, 2022
127457a
Merge pull request #3107 from pnorbert/bp5-statslevel
pnorbert Mar 14, 2022
6c4cb55
Merge release_28
Mar 24, 2022
07704b1
Merge pull request #3105 from eisenhauer/BP5Reads
eisenhauer Mar 15, 2022
b786b98
Merge release_28
Mar 24, 2022
6748630
Merge pull request #3120 from pnorbert/docs-update
pnorbert Mar 22, 2022
d2503ea
Merge release_28
Mar 24, 2022
b3f8b95
Merge pull request #3123 from eisenhauer/Timeout
eisenhauer Mar 23, 2022
378e998
Merge release_28
Mar 24, 2022
1d093b7
Merge pull request #3122 from pnorbert/docs-whatsnew
pnorbert Mar 23, 2022
fd8ffc0
Merge release_28
Mar 24, 2022
0328943
Merge pull request #3124 from pnorbert/profiling_pretty_print
pnorbert Mar 23, 2022
4328408
Merge release_28
Mar 24, 2022
e07b74a
Merge pull request #3126 from pnorbert/nullengine
pnorbert Mar 24, 2022
052b69a
Merge release_28
Mar 24, 2022
fc24175
Merge pull request #3130 from chuckatkins/move-to-release-pr3103
Mar 24, 2022
adb61e6
Merge release_28
Mar 24, 2022
4c751c4
Merge pull request #3134 from chuckatkins/fix-rtd-error
Mar 25, 2022
5cc76de
Merge release_28
Mar 25, 2022
04292b5
Testing for different reading patterns with GPU buffers
anagainaru Mar 25, 2022
7d44b75
GPU copy for BP5 capable of copying mutiple chunks
anagainaru Mar 25, 2022
88b9e84
Add binding: Attribute::IsValue
franzpoeschel Mar 25, 2022
727ab38
Testing
franzpoeschel Mar 25, 2022
100e0ca
added mutex in sz operator
JasonRuonanWang Mar 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ endif()


set(ADIOS2_CONFIG_OPTS
BP5 DataMan DataSpaces HDF5 HDF5_VOL MHS SST CUDA Fortran MPI Python Blosc BZip2 LIBPRESSIO MGARD PNG SZ ZFP DAOS IME O_DIRECT SysVShMem ZeroMQ Profiling Endian_Reverse Sodium
BP5 DataMan DataSpaces HDF5 HDF5_VOL MHS SST CUDA Fortran MPI Python Blosc BZip2 LIBPRESSIO MGARD PNG SZ ZFP DAOS IME O_DIRECT Sodium SysVShMem ZeroMQ Profiling Endian_Reverse
)

GenerateADIOSHeaderConfig(${ADIOS2_CONFIG_OPTS})
Expand Down
8 changes: 8 additions & 0 deletions bindings/CXX11/adios2/cxx11/Attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ namespace adios2
} \
\
template <> \
bool Attribute<T>::IsValue() const \
{ \
helper::CheckForNullptr(m_Attribute, \
"in call to Attribute<T>::IsValue()"); \
return m_Attribute->m_IsSingleValue; \
} \
\
template <> \
std::string ToString(const Attribute<T> &attribute) \
{ \
return std::string("Attribute<") + attribute.Type() + ">(Name: \"" + \
Expand Down
6 changes: 6 additions & 0 deletions bindings/CXX11/adios2/cxx11/Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ class Attribute
*/
std::vector<T> Data() const;

/**
* Distinguish single-value attributes from vector attributes
* @return true if single-value, false otherwise
*/
bool IsValue() const;

private:
Attribute<T>(core::Attribute<IOType> *attribute);
core::Attribute<IOType> *m_Attribute = nullptr;
Expand Down
10 changes: 8 additions & 2 deletions source/adios2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,15 @@ if(ADIOS2_HAVE_MPI)
core/IOMPI.cpp
helper/adiosCommMPI.h helper/adiosCommMPI.cpp
helper/adiosMpiHandshake.h helper/adiosMpiHandshake.cpp
engine/ssc/SscReader.cpp engine/ssc/SscReader.tcc
engine/ssc/SscWriter.cpp engine/ssc/SscWriter.tcc
engine/ssc/SscHelper.cpp
engine/ssc/SscWriter.cpp
engine/ssc/SscWriterBase.cpp
engine/ssc/SscWriterGeneric.cpp
engine/ssc/SscWriterNaive.cpp
engine/ssc/SscReader.cpp
engine/ssc/SscReaderBase.cpp
engine/ssc/SscReaderGeneric.cpp
engine/ssc/SscReaderNaive.cpp
)
set_property(TARGET adios2_core_mpi PROPERTY EXPORT_NAME core_mpi)
set_property(TARGET adios2_core_mpi PROPERTY OUTPUT_NAME adios2${ADIOS2_LIBRARY_SUFFIX}_core_mpi)
Expand Down
225 changes: 117 additions & 108 deletions source/adios2/engine/ssc/SscHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
*/

#include "SscHelper.h"
#include "adios2/common/ADIOSMacros.h"
#include "adios2/helper/adiosFunctions.h"
#include "adios2/helper/adiosType.h"
#include <iostream>
#include <numeric>

namespace adios2
{
Expand Down Expand Up @@ -248,55 +243,36 @@ void SerializeAttributes(IO &input, Buffer &output)
}
}

void Deserialize(const Buffer &input, BlockVecVec &output, IO &io,
const bool regVars, const bool regAttrs)
void DeserializeAttribute(const Buffer &input, uint64_t &pos, IO &io,
const bool regIO)
{
for (auto &i : output)
{
i.clear();
}
const DataType type = static_cast<DataType>(input[pos]);
++pos;

uint64_t pos = 2;
uint8_t nameSize = input[pos];
++pos;

uint64_t blockSize = input.value<uint64_t>(pos);
std::vector<char> namev(nameSize);
std::memcpy(namev.data(), input.data(pos), nameSize);
std::string name = std::string(namev.begin(), namev.end());
pos += nameSize;

uint64_t size = input.value<uint64_t>(pos);
pos += 8;

while (pos < blockSize)
if (regIO)
{

uint8_t shapeId = input[pos];
++pos;

if (shapeId == 66)
const auto &attributes = io.GetAttributes();
auto it = attributes.find(name);
if (it == attributes.end())
{
const DataType type = static_cast<DataType>(input[pos]);
++pos;

uint8_t nameSize = input[pos];
++pos;

std::vector<char> namev(nameSize);
std::memcpy(namev.data(), input.data(pos), nameSize);
std::string name = std::string(namev.begin(), namev.end());
pos += nameSize;

uint64_t size = input.value<uint64_t>(pos);
pos += 8;

if (regAttrs)
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (type == DataType::String)
{
const auto &attributes = io.GetAttributes();
auto it = attributes.find(name);
if (it == attributes.end())
{
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (type == DataType::String)
{
io.DefineAttribute<std::string>(
name, std::string(input.data<char>(pos), size));
}
io.DefineAttribute<std::string>(
name, std::string(input.data<char>(pos), size));
}
#define declare_type(T) \
else if (type == helper::GetDataType<T>()) \
{ \
Expand All @@ -309,75 +285,73 @@ void Deserialize(const Buffer &input, BlockVecVec &output, IO &io,
io.DefineAttribute<T>(name, input.data<T>(pos), size / sizeof(T)); \
} \
}
ADIOS2_FOREACH_ATTRIBUTE_STDTYPE_1ARG(declare_type)
ADIOS2_FOREACH_ATTRIBUTE_STDTYPE_1ARG(declare_type)
#undef declare_type
else
{
helper::Throw<std::runtime_error>(
"Engine", "SscHelper", "Deserialize",
"unknown attribute data type");
}
}
else
{
helper::Throw<std::runtime_error>(
"Engine", "SscHelper", "Deserialize",
"unknown attribute data type");
}
pos += size;
}
else
{
int rank = input.value<int>(pos);
pos += 4;
output[rank].emplace_back();
auto &b = output[rank].back();
b.shapeId = static_cast<ShapeID>(shapeId);
}
pos += size;
}

uint8_t nameSize = input[pos];
++pos;
void DeserializeVariable(const Buffer &input, const ShapeID shapeId,
uint64_t &pos, BlockInfo &b, IO &io, const bool regIO)
{
b.shapeId = static_cast<ShapeID>(shapeId);

std::vector<char> name(nameSize);
std::memcpy(name.data(), input.data(pos), nameSize);
b.name = std::string(name.begin(), name.end());
pos += nameSize;
uint8_t nameSize = input[pos];
++pos;

b.type = static_cast<DataType>(input[pos]);
++pos;
std::vector<char> name(nameSize);
std::memcpy(name.data(), input.data(pos), nameSize);
b.name = std::string(name.begin(), name.end());
pos += nameSize;

uint8_t shapeSize = input[pos];
++pos;
b.shape.resize(shapeSize);
b.start.resize(shapeSize);
b.count.resize(shapeSize);
b.type = static_cast<DataType>(input[pos]);
++pos;

std::memcpy(b.shape.data(), input.data(pos), 8 * shapeSize);
pos += 8 * shapeSize;
uint8_t shapeSize = input[pos];
++pos;
b.shape.resize(shapeSize);
b.start.resize(shapeSize);
b.count.resize(shapeSize);

std::memcpy(b.start.data(), input.data(pos), 8 * shapeSize);
pos += 8 * shapeSize;
std::memcpy(b.shape.data(), input.data(pos), 8 * shapeSize);
pos += 8 * shapeSize;

std::memcpy(b.count.data(), input.data(pos), 8 * shapeSize);
pos += 8 * shapeSize;
std::memcpy(b.start.data(), input.data(pos), 8 * shapeSize);
pos += 8 * shapeSize;

b.bufferStart = input.value<uint64_t>(pos);
pos += 8;
std::memcpy(b.count.data(), input.data(pos), 8 * shapeSize);
pos += 8 * shapeSize;

b.bufferCount = input.value<uint64_t>(pos);
pos += 8;
b.bufferStart = input.value<uint64_t>(pos);
pos += 8;

uint8_t valueSize = input[pos];
pos++;
b.value.resize(valueSize);
if (valueSize > 0)
{
std::memcpy(b.value.data(), input.data() + pos, valueSize);
pos += valueSize;
}
b.bufferCount = input.value<uint64_t>(pos);
pos += 8;

if (regVars)
{
if (b.type == DataType::None)
{
helper::Throw<std::runtime_error>(
"Engine", "SscHelper", "Deserialize",
"unknown variable data type");
}
uint8_t valueSize = input[pos];
pos++;
b.value.resize(valueSize);
if (valueSize > 0)
{
std::memcpy(b.value.data(), input.data() + pos, valueSize);
pos += valueSize;
}

if (regIO)
{
if (b.type == DataType::None)
{
helper::Throw<std::runtime_error>("Engine", "SscHelper",
"Deserialize",
"unknown variable data type");
}
#define declare_type(T) \
else if (b.type == helper::GetDataType<T>()) \
{ \
Expand Down Expand Up @@ -409,15 +383,50 @@ void Deserialize(const Buffer &input, BlockVecVec &output, IO &io,
} \
} \
}
ADIOS2_FOREACH_STDTYPE_1ARG(declare_type)
ADIOS2_FOREACH_STDTYPE_1ARG(declare_type)
#undef declare_type
else
{
helper::Throw<std::runtime_error>(
"Engine", "SscHelper", "Deserialize",
"unknown variable data type");
}
}
else
{
helper::Throw<std::runtime_error>("Engine", "SscHelper",
"Deserialize",
"unknown variable data type");
}
}
}

void Deserialize(const Buffer &input, BlockVecVec &output, IO &io,
const bool regVars, const bool regAttrs)
{
for (auto &i : output)
{
i.clear();
}

uint64_t pos = 2;

uint64_t blockSize = input.value<uint64_t>(pos);

pos += 8;

while (pos < blockSize)
{

uint8_t shapeId = input[pos];
++pos;

if (shapeId == 66)
{
DeserializeAttribute(input, pos, io, regAttrs);
}
else
{
int rank = input.value<int>(pos);
pos += 4;
output[rank].emplace_back();
auto &b = output[rank].back();

DeserializeVariable(input, static_cast<ShapeID>(shapeId), pos, b,
io, regVars);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions source/adios2/engine/ssc/SscHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@
#ifndef ADIOS2_ENGINE_SSCHELPER_H_
#define ADIOS2_ENGINE_SSCHELPER_H_

#include "adios2/common/ADIOSTypes.h"
#include "adios2/core/IO.h"
#include "adios2/helper/adiosLog.h"
#include <mpi.h>
#include <unordered_map>
#include <vector>

namespace adios2
{
Expand Down Expand Up @@ -152,6 +148,10 @@ RankPosMap CalculateOverlap(BlockVecVec &globalPattern,

void SerializeVariables(const BlockVec &input, Buffer &output, const int rank);
void SerializeAttributes(IO &input, Buffer &output);
void DeserializeVariable(const Buffer &input, const ShapeID shapeId,
uint64_t &pos, BlockInfo &b, IO &io, const bool regIO);
void DeserializeAttribute(const Buffer &input, uint64_t &pos, IO &io,
const bool regIO);
void Deserialize(const Buffer &input, BlockVecVec &output, IO &io,
const bool regVars, const bool regAttrs);
void AggregateMetadata(const Buffer &localBuffer, Buffer &globalBuffer,
Expand Down
Loading