typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
-typedef simgrid::surf::StorageImpl* surf_storage_t;
#else
typedef struct s_smx_cond_t* smx_cond_t;
typedef struct s_smx_mutex* smx_mutex_t;
typedef struct s_smx_mailbox* smx_mailbox_t;
-typedef struct s_surf_storage* surf_storage_t;
#endif
#ifndef SMPI_HELPERS_INTERNAL_H
#define SMPI_HELPERS_INTERNAL_H
+#include <getopt.h>
#include <unistd.h>
#include <sys/time.h>
unsigned int smpi_sleep(unsigned int secs);
int smpi_gettimeofday(struct timeval* tv, struct timezone* tz);
-struct option;
int smpi_getopt_long_only(int argc, char* const* argv, const char* options, const struct option* long_options,
int* opt_index);
int smpi_getopt_long(int argc, char* const* argv, const char* options, const struct option* long_options,
*/
public:
StopRequest() = default;
- StopRequest(std::string msg) : msg_(msg) { }
+ explicit StopRequest(std::string msg) : msg_(msg) {}
+
private:
std::string msg_;
};
} catch (simgrid::TimeoutError& e) {
status = MSG_TIMEOUT;
} catch (xbt_ex& e) {
- switch (e.category) {
- case cancel_error:
+ if (e.category == cancel_error)
status = MSG_TASK_CANCELED;
- break;
- default:
+ else
throw;
- }
}
/* action ended, set comm and compute = nullptr, the actions is already destroyed in the main function */
finished = true;
}
catch (xbt_ex& e) {
- switch (e.category) {
- case network_error:
- comm->status = MSG_TRANSFER_FAILURE;
- finished = true;
- break;
- default:
- throw;
+ if (e.category == network_error) {
+ comm->status = MSG_TRANSFER_FAILURE;
+ finished = true;
+ } else {
+ throw;
}
}
comm->status = MSG_TIMEOUT;
}
catch (xbt_ex& e) {
- switch (e.category) {
- case network_error:
+ if (e.category == network_error)
comm->status = MSG_TRANSFER_FAILURE;
- break;
- default:
+ else
throw;
- }
}
return comm->status;
status = MSG_TIMEOUT;
}
catch(xbt_ex& e) {
- switch (e.category) {
- case network_error:
- finished_index = e.value;
- status = MSG_TRANSFER_FAILURE;
- break;
- default:
- throw;
+ if (e.category == network_error) {
+ finished_index = e.value;
+ status = MSG_TRANSFER_FAILURE;
+ } else {
+ throw;
}
}