Skip to content

Commit 3c88b5c

Browse files
author
f-schmitt-zih
committed
Merge pull request #145 from ComputationalRadiationPhysics/release-1.2.3
Release 1.2.3
2 parents 561c0e5 + 89028d7 commit 3c88b5c

File tree

6 files changed

+92
-22
lines changed

6 files changed

+92
-22
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Change Log for libSplash
22
================================================================
33

4+
Release 1.2.3
5+
-------------
6+
**Date:** 2014-10-14
7+
8+
This release contains a minor fix for listing entries and groups.
9+
10+
**Misc**
11+
12+
- Remove / from datasets when listing entries #143
13+
14+
15+
**Bug Fixes**
16+
17+
- Fix bug when querying DCGroup entries #142
18+
19+
420
Release 1.2.2
521
-------------
622
**Date:** 2014-06-21

src/DCGroup.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,13 @@ namespace splash
176176
H5Lget_name_by_idx(base, ".", H5_INDEX_NAME,
177177
H5_ITER_INC, i, link_name_c, len_name + 1, H5P_LINK_ACCESS_DEFAULT);
178178

179-
currentEntryName = std::string(link_name_c) + std::string("/");
179+
currentEntryName = std::string(link_name_c);
180+
if (obj_info.type == H5O_TYPE_GROUP)
181+
{
182+
currentEntryName += std::string("/");
183+
}
180184
currentBaseName += currentEntryName;
185+
181186
delete[] link_name_c;
182187
}
183188

@@ -191,7 +196,7 @@ namespace splash
191196
if (obj_info.type == H5O_TYPE_DATASET)
192197
{
193198
if (param->entries)
194-
param->entries[param->count].name = currentEntryName;
199+
param->entries[param->count].name = currentBaseName;
195200

196201
param->count++;
197202
}

src/include/splash/version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/** the splash version reflects the changes in API */
2727
#define SPLASH_VERSION_MAJOR 1
2828
#define SPLASH_VERSION_MINOR 2
29-
#define SPLASH_VERSION_PATCH 2
29+
#define SPLASH_VERSION_PATCH 3
3030

3131
/** we can always handle files from the same major release
3232
* changes in the minor number have to be backwards compatible

tests/Parallel_SimpleDataTest.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <time.h>
2525
#include <stdlib.h>
2626
#include <string.h>
27+
#include <set>
28+
#include <string>
2729

2830
#include "Parallel_SimpleDataTest.h"
2931

@@ -107,6 +109,7 @@ bool Parallel_SimpleDataTest::subtestWriteRead(int32_t iteration,
107109
{
108110
bool results_correct = true;
109111
DataCollector::FileCreationAttr fileCAttr;
112+
std::set<std::string> datasetNames;
110113

111114
#if defined TESTS_DEBUG
112115
if (currentMpiRank == 0)
@@ -128,6 +131,13 @@ bool Parallel_SimpleDataTest::subtestWriteRead(int32_t iteration,
128131

129132
parallelDataCollector->write(iteration, ctInt, dimensions, gridSize,
130133
"deep/folder/data", dataWrite);
134+
datasetNames.insert("deep/folder/data");
135+
parallelDataCollector->write(iteration, ctInt, dimensions, gridSize,
136+
"deep/folder/data2", dataWrite);
137+
datasetNames.insert("deep/folder/data2");
138+
parallelDataCollector->write(iteration, ctInt, dimensions, gridSize,
139+
"another_dataset", dataWrite);
140+
datasetNames.insert("another_dataset");
131141
parallelDataCollector->close();
132142

133143
delete[] dataWrite;
@@ -168,6 +178,36 @@ bool Parallel_SimpleDataTest::subtestWriteRead(int32_t iteration,
168178
MPI_INFO_NULL, mpiSize, 1);
169179

170180
readCollector->open(HDF5_FILE, fileCAttr);
181+
182+
/* test entries listing */
183+
{
184+
DataCollector::DCEntry *entries = NULL;
185+
size_t numEntries = 0;
186+
187+
int32_t *ids = NULL;
188+
size_t numIDs = 0;
189+
readCollector->getEntryIDs(NULL, &numIDs);
190+
/* there might be old files, but we are at least at the current iteration */
191+
CPPUNIT_ASSERT(numIDs >= iteration + 1);
192+
ids = new int32_t[numIDs];
193+
readCollector->getEntryIDs(ids, NULL);
194+
195+
readCollector->getEntriesForID(iteration, NULL, &numEntries);
196+
CPPUNIT_ASSERT(numEntries == 3);
197+
entries = new DataCollector::DCEntry[numEntries];
198+
readCollector->getEntriesForID(iteration, entries, NULL);
199+
200+
CPPUNIT_ASSERT(numEntries == datasetNames.size());
201+
for (uint32_t i = 0; i < numEntries; ++i)
202+
{
203+
/* test that listed datasets match expected dataset names*/
204+
CPPUNIT_ASSERT(datasetNames.find(entries[i].name) != datasetNames.end());
205+
}
206+
207+
delete[] entries;
208+
delete[] ids;
209+
}
210+
171211
readCollector->read(iteration, "deep/folder/data", size_read, data_read);
172212
readCollector->close();
173213

