From 5218dbe95705bdabb596e20c0d0e76830489c7c0 Mon Sep 17 00:00:00 2001 From: Yaroslav <beorn.90@gmail.com> Date: Tue, 10 Jan 2017 11:43:32 +0100 Subject: [PATCH] Update modules --- openfpm_data | 2 +- openfpm_vcluster | 2 +- src/Grid/grid_dist_id.hpp | 46 +++++++++---------- ...grid_dist_id_HDF5_chckpnt_restart_test.hpp | 16 +++---- src/Grid/grid_dist_id_comm.hpp | 26 +++++------ src/Vector/vector_dist.hpp | 26 +++++------ .../vector_dist_HDF5_chckpnt_restart_test.hpp | 2 +- 7 files changed, 59 insertions(+), 61 deletions(-) diff --git a/openfpm_data b/openfpm_data index e62e281df..313e8ad01 160000 --- a/openfpm_data +++ b/openfpm_data @@ -1 +1 @@ -Subproject commit e62e281df21687cfa081d4ac9460a8abf4636ec0 +Subproject commit 313e8ad016ffe36da70d1f327dd71f90f646a580 diff --git a/openfpm_vcluster b/openfpm_vcluster index 9d0986ae4..69e896667 160000 --- a/openfpm_vcluster +++ b/openfpm_vcluster @@ -1 +1 @@ -Subproject commit 9d0986ae448b22ada91ddcbb789ed58e270d4218 +Subproject commit 69e896667ab6d9f6027cd2fefd99ccdaa6f34206 diff --git a/src/Grid/grid_dist_id.hpp b/src/Grid/grid_dist_id.hpp index e2147bd3e..37a09c5a2 100644 --- a/src/Grid/grid_dist_id.hpp +++ b/src/Grid/grid_dist_id.hpp @@ -1731,8 +1731,8 @@ public: inline void save(const std::string & filename) const { - std::cout << "Loc_grid.size() before save: " << loc_grid.size() << std::endl; - std::cout << "Gdb_ext.size() before save: " << gdb_ext.size() << std::endl; + //std::cout << "Loc_grid.size() before save: " << loc_grid.size() << std::endl; + //std::cout << "Gdb_ext.size() before save: " << gdb_ext.size() << std::endl; //Pack_request vector size_t req = 0; @@ -1741,7 +1741,7 @@ public: Packer<decltype(loc_grid),HeapMemory>::packRequest(loc_grid,req); Packer<decltype(gdb_ext),HeapMemory>::packRequest(gdb_ext,req); - std::cout << "Req: " << req << std::endl; + //std::cout << "Req: " << req << std::endl; // allocate the memory HeapMemory pmem; @@ -1778,7 +1778,7 @@ public: H5Pclose(plist_id); size_t sz = pmem.size(); - std::cout << "Pmem.size: " << pmem.size() << std::endl; + //std::cout << "Pmem.size: " << pmem.size() << std::endl; openfpm::vector<size_t> sz_others; v_cl.allGather(sz,sz_others); v_cl.execute(); @@ -1806,8 +1806,8 @@ public: //Create data space in memory hid_t mem_dataspace_id = H5Screate_simple(1, mdim, NULL); - if (mpi_rank == 0) - std::cout << "Total object size: " << sum << std::endl; + //if (mpi_rank == 0) + //std::cout << "Total object size: " << sum << std::endl; //Create data set in file hid_t file_dataset = H5Dcreate (file, "grid_dist", H5T_NATIVE_CHAR, file_dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -1835,7 +1835,7 @@ public: offset[0] += sz_others.get(i); } - std::cout << "MPI rank: " << mpi_rank << ", MPI size: " << mpi_size << ", Offset: " << offset[0] << ", Block: " << block[0] << std::endl; + // std::cout << "MPI rank: " << mpi_rank << ", MPI size: " << mpi_size << ", Offset: " << offset[0] << ", Block: " << block[0] << std::endl; int metadata[mpi_size]; @@ -1858,7 +1858,7 @@ public: //Write a data set 2 to a file H5Dwrite(file_dataset_2, H5T_NATIVE_INT, H5S_ALL, file_dataspace_id_2, plist_id, metadata); - +/* for (size_t i = 0; i < gdb_ext.size(); i++) { Box<dim,long int> box = gdb_ext.get(i).Dbox; @@ -1869,7 +1869,7 @@ public: { std::cout << "loc_grids saved: (" << loc_grid.get(i).getGrid().getBox().getLow(0) << "; " << loc_grid.get(i).getGrid().getBox().getLow(1) << "); (" << loc_grid.get(i).getGrid().getBox().getHigh(0) << "; " << loc_grid.get(i).getGrid().getBox().getHigh(1) << ")" << std::endl; } - +*/ //Close/release resources. H5Dclose(file_dataset); H5Sclose(file_dataspace_id); @@ -1907,7 +1907,7 @@ public: } }*/ - std::cout << "BID: " << bid << std::endl; +// std::cout << "BID: " << bid << std::endl; hsize_t offset[1]; hsize_t block[1]; @@ -1923,7 +1923,7 @@ public: block[0] = 0; } - std::cout << "Offset: " << offset[0] << "; Block: " << block[0]<< std::endl; +// std::cout << "Offset: " << offset[0] << "; Block: " << block[0]<< std::endl; // hsize_t offset_add[1] = {0}; /* if (mpi_size >= mpi_size_old) @@ -2000,14 +2000,14 @@ public: // hid_t mem_dataspace_id_3 = H5Screate_simple(1, mdim_3, NULL); //if (mpi_rank == 0) - { + /* { hssize_t size2; size2 = H5Sget_select_npoints (mem_dataspace_id_2); printf ("\nLOAD: memspace_id_2 size: %llu\n", size2); size2 = H5Sget_select_npoints (file_dataspace_id_2); printf ("LOAD: dataspace_id_2 size: %llu\n", size2); - } + }*/ /* if (mpi_rank == 0) { @@ -2026,7 +2026,7 @@ public: sum += metadata_out[i]; } - std::cout << "LOAD: sum: " << sum << std::endl; + // std::cout << "LOAD: sum: " << sum << std::endl; // allocate the memory HeapMemory pmem; @@ -2045,7 +2045,7 @@ public: mem.allocate(pmem.size()); // mem2.allocate(pmem2.size()); - std::cout << "Mem.size(): " << mem.size() << " = " << block[0] << std::endl; + // std::cout << "Mem.size(): " << mem.size() << " = " << block[0] << std::endl; Unpack_stat ps; @@ -2171,11 +2171,11 @@ public: size_t rest_block = mpi_size_old % v_cl.getProcessingUnits(); - std::cout << "MPI size old: " << mpi_size_old << std::endl; - std::cout << "MPI size: " << v_cl.getProcessingUnits() << std::endl; + // std::cout << "MPI size old: " << mpi_size_old << std::endl; + //std::cout << "MPI size: " << v_cl.getProcessingUnits() << std::endl; - std::cout << "Rest block: " << rest_block << std::endl; + // std::cout << "Rest block: " << rest_block << std::endl; size_t max_block; @@ -2189,8 +2189,8 @@ public: n_block.get(i) += 1; - for(size_t i = 0 ; i < n_block.size() ; i++) - std::cout << "n_block.get(i): " << n_block.get(i) << std::endl; + //for(size_t i = 0 ; i < n_block.size() ; i++) + //std::cout << "n_block.get(i): " << n_block.get(i) << std::endl; size_t start_block = 0; size_t stop_block = 0; @@ -2204,7 +2204,7 @@ public: stop_block = start_block + n_block.get(v_cl.getProcessUnitID()); - std::cout << "ID: " << v_cl.getProcessUnitID() << "; Start block: " << start_block << "; " << "Stop block: " << stop_block << std::endl; +// std::cout << "ID: " << v_cl.getProcessUnitID() << "; Start block: " << start_block << "; " << "Stop block: " << stop_block << std::endl; if (mpi_rank >= mpi_size_old) load_block(start_block,mpi_size_old,metadata_out,metadata_accum,plist_id,dataset_2); @@ -2232,11 +2232,11 @@ public: // Map the distributed grid map(); - +/* for (size_t i = 0; i < loc_grid.size(); i++) { std::cout << "loc_grids loaded: (" << loc_grid.get(i).getGrid().getBox().getLow(0) << "; " << loc_grid.get(i).getGrid().getBox().getLow(1) << "); (" << loc_grid.get(i).getGrid().getBox().getHigh(0) << "; " << loc_grid.get(i).getGrid().getBox().getHigh(1) << ")" << std::endl; - } + }*/ } //! Define friend classes diff --git a/src/Grid/grid_dist_id_HDF5_chckpnt_restart_test.hpp b/src/Grid/grid_dist_id_HDF5_chckpnt_restart_test.hpp index 2bf3fda54..cfb08eee5 100644 --- a/src/Grid/grid_dist_id_HDF5_chckpnt_restart_test.hpp +++ b/src/Grid/grid_dist_id_HDF5_chckpnt_restart_test.hpp @@ -16,12 +16,12 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_save_test ) { // Input data - size_t k = 1000; + size_t k = 2400; float ghost_part = 0.0; // Domain - Box<2,float> domain({-1.0,-1.0},{1.0,1.0}); + Box<2,float> domain({0.0,0.0},{1.0,1.0}); Vcluster & v_cl = create_vcluster(); @@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_save_test ) Ghost<2,float> g(ghost_part); // Distributed grid with id decomposition - grid_dist_id<2, float, scalar<float[2]>, CartDecomposition<2,float>> g_dist(sz,domain,g); + grid_dist_id<2, float, scalar<float>, CartDecomposition<2,float>> g_dist(sz,domain,g); // get the decomposition auto & dec = g_dist.getDecomposition(); @@ -61,8 +61,7 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_save_test ) auto keyg = g_dist.getGKey(key); - g_dist.template get<0>(key)[0] = keyg.get(0); - g_dist.template get<0>(key)[1] = keyg.get(1); + g_dist.template get<0>(key) = keyg.get(0); ++it; count++; @@ -94,7 +93,7 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_load_test ) { // Input data - size_t k = 1000; + size_t k = 2400; float ghost_part = 0.0; @@ -119,7 +118,7 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_load_test ) Ghost<2,float> g(ghost_part); // Distributed grid with id decomposition - grid_dist_id<2, float, scalar<float[2]>, CartDecomposition<2,float>> g_dist(sz,domain,g); + grid_dist_id<2, float, scalar<float>, CartDecomposition<2,float>> g_dist(sz,domain,g); g_dist.getDecomposition().write("Before_load_grid_decomposition"); g_dist.write("Before_Loaded_grid"); @@ -149,8 +148,7 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_hdf5_load_test ) auto keyg = g_dist.getGKey(key); - BOOST_REQUIRE_EQUAL(g_dist.template get<0>(key)[0], keyg.get(0)); - BOOST_REQUIRE_EQUAL(g_dist.template get<0>(key)[1], keyg.get(1)); + BOOST_REQUIRE_EQUAL(g_dist.template get<0>(key), keyg.get(0)); ++it; count++; diff --git a/src/Grid/grid_dist_id_comm.hpp b/src/Grid/grid_dist_id_comm.hpp index d1863a87e..b861fcaa8 100644 --- a/src/Grid/grid_dist_id_comm.hpp +++ b/src/Grid/grid_dist_id_comm.hpp @@ -82,7 +82,7 @@ public: //device_grid gr_send(sz); //gr_send.setMemory(); - std::cout << "B: (" << b.getLow(0) << "; " << b.getLow(1) << "); (" << b.getHigh(0) << "; " << b.getHigh(1) << "); " << "G: (" << g.getGrid().getBox().getHigh(0) << "; " << g.getGrid().getBox().getHigh(1) << ")" << std::endl; + //std::cout << "B: (" << b.getLow(0) << "; " << b.getLow(1) << "); (" << b.getHigh(0) << "; " << b.getHigh(1) << "); " << "G: (" << g.getGrid().getBox().getHigh(0) << "; " << g.getGrid().getBox().getHigh(1) << ")" << std::endl; // Set the dimensions of the local grid //g.resize(l_res); @@ -130,7 +130,7 @@ public: } } } - std::cout << "Count after: " << count2 << std::endl; + //std::cout << "Count after: " << count2 << std::endl; } @@ -185,7 +185,7 @@ public: count2++; ////////////// - std::cout << "Inte_box: (" << inte_box.getLow(0) << "; " << inte_box.getLow(1) << "); (" << inte_box.getHigh(0) << "; " << inte_box.getHigh(1) << ")" << std::endl; + //std::cout << "Inte_box: (" << inte_box.getLow(0) << "; " << inte_box.getLow(1) << "); (" << inte_box.getHigh(0) << "; " << inte_box.getHigh(1) << ")" << std::endl; auto inte_box_cont = cd_sm.convertCellUnitsIntoDomainSpace(inte_box); @@ -199,23 +199,23 @@ public: p_id = dec.processorID(p); prc_sz.get(p_id)++; - std::cout << "P_id: " << p_id << std::endl; + //std::cout << "P_id: " << p_id << std::endl; // Transform coordinates to local auto inte_box_local = inte_box; inte_box_local -= gdb_ext_old.get(i).origin; - std::cout << "gdb_ext_old.get(i): (" << sub_dom.getLow(0) << "; " << sub_dom.getLow(1) << "); (" << sub_dom.getHigh(0) << "; " << sub_dom.getHigh(1) << ")" << std::endl; + //std::cout << "gdb_ext_old.get(i): (" << sub_dom.getLow(0) << "; " << sub_dom.getLow(1) << "); (" << sub_dom.getHigh(0) << "; " << sub_dom.getHigh(1) << ")" << std::endl; - std::cout << "gdb_ext_global.get(j): (" << sub_dom_new.getLow(0) << "; " << sub_dom_new.getLow(1) << "); (" << sub_dom_new.getHigh(0) << "; " << sub_dom_new.getHigh(1) << ")" << std::endl; + //std::cout << "gdb_ext_global.get(j): (" << sub_dom_new.getLow(0) << "; " << sub_dom_new.getLow(1) << "); (" << sub_dom_new.getHigh(0) << "; " << sub_dom_new.getHigh(1) << ")" << std::endl; - std::cout << "Inte_box_local: (" << inte_box_local.getLow(0) << "; " << inte_box_local.getLow(1) << "); (" << inte_box_local.getHigh(0) << "; " << inte_box_local.getHigh(1) << ")" << std::endl; + //std::cout << "Inte_box_local: (" << inte_box_local.getLow(0) << "; " << inte_box_local.getLow(1) << "); (" << inte_box_local.getHigh(0) << "; " << inte_box_local.getHigh(1) << ")" << std::endl; // Grid corresponding for gdb_ext_old.get(i) box device_grid & gr = loc_grid_old.get(i); - std::cout << "loc_grid_old.get(i): (" << gr.getGrid().getBox().getLow(0) << "; " << gr.getGrid().getBox().getLow(1) << "); (" << gr.getGrid().getBox().getHigh(0) << "; " << gr.getGrid().getBox().getHigh(1) << ")" << std::endl; + //std::cout << "loc_grid_old.get(i): (" << gr.getGrid().getBox().getLow(0) << "; " << gr.getGrid().getBox().getLow(1) << "); (" << gr.getGrid().getBox().getHigh(0) << "; " << gr.getGrid().getBox().getHigh(1) << ")" << std::endl; //for (size_t l = 0; l < dim; l++) //std::cout << "loc_grid_old.get(i).size on " << l << " dimension: " << gr.getGrid().size(l) << std::endl; @@ -263,7 +263,7 @@ public: std::string start2 = start.to_string(); std::string stop2 = stop.to_string(); - std::cout << "Start: " << start2 << "; Stop: " << stop2 << std::endl; + //std::cout << "Start: " << start2 << "; Stop: " << stop2 << std::endl; auto it = gr.getSubIterator(start,stop); @@ -304,8 +304,8 @@ public: } } } - std::cout << "Count for points: " << count << std::endl; - std::cout << "Count for inte_boxes: " << count2 << std::endl; + //std::cout << "Count for points: " << count << std::endl; + //std::cout << "Count for inte_boxes: " << count2 << std::endl; } /*! \brief Moves all the grids that does not belong to the local processor to the respective processor @@ -386,9 +386,9 @@ public: // Vector for receiving of intersection grids openfpm::vector<openfpm::vector<aggregate<device_grid,SpaceBox<dim,long int>>>> m_oGrid_recv; - std::cout << "vcl.getProcessUnitID(): " << v_cl.getProcessUnitID() << "; prc_r.size(): " << prc_r.size() << std::endl; + //std::cout << "vcl.getProcessUnitID(): " << v_cl.getProcessUnitID() << "; prc_r.size(): " << prc_r.size() << std::endl; - std::cout << "vcl.getProcessUnitID(): " << v_cl.getProcessUnitID() << "; m_oGrid_new.size(): " << m_oGrid_new.size() << std::endl; + //std::cout << "vcl.getProcessUnitID(): " << v_cl.getProcessUnitID() << "; m_oGrid_new.size(): " << m_oGrid_new.size() << std::endl; /* for (size_t i = 0; i < m_oGrid.size(); i++) { diff --git a/src/Vector/vector_dist.hpp b/src/Vector/vector_dist.hpp index 922becc6f..11b2554eb 100644 --- a/src/Vector/vector_dist.hpp +++ b/src/Vector/vector_dist.hpp @@ -1143,7 +1143,7 @@ public: } }*/ - std::cout << "BID: " << bid << std::endl; +// std::cout << "BID: " << bid << std::endl; hsize_t offset[1]; hsize_t block[1]; @@ -1159,7 +1159,7 @@ public: block[0] = 0; } - std::cout << "Offset: " << offset[0] << "; Block: " << block[0]<< std::endl; +// std::cout << "Offset: " << offset[0] << "; Block: " << block[0]<< std::endl; // hsize_t offset_add[1] = {0}; /* if (mpi_size >= mpi_size_old) @@ -1236,14 +1236,14 @@ public: // hid_t mem_dataspace_id_3 = H5Screate_simple(1, mdim_3, NULL); //if (mpi_rank == 0) - { +/* { hssize_t size2; size2 = H5Sget_select_npoints (mem_dataspace_id_2); printf ("\nLOAD: memspace_id_2 size: %llu\n", size2); size2 = H5Sget_select_npoints (file_dataspace_id_2); printf ("LOAD: dataspace_id_2 size: %llu\n", size2); - } + }*/ /* if (mpi_rank == 0) { @@ -1262,7 +1262,7 @@ public: sum += metadata_out[i]; } - std::cout << "LOAD: sum: " << sum << std::endl; +// std::cout << "LOAD: sum: " << sum << std::endl; // allocate the memory HeapMemory pmem; @@ -1281,7 +1281,7 @@ public: mem.allocate(pmem.size()); // mem2.allocate(pmem2.size()); - std::cout << "Mem.size(): " << mem.size() << " = " << block[0] << std::endl; +// std::cout << "Mem.size(): " << mem.size() << " = " << block[0] << std::endl; Unpack_stat ps; @@ -1420,11 +1420,11 @@ public: size_t rest_block = mpi_size_old % v_cl.getProcessingUnits(); - std::cout << "MPI size old: " << mpi_size_old << std::endl; - std::cout << "MPI size: " << v_cl.getProcessingUnits() << std::endl; + //std::cout << "MPI size old: " << mpi_size_old << std::endl; + //std::cout << "MPI size: " << v_cl.getProcessingUnits() << std::endl; - std::cout << "Rest block: " << rest_block << std::endl; + // std::cout << "Rest block: " << rest_block << std::endl; size_t max_block; @@ -1438,8 +1438,8 @@ public: n_block.get(i) += 1; - for(size_t i = 0 ; i < n_block.size() ; i++) - std::cout << "n_block.get(i): " << n_block.get(i) << std::endl; + //for(size_t i = 0 ; i < n_block.size() ; i++) + //std::cout << "n_block.get(i): " << n_block.get(i) << std::endl; size_t start_block = 0; size_t stop_block = 0; @@ -1453,7 +1453,7 @@ public: stop_block = start_block + n_block.get(v_cl.getProcessUnitID()); - std::cout << "ID: " << v_cl.getProcessUnitID() << "; Start block: " << start_block << "; " << "Stop block: " << stop_block << std::endl; + //std::cout << "ID: " << v_cl.getProcessUnitID() << "; Start block: " << start_block << "; " << "Stop block: " << stop_block << std::endl; if (mpi_rank >= mpi_size_old) load_block(start_block,mpi_size_old,metadata_out,metadata_accum,plist_id,dataset_2); @@ -1478,7 +1478,7 @@ public: //std::cout << "V_pos.size() after merge: " << v_pos.size() << std::endl; // Map particles - map(); + //map(); //std::cout << "V_pos.size() after merge and map: " << v_pos.size() << std::endl; } diff --git a/src/Vector/vector_dist_HDF5_chckpnt_restart_test.hpp b/src/Vector/vector_dist_HDF5_chckpnt_restart_test.hpp index b166fb2b8..124728167 100644 --- a/src/Vector/vector_dist_HDF5_chckpnt_restart_test.hpp +++ b/src/Vector/vector_dist_HDF5_chckpnt_restart_test.hpp @@ -22,7 +22,7 @@ BOOST_AUTO_TEST_SUITE( vd_hdf5_chckpnt_rstrt_test ) // Input data // Number of particles -size_t k = 1000; +size_t k = 1000000; // Dimensionality const size_t dim = 3; -- GitLab