Commit 3522135e authored by Pietro Incardona's avatar Pietro Incardona

Fixing generation of documentation

parent 46c6cf1a
# 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
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);
}
......
This diff is collapsed.
......@@ -37,7 +37,7 @@ public:
* \return the size of the array
*
*/
size_t size()
size_t size() const
{
return objects.size();
}
......@@ -172,6 +172,16 @@ public:
return objects[j];
}
/*! \brief Return the object j in the array
*
* \param j element j
*
*/
const T & operator[](size_t j) const
{
return objects[j];
}
/*! \brief Resize the array
*
* \param size
......
......@@ -43,7 +43,7 @@ void * msg_alloc(size_t msg_i ,size_t total_msg, size_t total_p, size_t i,size_t
if (global_v_cluster->getProcessingUnits() <= 8)
{if (totp_check) BOOST_REQUIRE_EQUAL(total_p,global_v_cluster->getProcessingUnits()-1);}
else
{if (totp_check) BOOST_REQUIRE_EQUAL(total_p,8);}
{if (totp_check) BOOST_REQUIRE_EQUAL(total_p,(size_t)8);}
BOOST_REQUIRE_EQUAL(msg_i, global_step);
v->get(i).resize(msg_i);
......@@ -221,7 +221,7 @@ template<unsigned int ip> void test_no_send_some_peer()
}
else
{
BOOST_REQUIRE_EQUAL(0,recv_message.get(p_id).size());
BOOST_REQUIRE_EQUAL((size_t)0,recv_message.get(p_id).size());
}
}
}
......@@ -320,7 +320,7 @@ template<unsigned int ip> void test()
}
else
{
BOOST_REQUIRE_EQUAL(0,recv_message.get(p_id).size());
BOOST_REQUIRE_EQUAL((size_t)0,recv_message.get(p_id).size());
}
}
}
......@@ -532,7 +532,7 @@ template<unsigned int ip> void test()
}
else
{
BOOST_REQUIRE_EQUAL(0,recv_message.get(p_id).size());
BOOST_REQUIRE_EQUAL((size_t)0,recv_message.get(p_id).size());
}
}
}
......@@ -547,6 +547,8 @@ template<unsigned int ip> void test()
*/
void test_send_recv_complex(const size_t n, Vcluster & vcl)
{
//! [Send and receive vectors of complex]
// Point test typedef
typedef Point_test<float> p;
......@@ -568,6 +570,8 @@ void test_send_recv_complex(const size_t n, Vcluster & vcl)
vcl.execute();
//! [Send and receive vectors of complex]
// Check the received buffers (careful at negative modulo)
for (size_t i = 0 ; i < 8 ; i++)
{
......@@ -609,7 +613,7 @@ template<typename T> void test_send_recv_primitives(size_t n, Vcluster & vcl)
openfpm::vector<T> v_send = allocate_openfpm_primitive<T>(n,vcl.getProcessUnitID());
{
//! [ Send and receive vectors data ]
//! [Sending and receiving primitives]
// Send to 8 processors
for (size_t i = 0 ; i < 8 ; i++)
......@@ -627,6 +631,8 @@ template<typename T> void test_send_recv_primitives(size_t n, Vcluster & vcl)
vcl.execute();
//! [Sending and receiving primitives]
// Check the received buffers (careful at negative modulo)
for (size_t i = 0 ; i < 8 ; i++)
{
......@@ -640,12 +646,10 @@ template<typename T> void test_send_recv_primitives(size_t n, Vcluster & vcl)
}
}
//! [ Send and receive vectors data ]
}
{
//! [ Send and receive plain buffer data ]
//! [Send and receive plain buffer data]
// Send to 8 processors
for (size_t i = 0 ; i < 8 ; i++)
......@@ -663,6 +667,8 @@ template<typename T> void test_send_recv_primitives(size_t n, Vcluster & vcl)
vcl.execute();
//! [Send and receive plain buffer data]
// Check the received buffers (careful at negative modulo)
for (size_t i = 0 ; i < 8 ; i++)
{
......@@ -676,7 +682,6 @@ template<typename T> void test_send_recv_primitives(size_t n, Vcluster & vcl)
}
}
//! [ Send and receive plain buffer data ]
}
}
......@@ -691,7 +696,7 @@ template<typename T> void test_single_all_gather_primitives(Vcluster & vcl)
vcl.execute();
for (size_t i = 0 ; i < vcl.getProcessingUnits() ; i++)
BOOST_REQUIRE_EQUAL(i,clt.get(i));
BOOST_REQUIRE_EQUAL(i,(size_t)clt.get(i));
//! [allGather numbers]
......
......@@ -89,22 +89,22 @@ BOOST_AUTO_TEST_CASE( VCluster_use_reductions)
vcl.execute();
if ( vcl.getProcessingUnits() < 128 )
{BOOST_REQUIRE_EQUAL(c_max,vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(c_max,(char)vcl.getProcessingUnits()-1);}
if ( vcl.getProcessingUnits() < 256 )
{BOOST_REQUIRE_EQUAL(uc_max,vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(uc_max,(unsigned char)vcl.getProcessingUnits()-1);}
if ( vcl.getProcessingUnits() < 32768 )
{BOOST_REQUIRE_EQUAL(s_max,vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(s_max,(short int) vcl.getProcessingUnits()-1);}
if ( vcl.getProcessingUnits() < 65536 )
{BOOST_REQUIRE_EQUAL(us_max,vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(us_max,(unsigned short)vcl.getProcessingUnits()-1);}
if ( vcl.getProcessingUnits() < 2147483648 )
{BOOST_REQUIRE_EQUAL(i_max,vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(i_max,(int)vcl.getProcessingUnits()-1);}
if ( vcl.getProcessingUnits() < 4294967296 )
{BOOST_REQUIRE_EQUAL(ui_max,vcl.getProcessingUnits()-1);}
{BOOST_REQUIRE_EQUAL(ui_max,(unsigned int)vcl.getProcessingUnits()-1);}
BOOST_REQUIRE_EQUAL(li_max,vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(uli_max,vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(f_max,vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(d_max,vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(li_max,(long int)vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(uli_max,(unsigned long int)vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(f_max,(float)vcl.getProcessingUnits()-1);
BOOST_REQUIRE_EQUAL(d_max,(double)vcl.getProcessingUnits()-1);
}
#define N_V_ELEMENTS 16
......
#include "ComUnit.hpp"
#define SERVICE_TAG 0xFFFFFFF
/*! \brief Send some data globally to one processor when the other side
* do not know about the other side
*
* Send some data globally to one processor when the other side
* do not know about the other side
*
* \Warning if you already call this function with p, will overwrite the request
*
* \param p is the processor number
* \param buf is the buffer pointer
* \param sz is the size of the communication
*
*/
bool SentToU(size_t p, void * buf,size_t sz)
{
// before complete the communication we have to notify to the other
// processor that we have some data to send.
if (p >= comReq.size())
{
std::cerr << "Error: file: " << __FILE__ << " line: " << __LINE__ << " processor " << p << " does not exist";
return false;
}
return true;
}
/*! \brief Send some data locally (to its neighborhood) to one processor
*
* Send some data locally to one processor
*
*/
bool SendToNU(void * buf, size_t sz)
{
return true;
}
/*! \brief Send some data globally to one processor when the other side
* know about the other side
*
* Send some data globally to one processor when the other side
* know about the other side
*
* \Warning if you already call this function with p, will overwrite the request
*
* \param p is the processor number
* \param buf is the buffer pointer
* \param sz is the size of the communication
*
*/
bool SendTo(size_t p, void * buf, size_t sz)
{
MPI_ISend(p,buf,sz);
}
/*! \brief Wait for all communication to complete
*
* Wait for all communication to complete
*
* \return true if no error occur
*
*/
bool wait()
{
// Here we have to type of communication to handle
// Type 1 One side does not know that the other side want to communcate
// Type 2 The other side know that want to communicate
// The reqs structure handle the communication of type 2
// comReq and comSize store request of type 2
// For the type 1 we have to reduce scatter the comReq this
// for each processor K return the number of processors that need
// to communicate with K
MPI_ireduce_scatter();
// For the type 2 we already have recv coupled to send so just wait to complete
//! wait for all request to complete
MPI_Waitall(reqs.size(),&reqs[0],&status[0]);
//! For the number of incoming request queue an MPI_IRecv with MPI_ANY_SOURCE
//! It is going to receive the length of the message that each processor need
//! communicate
for (int i = 0 ; i < 5; i++)
{
}
//! For the number of outcomming request queue MPI_ISend sending the length of
//! the message the processor need to comunicate
for (int i = 0 ; i < 5; i++)
{
}
//! wait for all request to complete
MPI_Waitall(reqs.size(),&reqs[0],&status[0]);
//! finally send and receive the data
for (int i = 0 ; i < 5; i++)
{
}
for (int i = 0 ; i < 5; i++)
{
}
//! wait for all request to complete
MPI_Waitall(reqs.size(),&reqs[0],&status[0]);
return true;
}
#ifndef COM_UNIT_HPP
#define COM_UNIT_HPP
#include <mpi.h>
#include <vector>
/*! \brief This is the abstraction of the communication
* unit for the virtual cluster
*
* This with the abstraction of the communication
* unit of the virtual cluster
*
* When this unit is returned back, you must ensure that no other thread
* is using MPI call
*
*/
class ComUnit
{
// if this processor need to communicate with the processor K
// it put 1 at the position K
std::vector<unsigned int> comReq;
// if this processor need to communicate with the processor K
// a message to length m put m at position K
std::vector<size_t> sizeReq;
// List of all status request
std::vector<MPI_Request> reqs;
// List of the status of all the request
std::vector<MPI_Status> stat;
//! Send data
bool SentTo();
//! Send data to the neighborhood
bool SendToN();
//! wait for communication to complete
bool wait();
};
#endif
//
// Project : ThreadPool
// File : TThread.cc
// Author : Ronald Kriemann
// Purpose : baseclass for a thread-able class
//
// arch-tag: aec71576-f8d5-4573-ad31-f3dbddc59934
//
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <sched.h>
#include <string.h>
#include <iostream>
#include <cmath>
#include "TThread.h"
//
// routine to call TThread::run() method
//
extern "C"
void *
_run_thread ( void *arg )
{
if (arg != NULL)
{
((TThread*) arg)->run();
((TThread*) arg)->reset_running();
}// if
return NULL;
}
////////////////////////////////////////////
//
// constructor and destructor
//
TThread::TThread ( const int thread_no )
: _running( false ), _thread_no(thread_no)
{
}
TThread::~TThread ()
{
// request cancellation of the thread if running
if ( _running )
cancel();
}
////////////////////////////////////////////
//
// access local data
//
void
TThread::set_thread_no ( const int n )
{
_thread_no = n;
}
////////////////////////////////////////////
//
// thread management
//
//
// create thread (actually start it)
//
void
TThread::create ( const bool detached, const bool sscope )
{
if ( ! _running )
{
int status;
if ((status = pthread_attr_init( & _thread_attr )) != 0)
{
std::cerr << "(TThread) create : pthread_attr_init ("
<< strerror( status ) << ")" << std::endl;
return;
}// if
if ( detached )
{
// detache created thread from calling thread
if ((status = pthread_attr_setdetachstate( & _thread_attr,
PTHREAD_CREATE_DETACHED )) != 0)
{
std::cerr << "(TThread) create : pthread_attr_setdetachstate ("
<< strerror( status ) << ")" << std::endl;
return;
}// if
}// if
if ( sscope )
{
// use system-wide scheduling for thread
if ((status = pthread_attr_setscope( & _thread_attr, PTHREAD_SCOPE_SYSTEM )) != 0 )
{
std::cerr << "(TThread) create : pthread_attr_setscope ("
<< strerror( status ) << ")" << std::endl;
return;
}// if
}// if
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && defined(SUNOS)
//
// adjust thread-scheduling for Solaris
//
struct sched_param t_param;
t_param.sched_priority = sched_get_priority_min( SCHED_RR );
if ((status = pthread_attr_setschedpolicy( & _thread_attr, SCHED_RR )) != 0)
std::cerr << "(TThread) create : pthread_attr_setschedpolicy ("
<< strerror( status ) << ")" << std::endl;
if ((status = pthread_attr_setschedparam( & _thread_attr, & t_param )) != 0)
std::cerr << "(TThread) create : pthread_attr_setschedparam ("
<< strerror( status ) << ")" << std::endl;
if ((status = pthread_attr_setinheritsched( & _thread_attr, PTHREAD_EXPLICIT_SCHED )) != 0)
std::cerr << "(TThread) create : pthread_attr_setinheritsched ("
<< strerror( status ) << ")" << std::endl;
#endif
#ifdef HPUX
// on HP-UX we increase the stack-size for a stable behaviour
// (need much memory for this !!!)
pthread_attr_setstacksize( & _thread_attr, 32 * 1024 * 1024 );
#endif
if ((status = pthread_create( & _thread_id, & _thread_attr, _run_thread, this ) != 0))
std::cerr << "(TThread) create : pthread_create ("
<< strerror( status ) << ")" << std::endl;
else
_running = true;
}// if
else
std::cout << "(TThread) create : thread is already running" << std::endl;
}
//
// detach thread
//
void
TThread::detach ()
{
if ( _running )
{
int status;
// detach thread
if ((status = pthread_detach( _thread_id )) != 0)
std::cerr << "(TThread) detach : pthread_detach ("
<< strerror( status ) << ")" << std::endl;
}// if
}
//
// synchronise with thread (wait until finished)
//
void
TThread::join ()
{
if ( _running )
{
int status;
// wait for thread to finish
if ((status = pthread_join( _thread_id, NULL )) != 0)
std::cerr << "(TThread) join : pthread_join ("
<< strerror( status ) << ")" << std::endl;
_running = false;
}// if
}
//
// request cancellation of thread
//
void
TThread::cancel ()
{
if ( _running )
{
int status;
if ((status = pthread_cancel( _thread_id )) != 0)
std::cerr << "(TThread) cancel : pthread_cancel ("
<< strerror( status ) << ")" << std::endl;
}// if
}
////////////////////////////////////////////
//
// functions to be called by a thread itself
//
//
// terminate thread
//
void
TThread::exit ()
{
if ( _running && (pthread_self() == _thread_id))
{
void * ret_val = NULL;
pthread_exit( ret_val );
_running = false;
}// if
}
//
// put thread to sleep (milli + nano seconds)
//
void
TThread::sleep ( const double sec )
{
if ( _running )
{
struct timespec interval;
if ( sec <= 0.0 )
{
interval.tv_sec = 0;
interval.tv_nsec = 0;
}// if
else
{
interval.tv_sec = time_t( std::floor( sec ) );
interval.tv_nsec = long( (sec - interval.tv_sec) * 1e6 );
}// else
nanosleep( & interval, 0 );
}// if
}
#ifndef __TTHREAD_HH
#define __TTHREAD_HH
//
// Project : ThreadPool
// File : TThread.hh
// Author : Ronald Kriemann
// Purpose : baseclass for a thread-able class
//
// arch-tag: d09c570a-520a-48ce-b612-a813b50e87b4
//
#include <stdio.h>
#include <pthread.h>
#ifdef HAVE_CUDA
#include <cuda.h>
#endif
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//
// baseclass for all threaded classes
// - defines basic interface
//
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
class TThread
{
protected:
// thread-specific things
pthread_t _thread_id;
pthread_attr_t _thread_attr;
// is the thread running or not
bool _running;
// no of thread
int _thread_no;
public:
////////////////////////////////////////////
//
// constructor and destructor
//
TThread ( const int thread_no = -1 );
virtual ~TThread ();
////////////////////////////////////////////
//
// access local data
//
int thread_no () const { return _thread_no; }
int proc_no () const { return _thread_no; }
void set_thread_no ( const int n );
// compare if given proc-no is local one
bool on_proc ( const int p ) const { return ((p == -1) || (_thread_no == -1) || (p == _thread_no)); }
// resets running-status (used in _run_proc, see TThread.cc)
void reset_running () { _running = false; }
////////////////////////////////////////////
//
// user-interface
//
// actually method the thread executes
virtual void run () = 0;
////////////////////////////////////////////
//
// thread management
//
// create thread (actually start it)
void create ( const bool detached = false, const bool sscope = false );
// detach thread
void detach ();
// synchronise with thread (wait until finished)
void join ();
// request cancellation of thread
void cancel ();
protected:
////////////////////////////////////////////
//
// functions to be called by a thread itself
//
// terminate thread
void exit ();