From cc1160231397ffa6f958048a0f4a5d134a724f2d Mon Sep 17 00:00:00 2001
From: Pietro Incardona <incardon@mpi-cbg.de>
Date: Thu, 28 May 2020 10:35:14 +0200
Subject: [PATCH] Fixing IO

---
 openfpm_io                                    |  2 +-
 ...grid_dist_id_HDF5_chckpnt_restart_test.cpp | 58 +++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/openfpm_io b/openfpm_io
index c66d8ce6b..0357b11b1 160000
--- a/openfpm_io
+++ b/openfpm_io
@@ -1 +1 @@
-Subproject commit c66d8ce6b84935972cc773ea457614bdb8707ea7
+Subproject commit 0357b11b1c27cc519793659ddb22b3bbd16f14b3
diff --git a/src/Grid/tests/grid_dist_id_HDF5_chckpnt_restart_test.cpp b/src/Grid/tests/grid_dist_id_HDF5_chckpnt_restart_test.cpp
index ae7bbf7c9..9ed95ba85 100644
--- a/src/Grid/tests/grid_dist_id_HDF5_chckpnt_restart_test.cpp
+++ b/src/Grid/tests/grid_dist_id_HDF5_chckpnt_restart_test.cpp
@@ -145,6 +145,64 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_load_test )
 }
 
 
+BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_load_test_diff_proc )
+{
+
+	// Input data
+	size_t k = 200;
+
+	float ghost_part = 0.0;
+
+	// Domain
+	Box<2,float> domain({0.0,0.0},{1.0,1.0});
+
+	Vcluster<> & v_cl = create_vcluster();
+
+	// Skip this test on big scale
+	if (v_cl.getProcessingUnits() >= 32)
+		return;
+
+	// grid size
+	size_t sz[2];
+	sz[0] = k;
+	sz[1] = k;
+
+	// Ghost
+	Ghost<2,float> g(3);
+
+	// Distributed grid with id decomposition
+	grid_dist_id<2, float, aggregate<float>> g_dist(sz,domain,g);
+
+	g_dist.load("test_data/test_data_single.h5");
+
+	auto it = g_dist.getDomainIterator();
+
+	size_t count = 0;
+
+	bool match = true;
+	while (it.isNext())
+	{
+		//key
+		auto key = it.get();
+
+		//BOOST_CHECK_CLOSE(g_dist.template get<0>(key),1,0.0001);
+		//std::cout << "Element: " << g_dist.template get<0>(key) << std::endl;
+
+		auto keyg = g_dist.getGKey(key);
+
+		match &= g_dist.template get<0>(key) == keyg.get(0);
+
+		++it;
+		count++;
+	}
+
+	v_cl.sum(count);
+	v_cl.execute();
+
+	BOOST_REQUIRE_EQUAL(count, (size_t)k*k);
+	BOOST_REQUIRE_EQUAL(match,true);
+}
+
 BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_2GB_save_test )
 {
 	float ghost_part = 0.0;
-- 
GitLab