From bea3ba08392e5da9dfec0119bcd0641e0f0b1a52 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 6 Apr 2021 17:43:28 +0200 Subject: [PATCH] Add the option to print origin of a failing handle. This uses trace-call-location flag for smpicc, store the value at handle creation, and tries to return the most relevant one on a crash (that's actually a pain and will have to be checked) --- src/instr/instr_smpi.hpp | 4 +- src/smpi/bindings/smpi_mpi.cpp | 1 + src/smpi/bindings/smpi_pmpi.cpp | 2 +- src/smpi/bindings/smpi_pmpi_comm.cpp | 6 +- src/smpi/bindings/smpi_pmpi_request.cpp | 4 +- src/smpi/bindings/smpi_pmpi_topo.cpp | 6 +- src/smpi/include/private.hpp | 189 ++++++++++++++++-------- src/smpi/include/smpi_f2c.hpp | 3 + src/smpi/include/smpi_utils.hpp | 5 + src/smpi/internals/smpi_utils.cpp | 14 +- src/smpi/mpi/smpi_f2c.cpp | 4 + src/smpi/mpi/smpi_win.cpp | 12 +- 12 files changed, 169 insertions(+), 81 deletions(-) diff --git a/src/instr/instr_smpi.hpp b/src/instr/instr_smpi.hpp index 71cb360377..d541ed917e 100644 --- a/src/instr/instr_smpi.hpp +++ b/src/instr/instr_smpi.hpp @@ -25,10 +25,10 @@ XBT_PRIVATE void TRACE_smpi_init(int rank, const std::string& calling_func); class smpi_trace_call_location_t { public: std::string filename; - int linenumber; + int linenumber = 0; std::string previous_filename; - int previous_linenumber; + int previous_linenumber = 0; std::string get_composed_key() const { diff --git a/src/smpi/bindings/smpi_mpi.cpp b/src/smpi/bindings/smpi_mpi.cpp index 012c7d1391..ca63a1af17 100644 --- a/src/smpi/bindings/smpi_mpi.cpp +++ b/src/smpi/bindings/smpi_mpi.cpp @@ -55,6 +55,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi) XBT_INFO("Backtrace of the run : if incomplete, run smpirun with -keep-temps. To hide, use --log=no_loc"); \ xbt_backtrace_display_current(); \ } \ + simgrid::smpi::utils::print_current_handle(); \ xbt_die("%s - returned %.*s instead of MPI_SUCCESS", __func__, error_size, error_string); \ } else \ err->call((errhan), ret); \ diff --git a/src/smpi/bindings/smpi_pmpi.cpp b/src/smpi/bindings/smpi_pmpi.cpp index 6b1c4dc036..eb5d4d3323 100644 --- a/src/smpi/bindings/smpi_pmpi.cpp +++ b/src/smpi/bindings/smpi_pmpi.cpp @@ -250,7 +250,7 @@ int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_f int PMPI_Keyval_free(int* keyval) { CHECK_NULL(1, MPI_ERR_ARG, keyval) - CHECK_MPI_NULL(1, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, *keyval) + CHECK_VAL(1, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, *keyval) return simgrid::smpi::Keyval::keyval_free(keyval); } diff --git a/src/smpi/bindings/smpi_pmpi_comm.cpp b/src/smpi/bindings/smpi_pmpi_comm.cpp index f54d7b4646..e000ee2194 100644 --- a/src/smpi/bindings/smpi_pmpi_comm.cpp +++ b/src/smpi/bindings/smpi_pmpi_comm.cpp @@ -220,7 +220,7 @@ int PMPI_Comm_test_inter(MPI_Comm comm, int* flag){ int PMPI_Attr_delete(MPI_Comm comm, int keyval) { CHECK_COMM(1) - CHECK_MPI_NULL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval) + CHECK_VAL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval) if(keyval == MPI_TAG_UB||keyval == MPI_HOST||keyval == MPI_IO ||keyval == MPI_WTIME_IS_GLOBAL||keyval == MPI_APPNUM ||keyval == MPI_UNIVERSE_SIZE||keyval == MPI_LASTUSEDCODE) return MPI_ERR_ARG; @@ -238,7 +238,7 @@ int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) { CHECK_NULL(4, MPI_ERR_ARG, flag) *flag = 0; CHECK_COMM(1) - CHECK_MPI_NULL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval) + CHECK_VAL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval) switch (keyval) { case MPI_HOST: @@ -271,7 +271,7 @@ int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) { int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) { CHECK_COMM(1) - CHECK_MPI_NULL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval) + CHECK_VAL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval) if(keyval == MPI_TAG_UB||keyval == MPI_HOST||keyval == MPI_IO ||keyval == MPI_WTIME_IS_GLOBAL||keyval == MPI_APPNUM ||keyval == MPI_UNIVERSE_SIZE||keyval == MPI_LASTUSEDCODE) return MPI_ERR_ARG; diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index fb30222571..6447f78d45 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -94,7 +94,7 @@ int PMPI_Start(MPI_Request * request) int retval = 0; smpi_bench_end(); - CHECK_REQUEST(1) + CHECK_REQUEST_VALID(1) if ( *request == MPI_REQUEST_NULL) { retval = MPI_ERR_REQUEST; } else { @@ -731,7 +731,7 @@ int PMPI_Cancel(MPI_Request* request) int retval = 0; smpi_bench_end(); - CHECK_REQUEST(1) + CHECK_REQUEST_VALID(1) if (*request == MPI_REQUEST_NULL) { retval = MPI_ERR_REQUEST; } else { diff --git a/src/smpi/bindings/smpi_pmpi_topo.cpp b/src/smpi/bindings/smpi_pmpi_topo.cpp index f543fe442d..7f15585578 100644 --- a/src/smpi/bindings/smpi_pmpi_topo.cpp +++ b/src/smpi/bindings/smpi_pmpi_topo.cpp @@ -14,8 +14,8 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi); * check if the topology is nullptr, but we should check if it is the good topology type (so we have to add a * MPIR_Topo_Type field, and replace the MPI_Topology field by an union)*/ -int PMPI_Cart_create(MPI_Comm comm_old, int ndims, const int* dims, const int* periodic, int reorder, MPI_Comm* comm_cart) { - CHECK_COMM2(1, comm_old) +int PMPI_Cart_create(MPI_Comm comm, int ndims, const int* dims, const int* periodic, int reorder, MPI_Comm* comm_cart) { + CHECK_COMM(1) if (ndims > 0){ CHECK_NULL(3, MPI_ERR_ARG, dims) CHECK_NULL(4, MPI_ERR_ARG, periodic) @@ -25,7 +25,7 @@ int PMPI_Cart_create(MPI_Comm comm_old, int ndims, const int* dims, const int* p for (int i = 0; i < ndims; i++) CHECK_NEGATIVE(2, MPI_ERR_ARG, dims[i]) const simgrid::smpi::Topo_Cart* topo = - new simgrid::smpi::Topo_Cart(comm_old, ndims, dims, periodic, reorder, comm_cart); + new simgrid::smpi::Topo_Cart(comm, ndims, dims, periodic, reorder, comm_cart); if (*comm_cart == MPI_COMM_NULL) { delete topo; } else { diff --git a/src/smpi/include/private.hpp b/src/smpi/include/private.hpp index cd4ae345a7..da075e9d62 100644 --- a/src/smpi/include/private.hpp +++ b/src/smpi/include/private.hpp @@ -8,6 +8,7 @@ #include "smpi/smpi.h" #include "smpi/smpi_helpers_internal.h" +#include "smpi_utils.hpp" #include "src/instr/instr_smpi.hpp" #include #include @@ -517,78 +518,138 @@ XBT_PUBLIC smpi_trace_call_location_t* smpi_trace_get_call_location(); XBT_PRIVATE void private_execute_flops(double flops); -#define CHECK_ARGS(test, errcode, ...) \ - if (test) { \ - int error_code_ = (errcode); \ - if (error_code_ != MPI_SUCCESS) \ - XBT_WARN(__VA_ARGS__); \ - return error_code_; \ +#define CHECK_ARGS(test, errcode,...)\ + {\ + if (test) {\ + int error_code_ = (errcode);\ + if (error_code_ != MPI_SUCCESS){\ + XBT_WARN(__VA_ARGS__);\ + }\ + return error_code_;\ + }\ } -#define CHECK_MPI_NULL(num, val, err, ptr) \ - CHECK_ARGS((ptr) == (val), (err), \ - "%s: param %d %s cannot be %s", __func__, (num), _XBT_STRINGIFY(ptr), _XBT_STRINGIFY(val)); -#define CHECK_NULL(num,err,buf) \ - CHECK_ARGS((buf) == nullptr, (err), \ - "%s: param %d %s cannot be NULL", __func__, (num), _XBT_STRINGIFY(buf)); -#define CHECK_NEGATIVE(num, err, val) \ - CHECK_ARGS((val) < 0, (err), \ - "%s: param %d %s cannot be negative", __func__, (num), _XBT_STRINGIFY(val)); -#define CHECK_NEGATIVE_OR_ZERO(num, err, val) \ - CHECK_ARGS((val) <= 0, (err), \ - "%s: param %d %s cannot be negative or 0", __func__, (num), _XBT_STRINGIFY(val)); -#define CHECK_COMM2(num, comm) \ +#define CHECK_MPI_NULL(num, val, err, ptr)\ + CHECK_ARGS((ptr) == (val), (err),\ + "%s: param %d %s cannot be %s", __func__, (num), _XBT_STRINGIFY(ptr), _XBT_STRINGIFY(val)) + +#define CHECK_VAL(num, val, err, value)\ + CHECK_ARGS((value) == (val), (err),\ + "%s: param %d %s cannot be %s", __func__, (num), _XBT_STRINGIFY(value), _XBT_STRINGIFY(val)) + +#define CHECK_NULL(num,err,buf)\ + CHECK_ARGS((buf) == nullptr, (err),\ + "%s: param %d %s cannot be NULL", __func__, (num), _XBT_STRINGIFY(buf)) + +#define CHECK_NEGATIVE(num, err, val)\ + CHECK_ARGS((val) < 0, (err),\ + "%s: param %d %s cannot be negative", __func__, (num), _XBT_STRINGIFY(val)) + +#define CHECK_NEGATIVE_OR_ZERO(num, err, val)\ + CHECK_ARGS((val) <= 0, (err),\ + "%s: param %d %s cannot be negative or 0", __func__, (num), _XBT_STRINGIFY(val)) + +#define CHECK_COMM2(num, comm)\ CHECK_MPI_NULL((num), MPI_COMM_NULL, MPI_ERR_COMM, (comm)) -#define CHECK_DELETED(num, err, obj) \ - CHECK_ARGS((obj)->deleted(), (err), "%s: param %d %s has already been freed", __func__, (num), _XBT_STRINGIFY(obj)); -#define CHECK_COMM(num) \ - CHECK_COMM2((num), comm) \ - CHECK_DELETED((num), MPI_ERR_COMM, comm) -#define CHECK_REQUEST(num) \ - CHECK_ARGS(request == nullptr, MPI_ERR_REQUEST, \ + +#define CHECK_DELETED(num, err, obj)\ + CHECK_ARGS((obj)->deleted(), (err), "%s: param %d %s has already been freed", __func__, (num),\ + _XBT_STRINGIFY(obj)) + +#define CHECK_COMM(num)\ + {\ + CHECK_COMM2((num), comm)\ + CHECK_DELETED((num), MPI_ERR_COMM, comm)\ + simgrid::smpi::utils::set_current_handle(comm);\ + } + +#define CHECK_REQUEST(num)\ + CHECK_ARGS(request == nullptr, MPI_ERR_REQUEST,\ "%s: param %d request cannot be NULL",__func__, (num)); -#define CHECK_BUFFER(num,buf,count) \ - CHECK_ARGS((buf) == nullptr && (count) > 0, MPI_ERR_BUFFER, \ - "%s: param %d %s cannot be NULL if %s > 0",__func__, (num), _XBT_STRINGIFY(buf), _XBT_STRINGIFY(count)); -#define CHECK_COUNT(num, count) \ + +#define CHECK_REQUEST_VALID(num)\ + {\ + CHECK_REQUEST(num)\ + if(request!=MPI_REQUEST_IGNORED){\ + CHECK_DELETED((num), MPI_ERR_REQUEST, *request)\ + simgrid::smpi::utils::set_current_handle(*request);\ + }\ + } + +#define CHECK_BUFFER(num,buf,count)\ + CHECK_ARGS((buf) == nullptr && (count) > 0, MPI_ERR_BUFFER,\ + "%s: param %d %s cannot be NULL if %s > 0",__func__, (num), _XBT_STRINGIFY(buf), _XBT_STRINGIFY(count)) + +#define CHECK_COUNT(num, count)\ CHECK_NEGATIVE((num), MPI_ERR_COUNT, (count)) -#define CHECK_TYPE(num, datatype) \ - CHECK_ARGS(((datatype) == MPI_DATATYPE_NULL|| not (datatype)->is_valid()), MPI_ERR_TYPE, \ - "%s: param %d %s cannot be MPI_DATATYPE_NULL or invalid", __func__, (num), _XBT_STRINGIFY(datatype)); -#define CHECK_OP(num, op, type) \ - CHECK_MPI_NULL((num), MPI_OP_NULL, MPI_ERR_OP, (op)) \ - CHECK_ARGS(((op)->allowed_types() && (((op)->allowed_types() & (type)->flags()) == 0)), MPI_ERR_OP, \ - "%s: param %d op %s can't be applied to type %s", __func__, (num), _XBT_STRINGIFY(op), type->name()); + +#define CHECK_TYPE(num, datatype)\ + {\ + CHECK_ARGS(((datatype) == MPI_DATATYPE_NULL|| not (datatype)->is_valid()), MPI_ERR_TYPE,\ + "%s: param %d %s cannot be MPI_DATATYPE_NULL or invalid", __func__, (num), _XBT_STRINGIFY(datatype));\ + CHECK_DELETED((num), MPI_ERR_TYPE, datatype)\ + if (not datatype->is_basic())\ + simgrid::smpi::utils::set_current_handle(datatype);\ + } + +#define CHECK_OP(num, op, type)\ + {\ + CHECK_MPI_NULL((num), MPI_OP_NULL, MPI_ERR_OP, (op))\ + CHECK_DELETED((num), MPI_ERR_OP, op)\ + if (not op->is_predefined())\ + simgrid::smpi::utils::set_current_handle(op);\ + CHECK_ARGS(((op)->allowed_types() && (((op)->allowed_types() & (type)->flags()) == 0)), MPI_ERR_OP,\ + "%s: param %d op %s can't be applied to type %s", __func__, (num), _XBT_STRINGIFY(op), type->name().c_str());\ + } + #define CHECK_ROOT(num)\ - CHECK_ARGS((root < 0 || root >= comm->size()), MPI_ERR_ROOT, \ - "%s: param %d root (=%d) cannot be negative or larger than communicator size (=%d)", __func__, (num), \ - root, comm->size()); -#define CHECK_INFO(num,info) \ - CHECK_MPI_NULL((num), MPI_INFO_NULL, MPI_ERR_INFO, (info)) -#define CHECK_TAG(num,tag) \ - CHECK_ARGS(((tag) < 0 && (tag) != MPI_ANY_TAG), MPI_ERR_TAG, \ - "%s: param %d %s (=%d) cannot be negative", __func__, (num), _XBT_STRINGIFY(tag), (tag)); -#define CHECK_FILE(num, fh) \ + CHECK_ARGS((root < 0 || root >= comm->size()), MPI_ERR_ROOT,\ + "%s: param %d root (=%d) cannot be negative or larger than communicator size (=%d)", __func__, (num),\ + root, comm->size()) + +#define CHECK_INFO(num,info)\ + {\ + CHECK_MPI_NULL((num), MPI_INFO_NULL, MPI_ERR_INFO, (info))\ + CHECK_DELETED((num), MPI_ERR_INFO, info)\ + simgrid::smpi::utils::set_current_handle(info);\ + } + +#define CHECK_TAG(num,tag)\ + CHECK_ARGS(((tag) < 0 && (tag) != MPI_ANY_TAG), MPI_ERR_TAG,\ + "%s: param %d %s (=%d) cannot be negative", __func__, (num), _XBT_STRINGIFY(tag), (tag)) + +#define CHECK_FILE(num, fh)\ CHECK_MPI_NULL((num), MPI_FILE_NULL, MPI_ERR_FILE, (fh)) -#define CHECK_OFFSET(num, offset) \ + +#define CHECK_OFFSET(num, offset)\ CHECK_NEGATIVE((num), MPI_ERR_DISP, (offset)) -#define CHECK_GROUP(num, group) \ + +#define CHECK_GROUP(num, group)\ CHECK_MPI_NULL((num), MPI_GROUP_NULL, MPI_ERR_GROUP, (group)) -#define CHECK_WIN(num, win) \ - CHECK_MPI_NULL((num), MPI_WIN_NULL, MPI_ERR_WIN, (win)) -#define CHECK_RANK(num, rank, comm) \ - CHECK_ARGS(((rank) >= (comm)->size() || (rank) <0), MPI_ERR_RANK, \ - "%s: param %d %s (=%d) cannot be < 0 or > %d", __func__, (num), _XBT_STRINGIFY(rank), \ - (rank), (comm)->size() ); -#define CHECK_PROC_RMA(num,proc,win) \ - CHECK_MPI_NULL((num), MPI_PROC_NULL, MPI_SUCCESS, (proc)) \ - CHECK_RANK(num, proc, win->comm()) -#define CHECK_NOT_IN_PLACE_ROOT(num, buf) \ - CHECK_ARGS((buf == MPI_IN_PLACE), MPI_ERR_BUFFER, \ + +#define CHECK_WIN(num, win)\ + {\ + CHECK_MPI_NULL((num), MPI_WIN_NULL, MPI_ERR_WIN, (win))\ + simgrid::smpi::utils::set_current_handle(win);\ + } +#define CHECK_RANK(num, rank, comm)\ + CHECK_ARGS(((rank) >= (comm)->size() || (rank) <0), MPI_ERR_RANK,\ + "%s: param %d %s (=%d) cannot be < 0 or > %d", __func__, (num), _XBT_STRINGIFY(rank),\ + (rank), (comm)->size() ) + +#define CHECK_PROC_RMA(num,proc,win)\ + {\ + CHECK_VAL((num), MPI_PROC_NULL, MPI_SUCCESS, (proc))\ + CHECK_RANK(num, proc, (win)->comm())\ + } + +#define CHECK_NOT_IN_PLACE_ROOT(num, buf)\ + CHECK_ARGS((buf == MPI_IN_PLACE), MPI_ERR_BUFFER,\ "%s: param %d %s cannot be MPI_IN_PLACE for rank %d with root %d", __func__, (num), _XBT_STRINGIFY(buf), \ - rank, root); -#define CHECK_NOT_IN_PLACE(num, buf) \ - CHECK_ARGS((buf == MPI_IN_PLACE), MPI_ERR_BUFFER, \ - "%s: param %d %s cannot be MPI_IN_PLACE for rank %d", __func__, (num), _XBT_STRINGIFY(buf), \ - rank); + rank, root) + +#define CHECK_NOT_IN_PLACE(num, buf)\ + CHECK_ARGS((buf == MPI_IN_PLACE), MPI_ERR_BUFFER,\ + "%s: param %d %s cannot be MPI_IN_PLACE for rank %d", __func__, (num), _XBT_STRINGIFY(buf), rank) + #endif diff --git a/src/smpi/include/smpi_f2c.hpp b/src/smpi/include/smpi_f2c.hpp index 4c6ca1b938..856525bc14 100644 --- a/src/smpi/include/smpi_f2c.hpp +++ b/src/smpi/include/smpi_f2c.hpp @@ -11,6 +11,7 @@ #include #include +#include namespace simgrid{ namespace smpi{ @@ -26,6 +27,7 @@ private: static f2c_lookup_type::size_type num_default_handles_; int my_f2c_id_ = -1; bool deleted_ = false; + std::string call_location_; protected: static void allocate_lookup() @@ -54,6 +56,7 @@ public: static F2C* f2c(int id); static void finish_initialization() { num_default_handles_ = f2c_lookup_->size(); } static f2c_lookup_type::size_type get_num_default_handles() { return num_default_handles_; } + std::string call_location(){ return call_location_; } }; } diff --git a/src/smpi/include/smpi_utils.hpp b/src/smpi/include/smpi_utils.hpp index a804e164b4..29c09185a7 100644 --- a/src/smpi/include/smpi_utils.hpp +++ b/src/smpi/include/smpi_utils.hpp @@ -9,6 +9,7 @@ #include #include #include +#include "smpi_f2c.hpp" // Methods used to parse and store the values for timing injections in smpi struct s_smpi_factor_t { @@ -20,12 +21,16 @@ struct s_smpi_factor_t { namespace simgrid { namespace smpi { namespace utils { + extern F2C* current_handle; XBT_PUBLIC std::vector parse_factor(const std::string& smpi_coef_string); XBT_PUBLIC void add_benched_time(double time); XBT_PUBLIC void account_malloc_size(size_t size, const char* file, int line); XBT_PUBLIC void account_shared_size(size_t size); XBT_PUBLIC void print_time_analysis(double time); XBT_PUBLIC void print_memory_analysis(); + XBT_PUBLIC void print_current_handle(); + static void set_current_handle(F2C* handle){current_handle=handle;} + } } } diff --git a/src/smpi/internals/smpi_utils.cpp b/src/smpi/internals/smpi_utils.cpp index 791bf56f69..0f6de95b78 100644 --- a/src/smpi/internals/smpi_utils.cpp +++ b/src/smpi/internals/smpi_utils.cpp @@ -13,9 +13,7 @@ #include "xbt/file.hpp" #include #include "smpi_config.hpp" -#include "smpi_f2c.hpp" #include "src/simix/smx_private.hpp" - #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)"); @@ -38,6 +36,7 @@ struct MaxMalloc { std::string file; }; MaxMalloc max_malloc; +F2C* current_handle=0; std::vector parse_factor(const std::string& smpi_coef_string) { @@ -179,6 +178,17 @@ void print_memory_analysis() XBT_INFO("%lu bytes were automatically shared between processes, in %u calls\n", total_shared_size, total_shared_calls); } } + +void print_current_handle(){ + if(current_handle){ + if(current_handle->call_location().empty()) + XBT_INFO("To get handle location information, pass -trace-call-location flag to smpicc/f90 as well"); + else + XBT_INFO("Handle %s was allocated by a call at %s", current_handle->name().c_str(), + (char*)(current_handle->call_location().c_str())); + } +} + } } } // namespace simgrid diff --git a/src/smpi/mpi/smpi_f2c.cpp b/src/smpi/mpi/smpi_f2c.cpp index be9e920baf..d3b04ace68 100644 --- a/src/smpi/mpi/smpi_f2c.cpp +++ b/src/smpi/mpi/smpi_f2c.cpp @@ -6,6 +6,7 @@ #include "smpi_f2c.hpp" #include "private.hpp" #include "src/smpi/include/smpi_actor.hpp" +#include "src/instr/instr_smpi.hpp" int mpi_in_place_; int mpi_bottom_; @@ -25,6 +26,9 @@ F2C::F2C() = default; int F2C::add_f() { allocate_lookup(); + auto loc = smpi_process()->call_location(); + if(loc && loc->linenumber != 0) + call_location_= std::string (loc->filename + ":" + std::to_string(loc->linenumber)); my_f2c_id_ = global_f2c_id(); (*f2c_lookup_)[my_f2c_id_] = this; f2c_id_increment(); diff --git a/src/smpi/mpi/smpi_win.cpp b/src/smpi/mpi/smpi_win.cpp index 297dd072c3..bf860179c8 100644 --- a/src/smpi/mpi/smpi_win.cpp +++ b/src/smpi/mpi/smpi_win.cpp @@ -217,7 +217,8 @@ int Win::put(const void *origin_addr, int origin_count, MPI_Datatype origin_data } if(target_count*target_datatype->get_extent()>recv_win->size_){ - XBT_WARN("Trying to put more than the window size - Bailing out."); + XBT_WARN("MPI_Put: Trying to put %ld, which is more than the window size on target process %d : %ld - Bailing out.", + target_count*target_datatype->get_extent(), target_rank, recv_win->size_); return MPI_ERR_RMA_RANGE; } @@ -279,7 +280,8 @@ int Win::get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, } if(target_count*target_datatype->get_extent()>send_win->size_){ - XBT_WARN("Trying to get more than the window size - Bailing out."); + XBT_WARN("MPI_Get: Trying to get %ld, which is more than the window size on target process %d : %ld - Bailing out.", + target_count*target_datatype->get_extent(), target_rank, send_win->size_); return MPI_ERR_RMA_RANGE; } @@ -341,7 +343,8 @@ int Win::accumulate(const void *origin_addr, int origin_count, MPI_Datatype orig //FIXME: local version if(target_count*target_datatype->get_extent()>recv_win->size_){ - XBT_WARN("Trying to accumulate more than the window size - Bailing out."); + XBT_WARN("MPI_Accumulate: Trying to accumulate %ld, which is more than the window size on target process %d : %ld - Bailing out.", + target_count*target_datatype->get_extent(), target_rank, recv_win->size_); return MPI_ERR_RMA_RANGE; } @@ -398,7 +401,8 @@ int Win::get_accumulate(const void* origin_addr, int origin_count, MPI_Datatype } if(target_count*target_datatype->get_extent()>send_win->size_){ - XBT_WARN("Trying to get_accumulate more than the window size - Bailing out."); + XBT_WARN("MPI_Get_accumulate: Trying to get_accumulate %ld, which is more than the window size on target process %d : %ld - Bailing out.", + target_count*target_datatype->get_extent(), target_rank, send_win->size_); return MPI_ERR_RMA_RANGE; } -- 2.20.1