- Storage::getName() changed to return a std::string, use intead
Storage::getCname() to get a char*.
+ MSG
+ - Deprecate MSG_task_get_flops_amount(). Its semantic was weird:
+ before the start it returned the total amount of flops;
+ after it returned the ratio of remaining work. Split it:
+ MSG_task_get_initial_flops_amount() for first behavior
+ MSG_task_get_remaining_work_ratio() for the second one.
+ This fixes GitHub's #223 using PR #237. Thanks Michael Mercier.
+
XBT
- Define class simgrid::xbt::Path to manage file names.
- Removed unused functions:
- xbt/str.h: xbt_str_join()
- xbt/heap.h: use std::priority_queue or boost::heap instead
+ PLUGINS:
+ - New link_energy plugin for the consumption of the links.
+
XML
- Remove the undocumented/untested tag <include>
// Run a task
start = MSG_get_clock();
msg_task_t task1 = MSG_task_create ("t1", 100E6, 0, NULL);
- XBT_INFO("Run a task of %.0E flops",MSG_task_get_flops_amount(task1));
+ XBT_INFO("Run a task of %.0E flops", MSG_task_get_initial_flops_amount(task1));
MSG_task_execute (task1);
MSG_task_destroy(task1);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW"
// Run a second task
start = MSG_get_clock();
task1 = MSG_task_create ("t2", 100E6, 0, NULL);
- XBT_INFO("Run a task of %.0E flops",MSG_task_get_flops_amount(task1));
+ XBT_INFO("Run a task of %.0E flops", MSG_task_get_initial_flops_amount(task1));
MSG_task_execute (task1);
MSG_task_destroy(task1);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
MSG_task_destroy(task);
break;
}
- //adding the value returned by MSG_task_get_compute_duration(task)
- //to the variable "task_computation"
- TRACE_host_variable_add(MSG_host_get_name(MSG_host_self()), "task_computation", MSG_task_get_flops_amount(task));
+ // adding the value returned by MSG_task_get_compute_duration(task) to the variable "task_computation"
+ TRACE_host_variable_add(MSG_host_get_name(MSG_host_self()), "task_computation",
+ MSG_task_get_initial_flops_amount(task));
MSG_task_execute(task);
MSG_task_destroy(task);
task = NULL;
XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec);
XBT_PUBLIC(void) MSG_task_set_flops_amount(msg_task_t task, double flops_amount);
-/* Unable to compile that without -Werror=deprecated-declarations
-XBT_ATTRIB_DEPRECATED_v321( "Use MSG_task_get_initial_flops_amount if you want to get initial amounts of flops, or "
- "Use MSG_task_get_remaining_work_ratio to get task progress (in order "
- "to compute progress in flops)") static inline double MSG_task_get_flops_amount(msg_task_t task)
-{
- return MSG_task_get_flops_amount(task);
-}
-*/
-
-XBT_PUBLIC(double) MSG_task_get_flops_amount(msg_task_t task);
+XBT_ATTRIB_DEPRECATED_v321("Use MSG_task_get_initial_flops_amount if you want to get initial amounts of flops, or "
+ "Use MSG_task_get_remaining_work_ratio to get task progress (in order "
+ "to compute progress in flops)") XBT_PUBLIC(double)
+ MSG_task_get_flops_amount(msg_task_t task);
XBT_PUBLIC(double) MSG_task_get_initial_flops_amount(msg_task_t task);
XBT_PUBLIC(double) MSG_task_get_remaining_work_ratio(msg_task_t task);
XBT_PUBLIC(void) MSG_task_set_bytes_amount(msg_task_t task, double bytes_amount);
env->SetIntField(jprocess, jprocess_field_Process_ppid, (jint) MSG_process_get_PPID(process));
}
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess)
+{
+ msg_process_t process = jprocess_to_native(jprocess, env);
+
+ if (not process) {
+ jxbt_throw_notbound(env, "process", jprocess);
+ return;
+ }
+
+ MSG_process_daemonize(process);
+}
+
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv * env, jclass cls, jint jresetPID)
{
return (jint) MSG_process_killall((int) jresetPID);
/* Implement the Java API */
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject jprocess_arg, jobject jhostname);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess);
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv* env, jclass cls, jint jresetPID);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv* env, jclass cls, jint pid);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv* env, jobject jprocess, jobject jname);
*/
XBT_PUBLIC(void) MSG_process_daemonize(msg_process_t process)
{
- simgrid::simix::kernelImmediate([process]() { process->getImpl()->daemonize(); });
+ process->daemonize();
}
/** @ingroup m_process_management
for (auto const& elm : vm->pimpl_vm_->dp_objs) {
const std::string& key = elm.first;
dirty_page_t dp = elm.second;
- double remaining = MSG_task_get_flops_amount(dp->task);
+ double remaining = MSG_task_get_remaining_work_ratio(dp->task);
double clock = MSG_get_clock();
if (vm == nullptr)
return;
- double remaining = MSG_task_get_flops_amount(task);
+ double remaining = MSG_task_get_remaining_work_ratio(task);
std::string key = simgrid::xbt::string_printf("%s-%p", task->name, task);
dirty_page_t dp = new s_dirty_page;
/* If we are in the middle of dirty page tracking, we record how much computation has been done until now, and keep
* the information for the lookup_() function that will called soon. */
if (vm->pimpl_vm_->dp_enabled) {
- double remaining = MSG_task_get_flops_amount(task);
+ double remaining = MSG_task_get_remaining_work_ratio(task);
double clock = MSG_get_clock();
double updated = get_computed(key, vm, dp, remaining, clock); // was host instead of vm
MSG_task_execute(task);
double end = MSG_get_clock();
XBT_INFO("Task \"%s\" done in %f (amount %f)", MSG_task_get_name(task), end - start,
- MSG_task_get_flops_amount(task));
+ MSG_task_get_remaining_work_ratio(task));
MSG_task_destroy(task);
}