Commit 15fff60f authored by incardon's avatar incardon

Windows native conversion

parent 35af0cc8
Pipeline #3007 failed with stages
in 2 minutes and 50 seconds
......@@ -125,6 +125,11 @@ target_link_libraries(vcluster_test ofpmmemory)
target_link_libraries(vcluster_dl ${PETSC_LIBRARIES})
target_link_libraries(vcluster ${PETSC_LIBRARIES})
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
target_link_libraries(vcluster_dl ofpmmemory)
target_link_libraries(vcluster ofpmmemory)
endif()
if (TEST_COVERAGE)
target_link_libraries(vcluster_test -lgcov)
endif()
......
......@@ -134,7 +134,7 @@ template<> class MPI_IAllGatherW<size_t>
public:
static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
{
MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_UNSIGNED_LONG, rbuf, sz_r, MPI_UNSIGNED_LONG, MPI_COMM_WORLD,&req));
MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_UINT64_T, rbuf, sz_r, MPI_UINT64_T, MPI_COMM_WORLD,&req));
}
};
......
......@@ -27,6 +27,19 @@ public:
}
};
/*! \brief specialization for long unsinged integer
*
*/
template<> class MPI_IallreduceW<long unsigned int>
{
public:
static inline void reduce(long unsigned int & buf,MPI_Op op, MPI_Request & req)
{
MPI_SAFE_CALL(MPI_Iallreduce(MPI_IN_PLACE, &buf, 1,MPI_UNSIGNED_LONG, op, MPI_COMM_WORLD,&req));
}
};
/*! \brief specialization for integer
*
......@@ -108,7 +121,7 @@ template<> class MPI_IallreduceW<size_t>
public:
static inline void reduce(size_t & buf,MPI_Op op, MPI_Request & req)
{
MPI_SAFE_CALL(MPI_Iallreduce(MPI_IN_PLACE, &buf, 1,MPI_UNSIGNED_LONG, op, MPI_COMM_WORLD,&req));
MPI_SAFE_CALL(MPI_Iallreduce(MPI_IN_PLACE, &buf, 1,MPI_UNSIGNED_LONG_LONG, op, MPI_COMM_WORLD,&req));
}
};
......
#define PRINT_STACKTRACE
#include "VCluster.hpp"
#ifndef __CYGWIN__
#if !defined(__CYGWIN__) && !defined(WIN64)
#include <execinfo.h>
#endif
......@@ -53,6 +53,8 @@ CudaMemory exp_tmp2[MAX_NUMER_OF_PROPERTIES];
#endif
#ifndef WIN64
// Segmentation fault signal handler
void bt_sighandler(int sig, siginfo_t * info, void * ctx_p)
{
......@@ -66,6 +68,8 @@ void bt_sighandler(int sig, siginfo_t * info, void * ctx_p)
exit(0);
}
#endif
double time_spent = 0.0;
......@@ -102,6 +106,8 @@ void openfpm_init_vcl(int *argc, char ***argv)
// install segmentation fault signal handler
#ifndef WIN64
struct sigaction sa;
sa.sa_sigaction = bt_sighandler;
......@@ -110,6 +116,8 @@ void openfpm_init_vcl(int *argc, char ***argv)
sigaction(SIGSEGV, &sa, NULL);
#endif
if (argc != NULL && *argc != 0)
{program_name = std::string(*argv[0]);}
......
......@@ -32,8 +32,12 @@ extern CudaMemory rem_tmp2[MAX_NUMER_OF_PROPERTIES];
extern size_t NBX_cnt;
#ifndef WIN64
void bt_sighandler(int sig, siginfo_t * info, void * ctx);
#endif
/*! \brief Implementation of VCluster class
*
* This class implement communication functions. Like summation, minimum and maximum across
......
#define PRINT_STACKTRACE
#include "VCluster.hpp"
#ifndef __CYGWIN__
#if !defined(__CYGWIN__) && !defined(WIN64)
#include <execinfo.h>
#endif
......@@ -53,6 +53,8 @@ CudaMemory exp_tmp2[MAX_NUMER_OF_PROPERTIES];
#endif
#ifndef WIN64
// Segmentation fault signal handler
void bt_sighandler(int sig, siginfo_t * info, void * ctx_p)
{
......@@ -66,6 +68,8 @@ void bt_sighandler(int sig, siginfo_t * info, void * ctx_p)
exit(0);
}
#endif
double time_spent = 0.0;
......@@ -102,6 +106,8 @@ void openfpm_init_vcl(int *argc, char ***argv)
// install segmentation fault signal handler
#ifndef WIN64
struct sigaction sa;
sa.sa_sigaction = bt_sighandler;
......@@ -110,6 +116,8 @@ void openfpm_init_vcl(int *argc, char ***argv)
sigaction(SIGSEGV, &sa, NULL);
#endif
if (argc != NULL && *argc != 0)
{program_name = std::string(*argv[0]);}
......
......@@ -127,6 +127,10 @@ void * msg_alloc4(size_t msg_i ,size_t total_msg, size_t total_p, size_t i, size
return &(v->recv_message->last().get(0));
}
#ifdef WIN64
static void usleep(int us) {};
#endif
template<unsigned int ip, typename T> void commFunc(Vcluster<> & vcl,openfpm::vector< size_t > & prc, openfpm::vector< T > & data, void * (* msg_alloc)(size_t,size_t,size_t,size_t,size_t,size_t,void *), void * ptr_arg)
{
if (ip == NBX)
......@@ -143,7 +147,6 @@ template<unsigned int ip, typename T> void commFunc(Vcluster<> & vcl,openfpm::ve
usleep(1000);
vcl.progressCommunication();
usleep(1000);
vcl.sendrecvMultipleMessagesNBXWait();
}
}
......
......@@ -95,11 +95,14 @@ BOOST_AUTO_TEST_CASE( VCluster_use_reductions)
//! [max min sum]
if ( vcl.getProcessingUnits() < 128 )
{BOOST_REQUIRE_EQUAL(c_max,(char)vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(c_max,(char)vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(c,(char)vcl.getProcessingUnits());}
if ( vcl.getProcessingUnits() < 256 )
{BOOST_REQUIRE_EQUAL(uc_max,(unsigned char)vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(uc_max,(unsigned char)vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(uc,(unsigned char)vcl.getProcessingUnits());}
if ( vcl.getProcessingUnits() < 32768 )
{BOOST_REQUIRE_EQUAL(s_max,(short int) vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(s_max,(short int) vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(s,(short int) vcl.getProcessingUnits());}
if ( vcl.getProcessingUnits() < 65536 )
{BOOST_REQUIRE_EQUAL(us_max,(unsigned short)vcl.getProcessingUnits()-1);}
if ( vcl.getProcessingUnits() < 2147483648 )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment