// CollTI: bcast, reduce, allreduce, gather, scatter, allgather, alltoall
class CollTIData : public TIData {
int root_;
- int send_size_;
- int recv_size_;
+ size_t send_size_;
+ size_t recv_size_;
std::string send_type_;
std::string recv_type_;
public:
- CollTIData(const std::string& name, int root, double amount, int send_size, int recv_size,
+ CollTIData(const std::string& name, int root, double amount, size_t send_size, size_t recv_size,
const std::string& send_type, const std::string& recv_type)
: TIData(name, amount)
, root_(root)
{
std::stringstream stream;
stream << get_name() << " " << send_size_ << " ";
- if (recv_size_ >= 0)
+ if (recv_size_ > 0)
stream << recv_size_ << " ";
if (get_amount() >= 0.0)
stream << get_amount() << " ";
aid_t pid = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(pid, request == MPI_REQUEST_IGNORED ? "PMPI_Bcast" : "PMPI_Ibcast",
new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "bcast" : "ibcast", root, -1.0,
- datatype->is_replayable() ? count : count * datatype->size(), -1,
+ datatype->is_replayable() ? count : count * datatype->size(), 0,
simgrid::smpi::Datatype::encode(datatype), ""));
if (comm->size() > 1) {
if (request == MPI_REQUEST_IGNORED)
aid_t pid = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(pid, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce" : "PMPI_Ireduce",
- new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "reduce" : "ireduce", root, 0,
- datatype->is_replayable() ? count : count * datatype->size(), -1,
+ new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "reduce" : "ireduce", root, 0,
+ datatype->is_replayable() ? count : count * datatype->size(), 0,
simgrid::smpi::Datatype::encode(datatype), ""));
if (request == MPI_REQUEST_IGNORED)
simgrid::smpi::colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
TRACE_smpi_comm_in(pid, request == MPI_REQUEST_IGNORED ? "PMPI_Allreduce" : "PMPI_Iallreduce",
new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "allreduce" : "iallreduce", -1, 0,
- datatype->is_replayable() ? count : count * datatype->size(), -1,
+ datatype->is_replayable() ? count : count * datatype->size(), 0,
simgrid::smpi::Datatype::encode(datatype), ""));
if (request == MPI_REQUEST_IGNORED)
// utilities
extern XBT_PRIVATE char* smpi_data_exe_start; // start of the data+bss segment of the executable
-extern XBT_PRIVATE int smpi_data_exe_size; // size of the data+bss segment of the executable
+extern XBT_PRIVATE size_t smpi_data_exe_size; // size of the data+bss segment of the executable
XBT_PRIVATE void smpi_switch_data_segment(simgrid::s4u::ActorPtr actor);
int smpi_loaded_page = -1;
char* smpi_data_exe_start = nullptr;
-int smpi_data_exe_size = 0;
+size_t smpi_data_exe_size = 0;
SmpiPrivStrategies smpi_privatize_global_variables;
static void* smpi_data_exe_copy;
initial_vm_map.clear();
initial_vm_map.shrink_to_fit();
- XBT_DEBUG("bss+data segment found : size %d starting at %p", smpi_data_exe_size, smpi_data_exe_start);
+ XBT_DEBUG("bss+data segment found : size %zu starting at %p", smpi_data_exe_size, smpi_data_exe_start);
if (smpi_data_exe_size == 0) { // no need to do anything as global variables don't exist
smpi_privatize_global_variables = SmpiPrivStrategies::NONE;
};
}
-using req_key_t = std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int>;
-using req_storage_t = std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int, int, int>>>;
-
void log_timed_action(const simgrid::xbt::ReplayAction& action, double clock)
{
if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
class RequestStorage {
private:
- req_storage_t store;
+ using req_key_t = std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int>;
+ using req_storage_t = std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int, int, int>>>;
+
+ req_storage_t store;
public:
RequestStorage() = default;
- int size() const { return store.size(); }
+ size_t size() const { return store.size(); }
req_storage_t& get_store() { return store; }
const BcastArgParser& args = get_args();
TRACE_smpi_comm_in(get_pid(), "action_bcast",
new simgrid::instr::CollTIData("bcast", MPI_COMM_WORLD->group()->actor(args.root), -1.0, args.size,
- -1, Datatype::encode(args.datatype1), ""));
+ 0, Datatype::encode(args.datatype1), ""));
colls::bcast(send_buffer(args.size * args.datatype1->size()), args.size, args.datatype1, args.root, MPI_COMM_WORLD);
const ReduceArgParser& args = get_args();
TRACE_smpi_comm_in(get_pid(), "action_reduce",
new simgrid::instr::CollTIData("reduce", MPI_COMM_WORLD->group()->actor(args.root), args.comp_size,
- args.comm_size, -1, Datatype::encode(args.datatype1), ""));
+ args.comm_size, 0, Datatype::encode(args.datatype1), ""));
colls::reduce(send_buffer(args.comm_size * args.datatype1->size()),
recv_buffer(args.comm_size * args.datatype1->size()), args.comm_size, args.datatype1, MPI_OP_NULL,
{
const AllReduceArgParser& args = get_args();
TRACE_smpi_comm_in(get_pid(), "action_allreduce",
- new simgrid::instr::CollTIData("allreduce", -1, args.comp_size, args.comm_size, -1,
+ new simgrid::instr::CollTIData("allreduce", -1, args.comp_size, args.comm_size, 0,
Datatype::encode(args.datatype1), ""));
colls::allreduce(send_buffer(args.comm_size * args.datatype1->size()),
extern "C" void* _sampi_realloc(void* ptr, size_t size)
{
void* result = xbt_realloc(ptr, size);
- int old_size = alloc_table.at(ptr);
+ size_t old_size = alloc_table.at(ptr);
alloc_table.erase(ptr);
alloc_table.insert({result, size});
if (not simgrid::s4u::this_actor::is_maestro()) {