Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -97,7 +97,7 @@ public:
|
||||
m_out << "tools::mpi::hmpi::wait_histos : rank " << m_rank << " : can't alloc buffer of size " << buffer_size << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(::MPI_Recv(buffer,buffer_size,MPI_CHAR,a_src,m_tag,m_comm,&status)!=MPI_SUCCESS) {
|
||||
m_out << "tools::mpi::hmpi::wait_histos : rank " << m_rank << " : MPI_Recv : failed." << std::endl;
|
||||
delete [] buffer;
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
num_t nhist;
|
||||
if(!_mpi.unpack(nhist)) return false;
|
||||
|
||||
if(m_verbose)
|
||||
if(m_verbose)
|
||||
m_out << "tools::mpi::hmpi::wait_histos : rank " << m_rank << " : number of histos to unpack " << nhist << std::endl;
|
||||
|
||||
{for(num_t ihist=0;ihist<nhist;ihist++) {
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
<< std::endl;
|
||||
}
|
||||
a_hists.push_back(class_pointer(h->s_cls(),h)); //give ownership of h.
|
||||
|
||||
|
||||
} else if(scls==tools::histo::p2d::s_class()) {
|
||||
tools::histo::profile_data<double,unsigned int,unsigned int,double,double> pdata;
|
||||
if(!profile_data_duiuidd_unpack(_mpi,pdata)) return false;
|
||||
@@ -206,11 +206,11 @@ public:
|
||||
|
||||
public:
|
||||
virtual int rank() const { return m_rank;}
|
||||
virtual bool comm_rank(int& a_rank) const {
|
||||
virtual bool comm_rank(int& a_rank) const {
|
||||
if(::MPI_Comm_rank(m_comm,&a_rank)!=MPI_SUCCESS) {a_rank=-1;return false;}
|
||||
return true;
|
||||
}
|
||||
virtual bool comm_size(int& a_size) const {
|
||||
virtual bool comm_size(int& a_size) const {
|
||||
if(::MPI_Comm_size(m_comm,&a_size)!=MPI_SUCCESS) {a_size=0;return false;}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ inline bool wait_buffer(std::ostream& a_out,int a_rank,int a_src,int a_tag,const
|
||||
a_probe_src = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(::MPI_Recv(a_buffer,a_buffer_size,MPI_CHAR,status.MPI_SOURCE,status.MPI_TAG,a_comm,&status)!=MPI_SUCCESS) {
|
||||
a_out << "tools::mpi::wait_buffer : rank " << a_rank << " : MPI_Recv : failed." << std::endl;
|
||||
a_buffer_size = 0;
|
||||
|
||||
@@ -31,15 +31,15 @@ protected:
|
||||
}
|
||||
#endif
|
||||
public:
|
||||
virtual bool init(int* a_argc,char*** a_argv) {
|
||||
virtual bool init(int* a_argc,char*** a_argv) {
|
||||
if(::MPI_Init(a_argc,a_argv)!=MPI_SUCCESS) return false;
|
||||
return true;
|
||||
}
|
||||
virtual bool rank(int& a_rank) const {
|
||||
virtual bool rank(int& a_rank) const {
|
||||
if(::MPI_Comm_rank(MPI_COMM_WORLD,&a_rank)!=MPI_SUCCESS) {a_rank=-1;return false;}
|
||||
return true;
|
||||
}
|
||||
virtual bool size(int& a_size) const {
|
||||
virtual bool size(int& a_size) const {
|
||||
if(::MPI_Comm_size(MPI_COMM_WORLD,&a_size)!=MPI_SUCCESS) {a_size=0;return false;}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
//typedef unsigned __int64 uint64;
|
||||
#define TOOLS_MPI_UINT64 MPI_UNSIGNED_LONG_LONG
|
||||
#define TOOLS_MPI_INT64 MPI_LONG_LONG
|
||||
#elif defined(_LP64)
|
||||
#elif defined(_LP64)
|
||||
// 64 Bit Platforms
|
||||
//typedef long int64;
|
||||
//typedef unsigned long uint64;
|
||||
#define TOOLS_MPI_UINT64 MPI_UNSIGNED_LONG
|
||||
#define TOOLS_MPI_INT64 MPI_LONG
|
||||
#else
|
||||
#else
|
||||
// 32-Bit Platforms
|
||||
//typedef long long int64;
|
||||
//typedef unsigned long long uint64;
|
||||
@@ -297,7 +297,7 @@ public: //inlib::mpi::impi
|
||||
return true;
|
||||
}
|
||||
virtual bool bunpack(bool& a_val) {
|
||||
typedef unsigned char bool_t;
|
||||
typedef unsigned char bool_t;
|
||||
bool_t val;
|
||||
if(::MPI_Unpack(m_buffer,m_size,&m_ipos,&val,1,MPI_UNSIGNED_CHAR,m_comm)!=MPI_SUCCESS) {
|
||||
m_out << "tools::mpi::wrmpi : MPI_Unpack(bool) failed." << std::endl;
|
||||
@@ -389,7 +389,7 @@ public: //inlib::mpi::impi
|
||||
m_pos = m_buffer;
|
||||
m_ipos = 0; //IMPORTANT
|
||||
}
|
||||
|
||||
|
||||
virtual bool send_buffer(int a_dest,int a_tag) { // used in tools/mpi/pntuple.
|
||||
if(::MPI_Send(m_buffer,m_ipos,MPI_CHAR,a_dest,a_tag,m_comm)!=MPI_SUCCESS) {
|
||||
m_out << "tools::mpi::wrmpi::send_buffer : MPI_Send() failed for rank destination " << a_dest << "." << std::endl;
|
||||
@@ -412,13 +412,13 @@ public: //inlib::mpi::impi
|
||||
m_max = m_buffer+m_size;
|
||||
m_pos = m_buffer;
|
||||
m_ipos = 0; //IMPORTANT
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool wait_buffer(int a_rank,int a_tag,int& a_probe_src,bool a_verbose = false) {
|
||||
return wait_buffer(a_rank,MPI_ANY_SOURCE,a_tag,a_probe_src,a_verbose);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
wrmpi(std::ostream& a_out,const MPI_Comm& a_comm,tools::uint32 a_size = 128) // we expect a_size!=0
|
||||
:m_out(a_out)
|
||||
|
||||
Reference in New Issue
Block a user