{
struct PromiseBinder {
public:
- PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
+ explicit PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
void operator()(Future<T> future)
{
simgrid::xbt::setPromise(promise_, future);
class Future {
public:
Future() = default;
- Future(std::shared_ptr<FutureState<T>> state): state_(std::move(state)) {}
+ explicit Future(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
// Move type:
Future(Future&) = delete;
template<class T>
class Promise {
public:
- Promise() : state_(std::make_shared<FutureState<T>>()) {}
- Promise(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
+ explicit Promise() : state_(std::make_shared<FutureState<T>>()) {}
+ explicit Promise(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
// Move type
Promise(Promise const&) = delete;
}
-
DefineVariableTypeEvent::DefineVariableTypeEvent(type_t type)
{
this->event_type = PAJE_DefineVariableType;
void sg_config_finalize()
{
- if (!_sg_cfg_init_status)
+ if (not _sg_cfg_init_status)
return; /* Not initialized yet. Nothing to do */
xbt_cfg_free(&simgrid_config);
def handle(fd, func, simcalls, guarded_simcalls):
- def nonempty(e):
+ def nonempty(e):
return e != ''
fd.write('\n'.join(filter(nonempty, (func(simcall) for simcall in simcalls))))
- for guard, list in guarded_simcalls.items():
+ for guard, ll in guarded_simcalls.items():
fd.write('\n#if %s\n' % (guard))
- fd.write('\n'.join(func(simcall) for simcall in list))
+ fd.write('\n'.join(func(simcall) for simcall in ll))
fd.write('\n#endif\n')
if __name__ == '__main__':
Group::Group(int n) : size_(n)
{
- int i;
rank_to_index_map_ = xbt_new(int, size_);
index_to_rank_map_ = xbt_dict_new_homogeneous(xbt_free_f);
refcount_ = 1;
- for (i = 0; i < size_; i++) {
+ for (int i = 0; i < size_; i++) {
rank_to_index_map_[i] = MPI_UNDEFINED;
}
}
Group::Group(MPI_Group origin)
{
- char *key;
- char *ptr_rank;
- xbt_dict_cursor_t cursor = nullptr;
-
- int i;
if(origin != MPI_GROUP_NULL
&& origin != MPI_GROUP_EMPTY)
{
rank_to_index_map_ = xbt_new(int, size_);
index_to_rank_map_ = xbt_dict_new_homogeneous(xbt_free_f);
refcount_ = 1;
- for (i = 0; i < size_; i++) {
+ for (int i = 0; i < size_; i++) {
rank_to_index_map_[i] = origin->rank_to_index_map_[i];
}
+ char* key;
+ char* ptr_rank;
+ xbt_dict_cursor_t cursor = nullptr;
xbt_dict_foreach(origin->index_to_rank_map_, cursor, key, ptr_rank) {
int * cp = static_cast<int*>(xbt_malloc(sizeof(int)));
*cp=*reinterpret_cast<int*>(ptr_rank);
int i;
int index;
int rank;
- int sz;
result = MPI_IDENT;
if (size_ != group2->size()) {
result = MPI_UNEQUAL;
} else {
- sz = group2->size();
+ int sz = group2->size();
for (i = 0; i < sz; i++) {
index = this->index(i);
rank = group2->rank(index);
xbt_dict_t index_to_rank_map_;
int refcount_;
public:
- Group();
- Group(int size);
- Group(Group* origin);
+ explicit Group();
+ explicit Group(int size);
+ explicit Group(Group* origin);
~Group();
void set_mapping(int index, int rank);
# print "WARNING: Output were only sorted using the $sort_prefix first chars.\n"
# if ( $sort_prefix > 0 );
# print "WARNING: Use <! output sort 19> to sort by simulated date and process ID only.\n";
-#
+#
# print "----8<--------------- Begin of unprocessed observed output (as it should appear in file):\n";
# map {print "> $_\n"} @{$cmd{'unsorted got'}};
# print "--------------->8---- End of the unprocessed observed output.\n";
self.timeout *= 20
self.args = TeshState().wrapper + self.args
elif re.match(".*smpirun.*", self.args) is not None:
- self.args = "sh " + self.args
+ self.args = "sh " + self.args
if TeshState().jenkins and self.timeout != None:
self.timeout *= 10