tests/SimpleDataTest.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <stdlib.h>
2626
#include <stdint.h>
2727
#include <limits.h>
28+
#include <set>
29+
#include <string>
2830

2931
#include "SimpleDataTest.h"
3032

@@ -56,6 +58,7 @@ SimpleDataTest::~SimpleDataTest()
5658
bool SimpleDataTest::subtestWriteRead(Dimensions gridSize, Dimensions borderSize, uint32_t dimensions)
5759
{
5860
bool resultsCorrect = true;
61+
std::set<std::string> datasetNames;
5962

6063
Dimensions smallGridSize(gridSize[0] - 2 * borderSize[0],
6164
gridSize[1] - 2 * borderSize[1],
@@ -76,9 +79,11 @@ bool SimpleDataTest::subtestWriteRead(Dimensions gridSize, Dimensions borderSize
7679
dataWrite[i] = i;
7780

7881
dataCollector->write(10, ctUInt64, dimensions, Selection(gridSize), "deep/folders/data", dataWrite);
82+
datasetNames.insert("deep/folders/data");
7983

8084
dataCollector->write(20, ctUInt64, dimensions, Selection(gridSize, smallGridSize,
8185
borderSize), "deep/folders/data_without_borders", dataWrite);
86+
datasetNames.insert("deep/folders/data_without_borders");
8287

8388
dataCollector->close();
8489

@@ -109,10 +114,14 @@ bool SimpleDataTest::subtestWriteRead(Dimensions gridSize, Dimensions borderSize
109114
entries = new DataCollector::DCEntry[numEntries];
110115
dataCollector->getEntriesForID(ids[j], entries, NULL);
111116

112-
#if defined TESTS_DEBUG
113117
for (uint32_t i = 0; i < numEntries; ++i)
118+
{
119+
#if defined TESTS_DEBUG
114120
printf("id=%d name=%s\n", ids[j], entries[i].name.c_str());
115121
#endif
122+
/* test that listed datasets match expected dataset names*/
123+
CPPUNIT_ASSERT(datasetNames.find(entries[i].name) != datasetNames.end());
124+
}
116125

117126
delete[] entries;
118127
}

tests/include/Parallel_SimpleDataTest.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/**
22
* Copyright 2013 Felix Schmitt
33
*
4-
* This file is part of libSplash.
5-
*
6-
* libSplash is free software: you can redistribute it and/or modify
7-
* it under the terms of of either the GNU General Public License or
8-
* the GNU Lesser General Public License as published by
9-
* the Free Software Foundation, either version 3 of the License, or
10-
* (at your option) any later version.
11-
* libSplash is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* GNU General Public License and the GNU Lesser General Public License
15-
* for more details.
16-
*
17-
* You should have received a copy of the GNU General Public License
18-
* and the GNU Lesser General Public License along with libSplash.
19-
* If not, see <http://www.gnu.org/licenses/>.
4+
* This file is part of libSplash.
5+
*
6+
* libSplash is free software: you can redistribute it and/or modify
7+
* it under the terms of of either the GNU General Public License or
8+
* the GNU Lesser General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
* libSplash is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License and the GNU Lesser General Public License
15+
* for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* and the GNU Lesser General Public License along with libSplash.
19+
* If not, see <http://www.gnu.org/licenses/>.
2020
*/
2121

2222

@@ -50,7 +50,7 @@ class Parallel_SimpleDataTest : public CPPUNIT_NS::TestFixture
5050
* read data on conformacy.
5151
*/
5252
void testWriteRead();
53-
53+
5454
void testFill();
5555

5656
bool testData(const Dimensions mpiSize, const Dimensions gridSize,
@@ -62,7 +62,7 @@ class Parallel_SimpleDataTest : public CPPUNIT_NS::TestFixture
6262
bool subtestWriteRead(int32_t iteration, int currentMpiRank, const Dimensions mpiSize,
6363
const Dimensions mpiPos, const Dimensions gridSize,
6464
uint32_t dimensions, MPI_Comm mpiComm);
65-
65+
6666
/**
6767
* sub function for testWriteRead to allow several numbers of elements.
6868
*/

0 commit comments

Comments
 (0)