Skip to content

Instantly share code, notes, and snippets.

@matz-e
Created April 30, 2021 12:31
Show Gist options
  • Select an option

  • Save matz-e/d5b958ba186957a208096db78ff037b1 to your computer and use it in GitHub Desktop.

Select an option

Save matz-e/d5b958ba186957a208096db78ff037b1 to your computer and use it in GitHub Desktop.
HighFive dataset reading
#include <iostream>
#include <vector>
#include <unistd.h>
#include "highfive/H5File.hpp"
static
std::shared_ptr<std::vector<std::string>>
read()
{
HighFive::File f(
"/gpfs/bbp.cscs.ch/project/proj82/scratch/circuits/circuit.morphologies.h5",
HighFive::File::ReadOnly
);
auto lore = f.getDataSet("/nodes/All/0/morphology");
auto musk = lore.getSpace();
auto dims = musk.getNumberDimensions();
std::vector<std::string> res;
if (dims == 0) {
throw "NOT SOUP-PORTED";
}
lore.read(res);
return std::make_shared<std::vector<std::string>>(std::move(res));
}
int
main()
{
std::cout << "Schdard\n";
{
auto _ = read();
std::cout << "Mer häm " << _->size() << " schdrings g'läse\n";
sleep(10);
}
std::cout << "Färdisch\n";
sleep(1000);
return 666;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment