int smpi_shared_known_call(const char* func, const char* input)
{
char* loc = bprintf("%s:%s", func, input);
- xbt_ex_t ex;
int known = 0;
if (calls==nullptr) {
calls = xbt_dict_new_homogeneous(nullptr);
}
- TRY {
+ try {
xbt_dict_get(calls, loc); /* Succeed or throw */
known = 1;
- }
- TRY_CLEANUP {
xbt_free(loc);
}
- CATCH(ex) {
+ catch (xbt_ex& ex) {
+ xbt_free(loc);
if (ex.category != not_found_error)
- RETHROW;
- xbt_ex_free(ex);
+ throw;
+ }
+ catch(...) {
+ xbt_free(loc);
+ throw;
}
return known;
}
return data;
}
-#define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
/** Map a given SMPI privatization segment (make a SMPI process active) */
-void smpi_switch_data_segment(int dest){
- if (smpi_loaded_page==dest)//no need to switch either
- return;
+void smpi_switch_data_segment(int dest) {
+ if (smpi_loaded_page == dest)//no need to switch, we've already loaded the one we want
+ return;
// So the job:
smpi_really_switch_data_segment(dest);
int smpi_is_privatisation_file(char* file)
{
- return strncmp("/dev/shm/my-buffer-", file, 19) == 0;
+ return strncmp("/dev/shm/my-buffer-", file, std::strlen("/dev/shm/my-buffer-")) == 0;
}
void smpi_initialize_global_memory_segments(){