Commit b9c14fad authored by Pietro Incardona's avatar Pietro Incardona

Adding getMPIComm to vcluster

parents b3cffbf7 b95ab401
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
###### Other
*.vtk
AUTHORS
COPYING
ChangeLog
INSTALL
NEWS
README
Makefile
Makefile.in
config.status
configure
numerics
**/.deps
**/src/config
aclocal.m4
**/autom4te.cache
**/doxygen
vcluster
libvcluster.a
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.6 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<detaileddescription title=""/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>
......@@ -11,11 +11,8 @@ mv /tmp/openfpm_vcluster openfpm_vcluster
mkdir openfpm_vcluster/src/config
git clone ssh://git@ppmcoremirror.dynu.com:2222/incardon/openfpm_devices.git openfpm_devices
git clone ssh://git@ppmcoremirror.dynu.com:2222/incardon/openfpm_data.git openfpm_data
cd openfpm_data
git checkout develop
cd ..
git clone git@ppmcore.mpi-cbg.de:/incardon/openfpm_devices.git openfpm_devices
git clone git@ppmcore.mpi-cbg.de:/incardon/openfpm_data.git openfpm_data
cd "$1/openfpm_vcluster"
......@@ -69,7 +66,7 @@ then
echo "$PATH"
module load gcc/4.8.2
module load boost/1.55.0-gnu4.8
module load openmpi/1.8.7
module load openmpi/1.8.8-gnu
module unload bullxmpi
sh ./autogen.sh
......@@ -77,15 +74,19 @@ then
make
if [ $? -ne 0 ]; then exit 1 ; fi
salloc --nodes=1 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 16 src/vcluster"
salloc --nodes=1 --ntasks-per-node=24 --exclude=taurusi[6300-6400],taurusi[5400-5500] --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 24 src/vcluster --report_level=no"
if [ $? -ne 0 ]; then exit 1 ; fi
salloc --nodes=2 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 32 src/vcluster"
sleep 5
salloc --nodes=2 --ntasks-per-node=24 --exclude=taurusi[6300-6400],taurusi[5400-5500] --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 48 src/vcluster --report_level=no"
if [ $? -ne 0 ]; then exit 1 ; fi
salloc --nodes=4 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 64 src/vcluster"
sleep 5
salloc --nodes=4 --ntasks-per-node=24 --exclude=taurusi[6300-6400],taurusi[5400-5500] --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 96 src/vcluster --report_level=no"
if [ $? -ne 0 ]; then exit 1 ; fi
salloc --nodes=8 --ntasks-per-node=16 --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 128 src/vcluster"
sleep 5
salloc --nodes=8 --ntasks-per-node=24 --exclude=taurusi[6300-6400],taurusi[5400-5500] --time=00:05:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 192 src/vcluster --report_level=no"
if [ $? -ne 0 ]; then exit 1 ; fi
salloc --nodes=16 --ntasks-per-node=16 --time=00:5:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 256 src/vcluster"
sleep 5
salloc --nodes=10 --ntasks-per-node=24 --exclude=taurusi[6300-6400],taurusi[5400-5500] --time=00:5:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np 240 src/vcluster --report_level=no"
if [ $? -ne 0 ]; then exit 1 ; fi
else
......
......@@ -17,7 +17,18 @@ m4_ifdef([AX_BOOST_IOSTREAMS],,[m4_include([m4/ax_boost_iostreams.m4])])
m4_ifdef([AX_BOOST_PROGRAM_OPTIONS],,[m4_include([m4/ax_boost_program_options.m4])])
m4_ifdef([AX_BOOST_UNIT_TEST_FRAMEWORK],,[m4_include([m4/ax_boost_unit_test_framework.m4])])
CXXFLAGS+=" --std=c++11 -march=native -mtune=native -Wno-unused-local-typedefs -Wextra -Wno-unused-parameter "
case $host_os in
*cygwin*)
# Do something specific for cygwin
CXXFLAGS+=" --std=gnu++11 "
;;
*)
#Default Case
CXXFLAGS+=" --std=c++11 "
;;
esac
CXXFLAGS+=" -march=native -mtune=native -Wno-unused-local-typedefs -Wextra -Wno-unused-parameter "
NVCCFLAGS=" "
INCLUDES_PATH=" "
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,7 +16,7 @@
class MPI_IsendWB
{
public:
static inline void send(size_t proc , size_t tag ,void * buf, size_t sz, MPI_Request & req)
static inline void send(size_t proc , size_t tag ,const void * buf, size_t sz, MPI_Request & req)
{
MPI_Isend(buf, sz,MPI_BYTE, proc, tag , MPI_COMM_WORLD,&req);
}
......
......@@ -13,7 +13,7 @@ libvcluster_a_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS)
libvcluster_a_CFLAGS =
nobase_include_HEADERS = MPI_wrapper/MPI_IallreduceW.hpp MPI_wrapper/MPI_IrecvW.hpp MPI_wrapper/MPI_IsendW.hpp MPI_wrapper/MPI_util.hpp MPI_wrapper/MPI_IAllGather.hpp \
Pack_selector.hpp Pack_stat.hpp Packer.hpp Unpacker.hpp VCluster.hpp VCluster_object.hpp VCluster_object_array.hpp VObject.hpp \
VCluster_semantic.ipp VCluster.hpp VCluster_object.hpp \
util/Vcluster_log.hpp
.cu.o :
......
/*
* Pack_selector.hpp
*
* Created on: Jul 15, 2015
* Author: Pietro Incardona
*/
#include <type_traits>
//! Primitive packing
#define PACKER_PRIMITIVE 1
//! Encapsulated Object packing
#define PACKER_ENCAP_OBJECTS 3
//! Vector of objects packing
#define PACKER_VECTOR 4
//! Grid packing
#define PACKER_GRID 5
//! Packer cannot check for pointers
#define PACKER_OBJECTS_WITH_WARNING_POINTERS 6
//! Packer error structure has pointers
#define PACKER_OBJECTS_WITH_POINTER_CHECK 7
#ifndef SRC_PACK_SELECTOR_HPP_
#define SRC_PACK_SELECTOR_HPP_
#define IS_ENCAP 4
#define IS_GRID 2
#define IS_VECTOR 1
/*! \brief Pack selector for unknown type
*
*
*/
template <typename T, bool has_noPointers>
struct Pack_selector_unknown_type_impl
{
enum
{
value = PACKER_OBJECTS_WITH_POINTER_CHECK
};
};
template <typename T>
struct Pack_selector_unknown_type_impl<T,false>
{
enum
{
value = PACKER_OBJECTS_WITH_WARNING_POINTERS
};
};
/*! \brief Pack selector for unknown type
*
*
*/
template <typename T, int known_type>
struct Pack_selector_known_type_impl
{
enum
{
value = Pack_selector_unknown_type_impl<T, has_noPointers<T>::value >::value
};
};
template <typename T>
struct Pack_selector_known_type_impl<T,IS_GRID>
{
enum
{
value = PACKER_GRID
};
};
template <typename T>
struct Pack_selector_known_type_impl<T,IS_VECTOR>
{
enum
{
value = PACKER_VECTOR
};
};
template <typename T>
struct Pack_selector_known_type_impl<T,IS_ENCAP>
{
enum
{
value = PACKER_ENCAP_OBJECTS
};
};
/////////////////////// ---------- CHECKING FOR PRIMITIVES --------------
/*! \brief it is not a fundamental type
*
*/
template<typename T, bool is_foundamental>
struct Pack_selector_impl
{
enum
{
value = Pack_selector_known_type_impl< T, 4*is_encap<T>::value + is_grid<T>::value * 2 + is_vector<T>::value >::value
};
};
/*! \brief Select the primitive packing
*
*/
template<typename T>
struct Pack_selector_impl<T,true>
{
enum
{
value = PACKER_PRIMITIVE
};
};
//////////////////////////////////////////////////////////////////////////
/*! \brief Pack selector
*
*
*/
template <typename T>
struct Pack_selector
{
enum
{
value = Pack_selector_impl< T,std::is_fundamental<T>::value >::value
};
};
#endif /* SRC_PACK_SELECTOR_HPP_ */
/*
* Pack_stat.hpp
*
* Created on: Jul 17, 2015
* Author: i-bird
*/
#ifndef SRC_PACK_STAT_HPP_
#define SRC_PACK_STAT_HPP_
/*! \brief Unpacking status object
*
*
*/
class Unpack_stat
{
size_t cnt;
public:
inline Unpack_stat()
:cnt(0)
{}
/*! \brief Increment the request pointer
*
* \param cnt counter
*
*/
inline void addOffset(size_t off)
{
cnt += off;
}
/*! \brief Return the actual counter
*
*
*/
inline size_t getOffset()
{
return cnt;
}
};
/*! \brief Packing status object
*
*
*/
class Pack_stat
{
size_t p_mark;
size_t un_ele;
public:
inline Pack_stat()
:p_mark(0),un_ele(0)
{}
/*! \brief Increment the request pointer
*
*
*/
inline void incReq()
{
un_ele++;
}
/*! \brief return the actual request for packing
*
* \return the actual request for packing
*
*/
inline size_t reqPack()
{
return un_ele;
}
/*! \brief Mark
*
*
*
*/
inline void mark()
{
p_mark = un_ele;
}
/*! \brief Return the mark
*
* \return the mark
*
*/
inline size_t getMark()
{
return p_mark;
}
/*! \brief Return the memory pointer at the mark place
*
* \tparam T memory object
*
* \return memory pointer at mark place
*
*/
template<typename T> inline void * getMarkPointer(T & mem)
{
return mem.getPointer(p_mark);
}
/*! \brief Get the memory size from the mark point
*
* \tparam T memory object
*
*/
template<typename T> size_t getMarkSize(T & mem)
{
return (char *)mem.getPointer(un_ele) - (char *)mem.getPointer(p_mark);
}
};
#endif /* SRC_PACK_STAT_HPP_ */
This diff is collapsed.
/*
* Packer_unit_tests.hpp
*
* Created on: Jul 15, 2015
* Author: Pietro Incardona
*/
#ifndef SRC_PACKER_UNIT_TESTS_HPP_
#define SRC_PACKER_UNIT_TESTS_HPP_
#include "Pack_selector.hpp"
#include "Packer.hpp"
#include "Unpacker.hpp"
#include "Grid/grid_util_test.hpp"
BOOST_AUTO_TEST_SUITE( packer_unpacker )
BOOST_AUTO_TEST_CASE ( packer_unpacker_test )
{
//! [Pack selector usage]
int val = Pack_selector<unsigned char>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<char>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<short>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<unsigned short>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<int>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<unsigned int>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<long int>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<unsigned long int>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<float>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<double>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_PRIMITIVE);
val = Pack_selector<Point_test<float>>::value;
BOOST_REQUIRE_EQUAL(val,PACKER_OBJECTS_WITH_POINTER_CHECK);
val = Pack_selector< openfpm::vector<Point_test<float>> >::value;
BOOST_REQUIRE_EQUAL(val,PACKER_VECTOR);
val = Pack_selector< grid_cpu<3,Point_test<float>> >::value;
BOOST_REQUIRE_EQUAL(val,PACKER_GRID);
val = Pack_selector< encapc<3,Point_test<float>, memory_traits_lin<Point_test<float>> > >::value;
BOOST_REQUIRE_EQUAL(val,PACKER_ENCAP_OBJECTS);
struct test_s
{
float a;
float b;
static bool noPointers() {return true;}
};
val = Pack_selector< test_s >::value;
BOOST_REQUIRE_EQUAL(val,PACKER_OBJECTS_WITH_POINTER_CHECK);
//! [Pack selector usage]
{
//! [Pack into a message primitives objects vectors and grids]
typedef Point_test<float> pt;
// Create all the objects we want to pack
unsigned char uc = 1;
char c = 2;
short s = 3;
unsigned short us = 4;
int i = 5;
unsigned int ui = 6;
long int li = 7;
unsigned long int uli = 8;
float f = 9;
double d = 10;
openfpm::vector<Point_test<float>> v = allocate_openfpm(1024);
Point_test<float> p;
p.fill();
size_t sz[] = {16,16,16};
grid_cpu<3,Point_test<float>> g(sz);
g.setMemory();
fill_grid<3>(g);
grid_key_dx_iterator_sub<3> sub(g.getGrid(),{1,2,3},{5,6,7});
// Here we start to push all the allocations required to pack all the data
std::vector<size_t> pap_prp;
Packer<unsigned char,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(unsigned char));
Packer<char,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(char));
Packer<short,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(short));
Packer<unsigned short,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(unsigned short));
Packer<int,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(int));
Packer<unsigned int,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(unsigned int));
Packer<long int,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(long int));
Packer<long unsigned int,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(long unsigned int));
Packer<float,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(float));
Packer<double,HeapMemory>::packRequest(pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],sizeof(double));
Packer<Point_test<float>,HeapMemory>::packRequest(pap_prp);
Packer<openfpm::vector<Point_test<float>>,HeapMemory>::packRequest<pt::x,pt::v>(v,pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],(sizeof(float) + sizeof(float[3])) * v.size());
Packer<grid_cpu<3,Point_test<float>>,HeapMemory>::packRequest<pt::x,pt::v>(g,sub,pap_prp);
BOOST_REQUIRE_EQUAL(pap_prp[pap_prp.size()-1],(sizeof(float) + sizeof(float[3])) * sub.getVolume());
// Calculate how much preallocated memory we need to pack all the objects
size_t req = ExtPreAlloc<HeapMemory>::calculateMem(pap_prp);
// allocate the memory
HeapMemory pmem;
pmem.allocate(req);
ExtPreAlloc<HeapMemory> & mem = *(new ExtPreAlloc<HeapMemory>(pap_prp,pmem));
mem.incRef();
Pack_stat sts;
// try to pack