#include "src/internal_config.h"
#include "private.h"
+#include "private.hpp"
#include "xbt/dict.h"
#include "xbt/sysdep.h"
#include "xbt/ex.h"
xbt_die("Aborting.");
}
// Simulate the benchmarked computation unless disabled via command-line argument
- if (xbt_cfg_get_boolean("smpi/simulate_computation")) {
+ if (xbt_cfg_get_boolean("smpi/simulate-computation"))
smpi_execute(xbt_os_timer_elapsed(timer));
- }
smpi_total_benched_time += xbt_os_timer_elapsed(timer);
}
void *smpi_shared_malloc(size_t size, const char *file, int line)
{
void* mem;
- if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){
+ if (xbt_cfg_get_boolean("smpi/use-shared-malloc")){
int fd;
smpi_source_location loc(file, line);
auto res = allocs.insert(std::make_pair(loc, shared_data_t()));
case EEXIST:
xbt_die("Please cleanup /dev/shm/%s", shmname);
default:
- xbt_die("An unhandled error occured while opening %s. shm_open: %s", shmname, strerror(errno));
+ xbt_die("An unhandled error occurred while opening %s. shm_open: %s", shmname, strerror(errno));
}
}
data->second.fd = fd;
{
char loc[PTR_STRLEN];
- if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){
+ if (xbt_cfg_get_boolean("smpi/use-shared-malloc")){
snprintf(loc, PTR_STRLEN, "%p", ptr);
auto meta = allocs_metadata.find(ptr);
if (meta == allocs_metadata.end()) {
xbt_free(smpi_privatisation_regions);
#endif
}
+
+extern "C" {
+
+ smpi_trace_call_location_t trace_call_location;
+
+ smpi_trace_call_location_t* smpi_trace_get_call_location() {
+ return smpi_process_get_call_location();
+ }
+
+ void smpi_trace_set_call_location(const char* file, int line) {
+ smpi_trace_call_location_t* loc = smpi_process_get_call_location();
+
+ loc->previous_filename = loc->filename;
+ loc->previous_linenumber = loc->linenumber;
+ loc->filename = file;
+ loc->linenumber = line;
+ }
+
+ /**
+ * Required for Fortran bindings
+ */
+ void smpi_trace_set_call_location_(const char* file, int* line) {
+ smpi_trace_set_call_location(file, *line);
+ }
+
+ /**
+ * Required for Fortran if -fsecond-underscore is activated
+ */
+ void smpi_trace_set_call_location__(const char* file, int* line) {
+ smpi_trace_set_call_location(file, *line);
+ }
+}