A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rework the MSG navbar
[simgrid.git]
/
src
/
msg
/
global.c
diff --git
a/src/msg/global.c
b/src/msg/global.c
index
6bf0f87
..
4f0cf72
100644
(file)
--- a/
src/msg/global.c
+++ b/
src/msg/global.c
@@
-22,6
+22,7
@@
MSG_Global_t msg_global = NULL;
* \brief This section describes the functions you need to know to
* set up a simulation. You should have a look at \ref MSG_examples
* to have an overview of their usage.
* \brief This section describes the functions you need to know to
* set up a simulation. You should have a look at \ref MSG_examples
* to have an overview of their usage.
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Simulation functions" --> \endhtmlonly
*/
/********************************* MSG **************************************/
*/
/********************************* MSG **************************************/
@@
-205,7
+206,7
@@
void MSG_paje_output(const char *filename)
len = strlen(filename);
if((len<ext_len) || (strncmp(filename+len-ext_len,ext,ext_len))) {
len = strlen(filename);
if((len<ext_len) || (strncmp(filename+len-ext_len,ext,ext_len))) {
- CRITICAL2("
%s does not end by \"%s\". It may cause troubles when using Paje
\n",
+ CRITICAL2("
The name of the Paje trace file \"%s\" does not end by \"%s\". Paje will cause difficulties to read it.
\n",
filename,ext);
}
filename,ext);
}
@@
-236,6
+237,8
@@
void MSG_paje_output(const char *filename)
/** \defgroup m_channel_management Understanding channels
* \brief This section briefly describes the channel notion of MSG
* (#m_channel_t).
/** \defgroup m_channel_management Understanding channels
* \brief This section briefly describes the channel notion of MSG
* (#m_channel_t).
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Channels" --> \endhtmlonly
+ *
*
* For convenience, the simulator provides the notion of channel
* that is close to the tag notion in MPI. A channel is not a
*
* For convenience, the simulator provides the notion of channel
* that is close to the tag notion in MPI. A channel is not a
@@
-302,7
+305,7
@@
MSG_error_t MSG_main(void)
}
while ((process = xbt_fifo_pop(msg_global->process_to_run))) {
}
while ((process = xbt_fifo_pop(msg_global->process_to_run))) {
- DEBUG3("Scheduling
%s(%d) on %s",
+ DEBUG3("Scheduling
%s(%d) on %s",
process->name,process->simdata->PID,
process->simdata->host->name);
msg_global->current_process = process;
process->name,process->simdata->PID,
process->simdata->host->name);
msg_global->current_process = process;
@@
-398,33
+401,29
@@
MSG_error_t MSG_main(void)
}
if ((nbprocess=xbt_fifo_size(msg_global->process_list)) == 0) {
}
if ((nbprocess=xbt_fifo_size(msg_global->process_list)) == 0) {
- fprintf(stderr,
- "MSG: Congratulations ! Simulation terminated : all process are over\n");
+ INFO0("Congratulations ! Simulation terminated : all process are over");
return MSG_OK;
} else {
xbt_fifo_item_t item = NULL;
return MSG_OK;
} else {
xbt_fifo_item_t item = NULL;
-
fprintf(stderr,"MSG: Oops ! Deadlock or code not perfectly clean.\n
");
-
fprintf(stderr,"MSG: %d processes are still running, waiting for something.\n
",
-
nbprocess);
+
INFO0("Oops ! Deadlock or code not perfectly clean.
");
+
INFO1("MSG: %d processes are still running, waiting for something.
",
+ nbprocess);
/* List the process and their state */
/* List the process and their state */
-
fprintf(stderr,"MSG: <process>(<pid>) on <host>: <status>.\n
");
+
INFO0("MSG: <process>(<pid>) on <host>: <status>.
");
xbt_fifo_foreach(msg_global->process_list,item,process,m_process_t) {
simdata_process_t p_simdata = (simdata_process_t) process->simdata;
simdata_host_t h_simdata=(simdata_host_t)p_simdata->host->simdata;
xbt_fifo_foreach(msg_global->process_list,item,process,m_process_t) {
simdata_process_t p_simdata = (simdata_process_t) process->simdata;
simdata_host_t h_simdata=(simdata_host_t)p_simdata->host->simdata;
-
fprintf(stderr,"MSG: %s(%d) on %s:
",
+
INFO4("MSG: %s(%d) on %s: %s
",
process->name,p_simdata->PID,
process->name,p_simdata->PID,
- p_simdata->host->name);
-
- if (process->simdata->blocked)
- fprintf(stderr,"[blocked] ");
- if (process->simdata->suspended)
- fprintf(stderr,"[suspended] ");
+ p_simdata->host->name,
+ (process->simdata->blocked)?"[blocked] "
+ :((process->simdata->suspended)?"[suspended] ":""));
for (i=0; i<msg_global->max_channel; i++) {
if (h_simdata->sleeping[i] == process) {
for (i=0; i<msg_global->max_channel; i++) {
if (h_simdata->sleeping[i] == process) {
-
fprintf(stderr,"Listening on channel %d.\n
",i);
+
INFO1("\tListening on channel %d.
",i);
break;
}
}
break;
}
}
@@
-432,18
+431,18
@@
MSG_error_t MSG_main(void)
if(p_simdata->waiting_task) {
if(p_simdata->waiting_task->simdata->compute) {
if(p_simdata->put_host)
if(p_simdata->waiting_task) {
if(p_simdata->waiting_task->simdata->compute) {
if(p_simdata->put_host)
-
fprintf(stderr,"Trying to send a task to Host %s, channel %d.\n
",
-
p_simdata->put_host->name, p_simdata->put_channel);
+
INFO2("\tTrying to send a task to Host %s, channel %d.
",
+ p_simdata->put_host->name, p_simdata->put_channel);
else
else
-
fprintf(stderr,"Waiting for %s to finish.\n
",p_simdata->waiting_task->name);
+
INFO1("Waiting for %s to finish.
",p_simdata->waiting_task->name);
} else if (p_simdata->waiting_task->simdata->comm)
} else if (p_simdata->waiting_task->simdata->comm)
-
fprintf(stderr,"Waiting for %s to be finished transfered.\n
",
+
INFO1("Waiting for %s to be finished transfered.
",
p_simdata->waiting_task->name);
else
p_simdata->waiting_task->name);
else
-
fprintf(stderr,"UNKNOWN STATUS. Please report this bug.\n
");
+
INFO0("UNKNOWN STATUS. Please report this bug.
");
}
else { /* Must be trying to put a task somewhere */
}
else { /* Must be trying to put a task somewhere */
-
fprintf(stderr,"UNKNOWN STATUS. Please report this bug.\n
");
+
INFO0("UNKNOWN STATUS. Please report this bug.
");
}
}
}
}
}
}
@@
-453,6
+452,7
@@
MSG_error_t MSG_main(void)
xbt_abort();
}
xbt_abort();
}
+ INFO0("Return a Warning.");
return MSG_WARNING;
}
}
return MSG_WARNING;
}
}
@@
-469,7
+469,7
@@
int MSG_process_killall(int reset_PIDs)
m_process_t p = NULL;
m_process_t self = MSG_process_self();
m_process_t p = NULL;
m_process_t self = MSG_process_self();
- while((p=xbt_fifo_
shift
(msg_global->process_list))) {
+ while((p=xbt_fifo_
pop
(msg_global->process_list))) {
if(p!=self) MSG_process_kill(p);
}
if(p!=self) MSG_process_kill(p);
}
@@
-497,7
+497,7
@@
MSG_error_t MSG_clean(void)
m_process_t p = NULL;
m_process_t p = NULL;
- while((p=xbt_fifo_
shift
(msg_global->process_list))) {
+ while((p=xbt_fifo_
pop
(msg_global->process_list))) {
MSG_process_kill(p);
}
xbt_context_exit();
MSG_process_kill(p);
}
xbt_context_exit();
@@
-514,6
+514,7
@@
MSG_error_t MSG_clean(void)
fclose(msg_global->paje_output);
msg_global->paje_output = NULL;
}
fclose(msg_global->paje_output);
msg_global->paje_output = NULL;
}
+ msg_config_finalize();
free(msg_global);
surf_exit();
free(msg_global);
surf_exit();