SIMIX_create_environment(argv[1]);
SIMIX_comm_set_copy_data_callback(smpi_comm_copy_buffer_callback);
- static std::size_t rank = 0;
-
smpi_init_options();
if (smpi_privatize_global_variables == SMPI_PRIVATIZE_DLOPEN) {
struct stat fdin_stat;
stat(executable_copy.c_str(), &fdin_stat);
off_t fdin_size = fdin_stat.st_size;
+ static std::size_t rank = 0;
simix_global->default_function = [executable_copy, fdin_size](std::vector<std::string> args) {
return std::function<void()>([executable_copy, fdin_size, args] {
int Request::waitany(int count, MPI_Request requests[], MPI_Status * status)
{
s_xbt_dynar_t comms; // Keep it on stack to save some extra mallocs
- int size = 0;
int index = MPI_UNDEFINED;
if(count > 0) {
+ int size = 0;
// Wait for a request to complete
xbt_dynar_init(&comms, sizeof(smx_activity_t), [](void*ptr){
intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
}
void Request::free_f(int id) {
- char key[KEY_SIZE];
- if(id!=MPI_FORTRAN_REQUEST_NULL)
+ if (id != MPI_FORTRAN_REQUEST_NULL) {
+ char key[KEY_SIZE];
xbt_dict_remove(F2C::f2c_lookup(), get_key_id(key, id));
+ }
}
}
-/* Copyright (c) 2007-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
lmm_constraint_t cnst = nullptr;
lmm_variable_t var = nullptr;
- double tmp;
-
xbt_swag_foreach(_cnst, cnst_list) {
- cnst = static_cast<lmm_constraint_t>(_cnst);
- tmp = 0;
+ cnst = static_cast<lmm_constraint_t>(_cnst);
+ double tmp = 0;
elem_list = &(cnst->enabled_element_set);
xbt_swag_foreach(_elem, elem_list) {
elem = static_cast<lmm_element_t>(_elem);
static double partial_diff_lambda(double lambda, void *param_cnst)
{
- int j;
- void *_elem;
- xbt_swag_t elem_list = nullptr;
- lmm_element_t elem = nullptr;
- lmm_variable_t var = nullptr;
lmm_constraint_t cnst = static_cast<lmm_constraint_t>(param_cnst);
double diff = 0.0;
- double sigma_i = 0.0;
XBT_IN();
- elem_list = &(cnst->enabled_element_set);
XBT_CDEBUG(surf_lagrange_dichotomy, "Computing diff of cnst (%p)", cnst);
+ xbt_swag_t elem_list = &(cnst->enabled_element_set);
+ void* _elem;
xbt_swag_foreach(_elem, elem_list) {
- elem = static_cast<lmm_element_t>(_elem);
- var = elem->variable;
+ lmm_element_t elem = static_cast<lmm_element_t>(_elem);
+ lmm_variable_t var = elem->variable;
xbt_assert(var->weight > 0);
XBT_CDEBUG(surf_lagrange_dichotomy, "Computing sigma_i for var (%p)", var);
// Initialize the summation variable
- sigma_i = 0.0;
+ double sigma_i = 0.0;
// Compute sigma_i
- for (j = 0; j < var->cnsts_number; j++) {
+ for (int j = 0; j < var->cnsts_number; j++) {
sigma_i += (var->cnsts[j].constraint)->lambda;
}
{
double start_time = this->last_updated;
double finish_time = surf_get_clock();
- double cpu_load;
double current_speed = host->speed();
if (start_time < finish_time) {
+ double cpu_load;
// We may have start == finish if the past consumption was updated since the simcall was started
// for example if 2 actors requested to update the same host's consumption in a given scheduling round.
//
xbt_test_test_t test;
xbt_test_log_t log;
- unsigned int it_unit;
unsigned int it_test;
if (suite == nullptr)
if (suite->enabled) {
/* iterate through all tests */
+ unsigned int it_unit;
xbt_dynar_foreach(suite->units, it_unit, unit) {
/* init unit case counters */
unit->nb_tests = 0;
*/
void xbt_dict_free(xbt_dict_t * dict)
{
- xbt_dictelm_t current;
- xbt_dictelm_t previous;
- int table_size;
- xbt_dictelm_t *table;
-
- // if ( *dict ) xbt_dict_dump_sizes(*dict);
-
if (dict != nullptr && *dict != nullptr) {
- table_size = (*dict)->table_size;
- table = (*dict)->table;
+ int table_size = (*dict)->table_size;
+ xbt_dictelm_t* table = (*dict)->table;
/* Warning: the size of the table is 'table_size+1'...
* This is because table_size is used as a binary mask in xbt_dict_rehash */
for (int i = 0; (*dict)->count && i <= table_size; i++) {
- current = table[i];
+ xbt_dictelm_t current = table[i];
+ xbt_dictelm_t previous;
+
while (current != nullptr) {
previous = current;
current = current->next;