Skip to content

Commit

Permalink
Fix after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
philippeVerney committed Feb 1, 2024
1 parent 1078817 commit 43532d4
Show file tree
Hide file tree
Showing 27 changed files with 67 additions and 492 deletions.
2 changes: 1 addition & 1 deletion example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ void deserializeActivity(COMMON_NS::AbstractObject const * resqmlObject)
}
}
else if (activity->isAnIntegerQuantityParameter(paramTitle)) {
vector<int32_t> vals = activity->getIntegerQuantityParameterValue(paramTitle);
vector<int64_t> vals = activity->getIntegerQuantityParameterValue(paramTitle);
for (size_t k = 0; k < vals.size(); ++k) {
cout << "Integer value : " << vals[k] << endl;
}
Expand Down
4 changes: 2 additions & 2 deletions example/exampleMPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void serialize(const std::string filename) {

// It is important to explictely give an UUID to the subrep in order all ranks write into the same HDF dataset.
// If it is a random, each rank would write in a different HDF dataset.
RESQML2_NS::SubRepresentation* subrep = repo.createSubRepresentation("0c5803ec-b620-4d56-9fc4-bf354fdc5b6b", "parallel subrep", gsoap_eml2_3::resqml22__IndexableElement::cells);
RESQML2_NS::SubRepresentation* subrep = repo.createSubRepresentation("0c5803ec-b620-4d56-9fc4-bf354fdc5b6b", "parallel subrep", gsoap_eml2_3::eml23__IndexableElement::cells);
subrep->pushBackSubRepresentationPatch(3, unstructuredGrid_4cells); // only 3 cells of the 4
if (world_rank < 3) {
uint64_t elementIndice = world_rank;
Expand All @@ -65,7 +65,7 @@ void serialize(const std::string filename) {

// It is important to explictely give an UUID to the property in order all ranks write into the same HDF dataset.
// If it is a random, each rank would write in a different HDF dataset.
RESQML2_NS::ContinuousProperty* prop = repo.createContinuousProperty(unstructuredGrid_4cells, "9cd64cd9-9ecc-4da1-a3f3-ee77335d98c8", "parallel property", 1, gsoap_eml2_3::resqml22__IndexableElement::cells,
RESQML2_NS::ContinuousProperty* prop = repo.createContinuousProperty(unstructuredGrid_4cells, "9cd64cd9-9ecc-4da1-a3f3-ee77335d98c8", "parallel property", gsoap_eml2_3::eml23__IndexableElement::cells,
gsoap_resqml2_0_1::resqml20__ResqmlUom::m, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind::length);

prop->pushBackHdf5Array1dOfValues(COMMON_NS::AbstractObject::numericalDatatypeEnum::DOUBLE, world_size);
Expand Down
2 changes: 0 additions & 2 deletions src/common/AbstractObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,6 @@ gsoap_eml2_2::eml22__DataObjectReference* AbstractObject::newEml22Reference() co

gsoap_eml2_3::eml23__DataObjectReference* AbstractObject::newEml23Reference() const
{
ostringstream oss;

gsoap_eml2_3::eml23__DataObjectReference* result = gsoap_eml2_3::soap_new_eml23__DataObjectReference(getGsoapContext());
result->Uuid = getUuid();
result->Title = getTitle();
Expand Down
7 changes: 0 additions & 7 deletions src/eml2/AbstractLocal3dCrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,6 @@ namespace EML2_NS
*/
DLL_IMPORT_OR_EXPORT uint64_t getVerticalCrsEpsgCode() const;

/**
* Gets the vertical CRS unit of measure as a string
*
* @returns The vertical CRS unit of measure as string.
*/
DLL_IMPORT_OR_EXPORT std::string getVerticalCrsUnitAsString() const;

/**
* Gets the areal rotation unit of measure.
*
Expand Down
2 changes: 1 addition & 1 deletion src/eml2/Activity.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ namespace EML2_NS
*
* @returns A vector of the value of all the @p paramTitle integer quantity parameters.
*/
DLL_IMPORT_OR_EXPORT virtual std::vector<int32_t> getIntegerQuantityParameterValue(const std::string & paramTitle) const = 0;
DLL_IMPORT_OR_EXPORT virtual std::vector<int64_t> getIntegerQuantityParameterValue(const std::string & paramTitle) const = 0;

/**
* Gets the integer quantity value of a given parameter.
Expand Down
2 changes: 1 addition & 1 deletion src/eml2_3/Activity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ bool Activity::isAnIntegerQuantityParameter(uint64_t index) const
return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__IntegerQuantityParameter;
}

vector<int32_t> Activity::getIntegerQuantityParameterValue(const std::string & paramTitle) const
vector<int64_t> Activity::getIntegerQuantityParameterValue(const std::string & paramTitle) const
{
vector<gsoap_eml2_3::eml23__AbstractActivityParameter*> param = getParameterFromTitle(paramTitle);

Expand Down
8 changes: 4 additions & 4 deletions src/eml2_3/LocalEngineeringCompoundCrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void LocalEngineeringCompoundCrs::init(COMMON_NS::DataObjectRepository * repo, c
LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented)
{
init(repo, guid, title,
Expand Down Expand Up @@ -164,7 +164,7 @@ LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRe
LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented)
{
init(repo, guid, title,
Expand Down Expand Up @@ -196,7 +196,7 @@ LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRe
LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__TimeUom timeUom,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented)
{
Expand Down Expand Up @@ -230,7 +230,7 @@ LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRe
LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__TimeUom timeUom,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented)
{
Expand Down
8 changes: 4 additions & 4 deletions src/eml2_3/LocalEngineeringCompoundCrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace EML2_3_NS
LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented);

/**
Expand Down Expand Up @@ -127,7 +127,7 @@ namespace EML2_3_NS
LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented);

/**
Expand Down Expand Up @@ -188,7 +188,7 @@ namespace EML2_3_NS
LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__TimeUom timeUom,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented);

Expand Down Expand Up @@ -254,7 +254,7 @@ namespace EML2_3_NS
LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title,
double originOrdinal1, double originOrdinal2, double originOrdinal3,
double arealRotation,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, unsigned long projectedEpsgCode,
gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode,
gsoap_resqml2_0_1::eml20__TimeUom timeUom,
gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented);

Expand Down
6 changes: 3 additions & 3 deletions src/resqml2/AbstractColumnLayerGridRepresentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void AbstractColumnLayerGridRepresentation::setIntervalAssociationWithStratigrap
}
}
getRepository()->addRelationship(this, hdfProxy);
hsize_t dim = getKCellCount();
const uint64_t dim = getKCellCount();
hdfProxy->writeArrayNd(getHdfGroup(), "IntervalStratigraphicUnits", COMMON_NS::AbstractObject::numericalDatatypeEnum::INT64, stratiUnitIndices, &dim, 1);

resqml20__AbstractColumnLayerGridRepresentation* rep = static_cast<resqml20__AbstractColumnLayerGridRepresentation*>(gsoapProxy2_0_1);
Expand All @@ -103,7 +103,7 @@ void AbstractColumnLayerGridRepresentation::setIntervalAssociationWithStratigrap
gsoap_eml2_3::eml23__IntegerXmlArray* elementDataset = gsoap_eml2_3::soap_new_eml23__IntegerXmlArray(rep->soap);
elementDataset->CountPerValue = nullValue;
elementDataset->Values = std::to_string(stratiUnitIndices[0]);
for (hsize_t i = 1; i < getKCellCount(); ++i) {
for (uint64_t i = 1; i < getKCellCount(); ++i) {
elementDataset->Values += " " + std::to_string(stratiUnitIndices[i]);
}
rep->IntervalStratigraphicUnits->UnitIndices->Elements = elementDataset;
Expand All @@ -112,7 +112,7 @@ void AbstractColumnLayerGridRepresentation::setIntervalAssociationWithStratigrap
gsoap_eml2_3::eml23__IntegerXmlArray* cumulativeDataset = gsoap_eml2_3::soap_new_eml23__IntegerXmlArray(rep->soap);
cumulativeDataset->CountPerValue = 1;
cumulativeDataset->Values = "1";
for (hsize_t i = 1; i < getKCellCount(); ++i) {
for (uint64_t i = 1; i < getKCellCount(); ++i) {
cumulativeDataset->Values += " " + std::to_string(i+1);
}
rep->IntervalStratigraphicUnits->UnitIndices->CumulativeLength = cumulativeDataset;
Expand Down
55 changes: 15 additions & 40 deletions src/resqml2/AbstractValuesProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ under the License.
using namespace RESQML2_NS;
using namespace std;

namespace {
vector<hsize_t> copyToHdf5Datatype(uint64_t const* values, size_t nbValues) {
vector<hsize_t> result;
for (size_t i = 0; i < nbValues; ++i) {
result.push_back(values[i]);
}
return result;
}
}

uint64_t AbstractValuesProperty::getPatchCount() const
{
if (gsoapProxy2_0_1 != nullptr) {
Expand Down Expand Up @@ -613,14 +603,11 @@ void AbstractValuesProperty::pushBackInt64Hdf5ArrayOfValues(const int64_t * valu

const std::string datasetName = "values_patch" + std::to_string(getPatchCount());

// Convert to hsize_t (somtimes hsize is unsigned long long (windows), sometimes unsigned long (Linux)...
vector<hsize_t> tmp = copyToHdf5Datatype(numValues, numDimensionsInArray);

proxy->writeArrayNd(getHdfGroup(),
datasetName,
COMMON_NS::AbstractObject::numericalDatatypeEnum::INT64,
values,
tmp.data(), numDimensionsInArray);
numValues, numDimensionsInArray);

pushBackRefToExistingIntegerDataset(proxy, getHdfGroup() + "/" + datasetName, nullValue);
}
Expand All @@ -636,14 +623,11 @@ void AbstractValuesProperty::pushBackIntHdf5ArrayOfValues(const int * values, co

const std::string datasetName = "values_patch" + std::to_string(getPatchCount());

// Convert to hsize_t (somtimes hsize is unsigned long long (windows), sometimes unsigned long (Linux)...
vector<hsize_t> tmp = copyToHdf5Datatype(numValues, numDimensionsInArray);

proxy->writeArrayNd(getHdfGroup(),
datasetName,
COMMON_NS::AbstractObject::numericalDatatypeEnum::INT32,
values,
tmp.data(), numDimensionsInArray);
numValues, numDimensionsInArray);

pushBackRefToExistingIntegerDataset(proxy, getHdfGroup() + "/" + datasetName, nullValue);
}
Expand All @@ -659,14 +643,11 @@ void AbstractValuesProperty::pushBackShortHdf5ArrayOfValues(const short * values

const std::string datasetName = "values_patch" + std::to_string(getPatchCount());

// Convert to hsize_t (somtimes hsize is unsigned long long (windows), sometimes unsigned long (Linux)...
vector<hsize_t> tmp = copyToHdf5Datatype(numValues, numDimensionsInArray);

proxy->writeArrayNd(getHdfGroup(),
datasetName,
COMMON_NS::AbstractObject::numericalDatatypeEnum::INT16,
values,
tmp.data(), numDimensionsInArray);
numValues, numDimensionsInArray);

pushBackRefToExistingIntegerDataset(proxy, getHdfGroup() + "/" + datasetName, nullValue);
}
Expand All @@ -682,14 +663,11 @@ void AbstractValuesProperty::pushBackUShortHdf5ArrayOfValues(const unsigned shor

const std::string datasetName = "values_patch" + std::to_string(getPatchCount());

// Convert to hsize_t (somtimes hsize is unsigned long long (windows), sometimes unsigned long (Linux)...
vector<hsize_t> tmp = copyToHdf5Datatype(numValues, numDimensionsInArray);

proxy->writeArrayNd(getHdfGroup(),
datasetName,
COMMON_NS::AbstractObject::numericalDatatypeEnum::UINT16,
values,
tmp.data(), numDimensionsInArray);
numValues, numDimensionsInArray);

pushBackRefToExistingIntegerDataset(proxy, getHdfGroup() + "/" + datasetName, nullValue);
}
Expand All @@ -705,14 +683,11 @@ void AbstractValuesProperty::pushBackInt8Hdf5ArrayOfValues(const int8_t * values

const std::string datasetName = "values_patch" + std::to_string(getPatchCount());

// Convert to hsize_t (somtimes hsize is unsigned long long (windows), sometimes unsigned long (Linux)...
vector<hsize_t> tmp = copyToHdf5Datatype(numValues, numDimensionsInArray);

proxy->writeArrayNd(getHdfGroup(),
datasetName,
COMMON_NS::AbstractObject::numericalDatatypeEnum::INT8,
values,
tmp.data(), numDimensionsInArray);
numValues, numDimensionsInArray);

pushBackRefToExistingIntegerDataset(proxy, getHdfGroup() + "/" + datasetName, nullValue);
}
Expand Down Expand Up @@ -1088,8 +1063,8 @@ void AbstractValuesProperty::setValuesOfHdf5ArrayOfValues(
"values_patch" + std::to_string(patchIndex == (numeric_limits<uint64_t>::max)() ? getPatchCount() - 1 : patchIndex),
datatype,
values,
tmp.data(),
tmp2.data(),
numValues,
offsetValues,
numArrayDimensions);
}

Expand All @@ -1107,8 +1082,8 @@ void AbstractValuesProperty::getInt64ValuesOfPatch(
hdfProxy->readArrayNdOfInt64Values(
dsPath,
values,
copyToHdf5Datatype(numValuesInEachDimension, numArrayDimensions).data(),
copyToHdf5Datatype(offsetInEachDimension, numArrayDimensions).data(),
numValuesInEachDimension,
offsetInEachDimension,
numArrayDimensions);
}

Expand Down Expand Up @@ -1148,8 +1123,8 @@ int32_t AbstractValuesProperty::getIntValuesOfPatch(
hdfProxy->readArrayNdOfIntValues(
dsPath,
values,
copyToHdf5Datatype(numValuesInEachDimension, numArrayDimensions).data(),
copyToHdf5Datatype(offsetInEachDimension, numArrayDimensions).data(),
numValuesInEachDimension,
offsetInEachDimension,
numArrayDimensions);

if (nullValue < (std::numeric_limits<int32_t>::lowest)() || nullValue > (std::numeric_limits<int32_t>::max)()) {
Expand Down Expand Up @@ -1252,7 +1227,7 @@ void AbstractValuesProperty::pushBackDoubleHdf5ArrayOfValues(double const * valu
datasetName,
COMMON_NS::AbstractObject::numericalDatatypeEnum::DOUBLE,
values,
copyToHdf5Datatype(numValues, numArrayDimensions).data(), numArrayDimensions);
numValues, numArrayDimensions);

pushBackRefToExistingFloatingPointDataset(proxy, getHdfGroup() + "/" + datasetName);
}
Expand Down Expand Up @@ -1314,7 +1289,7 @@ void AbstractValuesProperty::pushBackHdf5ArrayOfValues(
proxy->createArrayNd(getHdfGroup(),
datasetName,
datatype,
copyToHdf5Datatype(numValues, numArrayDimensions).data(), numArrayDimensions);
numValues, numArrayDimensions);

if (datatype == COMMON_NS::AbstractObject::numericalDatatypeEnum::DOUBLE || datatype == COMMON_NS::AbstractObject::numericalDatatypeEnum::FLOAT) {
pushBackRefToExistingFloatingPointDataset(proxy, getHdfGroup() + "/" + datasetName);
Expand Down Expand Up @@ -1441,8 +1416,8 @@ void AbstractValuesProperty::getFloatValuesOfPatch(
hdfProxy->readArrayNdOfFloatValues(
datasetPath,
values,
copyToHdf5Datatype(numValuesInEachDimension, numArrayDimensions).data(),
copyToHdf5Datatype(offsetInEachDimension, numArrayDimensions).data(),
numValuesInEachDimension,
offsetInEachDimension,
numArrayDimensions);
}

Expand Down
Loading

0 comments on commit 43532d4

Please sign in to comment.