int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
/* Check the given arguments */
MSG_init(&argc, argv);
/* Explicit initialization of the action module is required now*/
xbt_replay_action_register("compute", action_compute);
/* Actually do the simulation using MSG_action_trace_run */
- res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here
+ msg_error_t res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here
XBT_INFO("Simulation time %g", MSG_get_clock());
}
int main(int argc, char *argv[]) {
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
- /* Explicit initialization of the action module is required now*/
+ /* Explicit initialization of the action module is required */
MSG_action_init();
xbt_assert(argc > 3,"Usage: %s platform_file deployment_file [action_files]\n"
if (opened_files == NULL)
opened_files = xbt_dict_new_homogeneous(NULL);
/* Actually do the simulation using MSG_action_trace_run */
- res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here
+ msg_error_t res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here
XBT_INFO("Simulation time %g", MSG_get_clock());
*/
int select_piece_to_download(peer_t peer, connection_t remote_peer)
{
- int piece = -1;
-
- piece = partially_downloaded_piece(peer, remote_peer);
+ int piece = partially_downloaded_piece(peer, remote_peer);
// strict priority policy
if (piece != -1)
return piece;
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
MSG_create_environment(argv[1]);
MSG_launch_application(argv[2]);
- res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_INFO("Total simulation time: %e", MSG_get_clock());
/* Find the next node to forward a message to */
static int routing_next(node_t node, int dest) {
int closest = closest_in_namespace_set(node, dest);
- int res = -1;
if (closest!=-1)
return closest;
int l = shl(node->id, dest);
- res = node->routing_table[l][domain(dest, l)];
- if (res!=-1)
+ int res = node->routing_table[l][domain(dest, l)];
+ if (res != -1)
return res;
//rare case
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
sg_energy_plugin_init();
MSG_init(&argc, argv);
MSG_create_environment(argv[1]);
MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost1"));
- res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_INFO("Total simulation time: %.2f", MSG_get_clock());
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
sg_energy_plugin_init();
MSG_init(&argc, argv);
MSG_process_create("onoff_test", onoff, NULL, MSG_get_host_by_name("MyHost2"));
- res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_INFO("Total simulation time: %.2f", MSG_get_clock());
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost1"));
MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost2"));
- res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_INFO("Total simulation time: %e", MSG_get_clock());
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
sg_energy_plugin_init();
MSG_init(&argc, argv);
MSG_process_create("dvfs",dvfs,NULL,MSG_host_by_name("MyHost1"));
- res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_INFO("Total simulation time: %.2f; All hosts must have the exact same energy consumption.", MSG_get_clock());
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
"\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
MSG_function_register("worker", worker);
MSG_launch_application(argv[2]);
- res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
/* - Create and deploy killer process, that will create the victim process */
MSG_process_create("killer", killer, NULL, MSG_host_by_name("Tremblay"));
- res = MSG_main(); /* - Run the simulation */
+ msg_error_t res = MSG_main(); /* - Run the simulation */
XBT_INFO("Simulation time %g", MSG_get_clock());
return res != MSG_OK;
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
MSG_process_create("emigrant", emigrant, NULL, MSG_get_host_by_name("Jacquelin"));
MSG_process_create("policeman", policeman, NULL, MSG_get_host_by_name("Boivin"));
- checkpoint = xbt_mutex_init(); /* - Initiate the mutex and conditions */
+ checkpoint = xbt_mutex_init(); /* - Initiate the mutex and conditions */
identification = xbt_cond_init();
- res = MSG_main(); /* - Run the simulation */
+ msg_error_t res = MSG_main(); /* - Run the simulation */
XBT_INFO("Simulation time %g", MSG_get_clock());
xbt_cond_destroy(identification);
xbt_mutex_destroy(checkpoint);
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
"\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
MSG_function_register("sleeper", sleeper);
MSG_launch_application(argv[2]); /* - Deploy the sleeper processes with explicit start/kill times */
- res = MSG_main(); /* - Run the simulation */
+ msg_error_t res = MSG_main(); /* - Run the simulation */
XBT_INFO("Simulation time %g", MSG_get_clock());
return res != MSG_OK;
}
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
xbt_dynar_t hosts = MSG_hosts_as_dynar();
MSG_process_create("dream_master", dream_master, NULL, xbt_dynar_getfirst_as(hosts, msg_host_t));
xbt_dynar_free(&hosts);
- res = MSG_main(); /* - Run the simulation */
+ msg_error_t res = MSG_main(); /* - Run the simulation */
return res != MSG_OK;
}
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
"\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
MSG_function_register("test", test);
MSG_launch_application(argv[2]);
- res = MSG_main();
+ msg_error_t res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
jprocess_bind(context->jprocess, process, env);
// Adrien, ugly path, just to bypass creation of context at low levels (i.e such as for the VM migration for instance)
- if (context->jprocess == nullptr)
- return;
- else
+ if (context->jprocess != nullptr)
run_jprocess(env, context->jprocess);
}
}}}
env->SetBooleanField(jcomm, jcomm_field_Comm_finished, JNI_TRUE);
if (status == MSG_OK) {
jcomm_bind_task(env,jcomm);
- return;
} else {
jmsg_throw_status(env,status);
}
//check if variable is already declared
char *created = (char*)xbt_dict_get_or_null(filter, variable);
if (what == INSTR_US_DECLARE){
- if (created){//already declared
- return;
- }else{
+ if (!created) { // not declared yet
xbt_dict_set (filter, variable, xbt_strdup("1"), nullptr);
instr_new_user_variable_type (father_type, variable, color);
}
}else{
- if (!created){//not declared, ignore
- return;
- } else {
+ if (created) { // declared, let's work
char valuestr[100];
snprintf(valuestr, 100, "%g", value);
container_t container = PJ_container_get(resource);
type_t type = PJ_type_get (category_type, container->type);
instr_event (now, delta, type, container, value);
}
- return;
}
/* TRACE_surf_host_set_utilization: entry point from SimGrid */
{
//only trace host utilization if host is known by tracing mechanism
container_t container = PJ_container_get_or_null(resource);
- if (!container)
- return;
- if (!value)
+ if (!container || !value)
return;
//trace uncategorized host utilization
type_t type = PJ_type_get (category_type, container->type);
instr_event (now, delta, type, container, value);
}
- return;
}
void TRACE_surf_resource_utilization_alloc()
}
free(myCoords);
free(targetCoords);
-
- return;
}
}
}
// Currently, we need this before sg_config_init:
_sg_do_model_check = 1;
- // The initialisation function can touch argv.
+ // The initialization function can touch argv.
// We make a copy of argv before modifying it in order to pass the original
// value to the model-checked:
char** argv_copy = argvdup(argc, argv);
//free category
xbt_free(task->category);
task->category = nullptr;
- return;
}
/* MSG_task_get related functions */
surf_exit();
simix_global = nullptr;
- return;
}
simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm *>(synchro);
if (comm != nullptr) {
comm->surf_comm->setCategory(category);
- return;
}
}
nsleeps++;
}
smpi_mpi_request_free(&request);
-
- return;
}
void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
}
xbt_dict_set(smpi_instances, name, (void*)instance, nullptr);
- return;
}
//get the index of the process in the process_data array
smpi_group_set_mapping(smpi_comm_group(instance->comm_world), index, rank);
*bar = instance->finalization_barrier;
*comm = &instance->comm_world;
- return;
}
void smpi_deployment_cleanup_instances(){
void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size)
{
- return;
+ /* nothing done in this version */
}
static void smpi_check_options(){
void __attribute__ ((weak)) user_main_()
{
xbt_die("Should not be in this smpi_simulated_main");
- return;
}
int __attribute__ ((weak)) smpi_simulated_main_(int argc, char **argv)
this->setState(Action::State::failed);
xbt_heap_remove(getModel()->getActionHeap(), this->indexHeap_);
cpu_->modified(true);
- return;
}
void CpuTiAction::suspend()
}
void HostCLM03Model::updateActionsState(double /*now*/, double /*delta*/){
- return;
+ /* I won't do what you tell me */
}
}
lmm_check_concurrency(sys);
XBT_OUT();
- return;
}
double lmm_get_variable_weight(lmm_variable_t var)
action->gapRemove();
}
}
- return;
}
}
}
}
- return;
}
Action *HostL07Model::executeParallelTask(int host_nb, sg_host_t *host_list,
on_exception:
free(optionlist_cpy);
THROWF(unknown_error, 0, "Could not set variables %s", options);
- return;
}
// Horrible mess to translate C++ exceptions to C exceptions:
unit->tests = xbt_dynar_new(sizeof(xbt_test_test_t), xbt_test_test_free);
xbt_dynar_push(suite->units, &unit);
- return;
}
/* run test one suite */
test->line = line;
test->logs = xbt_dynar_new(sizeof(xbt_test_log_t), xbt_test_log_free);
xbt_dynar_push(unit->tests, &test);
- return;
}
/* annotate test case with log message and failure */
if (!*twincell)
dict->fill++;
*twincell = bucklet;
- continue;
} else {
pprev = &bucklet->next;
}
new->next = l->head;
new->next->prev = new;
l->head = new;
- return;
}
/** Shift bucket
inline void xbt_fifo_free_item(xbt_fifo_item_t b)
{
xbt_mallocator_release(item_mallocator, b);
- return;
}
/** Destructor
{
XBT_CWARN(xbt_fifo, "This function is deprecated. Use xbt_fifo_free_item.");
xbt_fifo_free_item(b);
- return;
}
/**
item->content = content;
xbt_heap_increase_key(H, count - 1);
XBT_DEBUG("Heap has now %d elements and max elem is %g",xbt_heap_size(H),xbt_heap_maxkey(H));
- return;
}
/**
}
if (H->update_callback)
H->update_callback(items[i].content, i);
- return;
}
xbt_dynar_push(otherqueue, &evt);
}
}
- goto todo_done; // end of file reached while searching in vain for more work
+ // end of file reached while searching in vain for more work
} else {
// Get something from my queue and return it
xbt_dynar_shift(myqueue, &evt);
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
MSG_create_environment(argv[1]);
MSG_process_create("send", sender_fun, NULL, MSG_get_host_by_name("Tremblay"));
MSG_process_create("receive", receiver_fun, NULL, MSG_get_host_by_name("Tremblay"));
- res = MSG_main();
- return res != MSG_OK;
+ return MSG_main() != MSG_OK;
}
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
MSG_process_killall(atoi(argv[2]));
MSG_process_create("sendpid", sendpid, NULL, MSG_get_host_by_name("Tremblay"));
MSG_process_create("killall", killall, NULL, MSG_get_host_by_name("Tremblay"));
- res = MSG_main();
-
- return res != MSG_OK;
+ return MSG_main() != MSG_OK;
}
/** test the trace integration cpu model */
static int test_trace(int argc, char *argv[])
{
- double task_comp_size = 2800;
- double task_prio = 1.0;
-
xbt_assert (argc == 3,"Wrong number of arguments!\nUsage: %s <task computational size in FLOPS> <task priority>", argv[0]);
- task_comp_size = xbt_str_parse_double(argv[1],"Invalid computational size: %s");
- task_prio = xbt_str_parse_double(argv[2], "Invalid task priority: %s");
+ double task_comp_size = xbt_str_parse_double(argv[1], "Invalid computational size: %s");
+ double task_prio = xbt_str_parse_double(argv[2], "Invalid task priority: %s");
XBT_INFO("Testing the trace integration cpu model: CpuTI");
XBT_INFO("Task size: %f", task_comp_size);
int main(int argc, char *argv[])
{
- msg_error_t res = MSG_OK;
-
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s test_trace_integration_model.xml deployment.xml\n", argv[0]);
MSG_create_environment(argv[1]);
MSG_launch_application(argv[2]);
- res = MSG_main();
-
- return res != MSG_OK;
+ return MSG_main() != MSG_OK;
}