From ed5e961d6867e79ef94c8cab0119e10d4823fe71 Mon Sep 17 00:00:00 2001
From: i-bird <i-bird@localhost.localdomain>
Date: Fri, 12 Mar 2021 09:37:40 +0100
Subject: [PATCH] Fixing README and adding script

---
 CMakeLists.txt                            |  2 +
 src/Grid/tests/grid_dist_id_unit_test.cpp | 57 ++++++++++++-----------
 src/scripts/postinst                      |  6 ++-
 3 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8332a15c2..43a9c4951 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -275,6 +275,8 @@ if (CPACK_RUN_INSTALL_DEPENDENCIES)
 	set(CPACK_DEBIAN_PACKAGE_MAINTAINER Pietro Incardona)
 	set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/scripts/postinst)
 	set(CPACK_POSTFLIGHT_OPENFPM_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/src/scripts/postflight)
+	set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/src/script/postinst")
+	set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")
 
 	install(FILES $ENV{DEP_PACKING}/openfpm_vars
 		DESTINATION source
diff --git a/src/Grid/tests/grid_dist_id_unit_test.cpp b/src/Grid/tests/grid_dist_id_unit_test.cpp
index fa3d95a37..a6d4061e0 100644
--- a/src/Grid/tests/grid_dist_id_unit_test.cpp
+++ b/src/Grid/tests/grid_dist_id_unit_test.cpp
@@ -2409,51 +2409,52 @@ BOOST_AUTO_TEST_CASE( grid_dist_domain_ghost_3D_put_create_check )
 	TestXD_ghost_put_create(sg_dist3,k);
 }
 
+
 BOOST_AUTO_TEST_CASE( grid_dist_ghost_zero_size )
 {
-	// Test grid periodic
+        // Test grid periodic
 
-	Box<3,float> domain({-1.0,-1.0,-1.0},{1.0,1.0,1.0});
+        Box<3,double> domain({0,0,0},{365.376,365.376,102});
 
-	Vcluster<> & v_cl = create_vcluster();
+        Vcluster<> & v_cl = create_vcluster();
 
-	if ( v_cl.getProcessingUnits() > 32 )
-	{return;}
+        if ( v_cl.getProcessingUnits() > 32 )
+        {return;}
 
-	BOOST_TEST_CHECKPOINT( "Testing grid zero ghost");
+        BOOST_TEST_CHECKPOINT( "Testing grid zero ghost");
 
-	// grid size
-	size_t sz[3];
-	sz[0] = 32;
-	sz[1] = 32;
-	sz[2] = 32;
+        // grid size
+        size_t sz[3];
+        sz[0] = 53;
+        sz[1] = 53;
+        sz[2] = 10;
 
-	// Ghost
-	Ghost<3,long int> g(0);
+        // Ghost
+        Ghost<3,long int> g(0);
 
-	// periodicity
-	periodicity<3> pr = {{NON_PERIODIC,NON_PERIODIC,NON_PERIODIC}};
+        // periodicity
+        periodicity<3> pr = {{NON_PERIODIC,NON_PERIODIC,NON_PERIODIC}};
 
-	// Distributed grid with id decomposition
-	grid_dist_id<3, float, aggregate<long int, int>> g_dist(sz,domain,g,pr);
+        // Distributed grid with id decomposition
+        grid_dist_id<3, double, aggregate<long int, int>> g_dist(sz,domain,g,pr);
 
-	auto it = g_dist.getDomainIterator();
+        auto it = g_dist.getDomainIterator();
 
-	size_t count = 0;
+        size_t count = 0;
 
-	while (it.isNext())
-	{
-		auto k = it.get();
+        while (it.isNext())
+        {
+                auto k = it.get();
 
-		++count;
+                ++count;
 
-		++it;
-	}
+                ++it;
+        }
 
-	v_cl.sum(count);
-	v_cl.execute();
+        v_cl.sum(count);
+        v_cl.execute();
 
-	BOOST_REQUIRE_EQUAL(count,32*32*32);
+        BOOST_REQUIRE_EQUAL(count,53*53*10);
 }
 
 
diff --git a/src/scripts/postinst b/src/scripts/postinst
index 4031f0c3a..763d3ed56 100644
--- a/src/scripts/postinst
+++ b/src/scripts/postinst
@@ -1,7 +1,9 @@
 #! /bin/bash
 
-sed -i -e 's/home\/vagrant/usr\/local\/openfpm\/dependencies/g' /usr/local/openfpm/source/openfpm_vars
-sed -i -e 's/home\/vagrant/usr\/local\/openfpm\/dependencies/g' /usr/local/openfpm/openfpm_pdata/include/example.mk
+/projects\/ppm\/rundeck\/openfpm_super_bundles\/$1\/openfpm_dep_$1
+
+sed -i -e 's/projects\/ppm\/rundeck\/openfpm_super_bundles\/$1\/openfpm_dep_$1/usr\/local\/openfpm\/dependencies/g' /usr/local/openfpm/source/openfpm_vars
+sed -i -e 's/projects\/ppm\/rundeck\/openfpm_super_bundles\/$1\/openfpm_dep_$1/usr\/local\/openfpm\/dependencies/g' /usr/local/openfpm/openfpm_pdata/include/example.mk
 echo "export OPAL_PREFIX=/usr/local/openfpm/dependencies/MPI" >> /usr/local/openfpm/source/openfpm_vars
 
 
-- 
GitLab