Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
allow this example to start without paramters
[simgrid.git] / examples / msg / app-pmm / app-pmm.c
index 6171e0e..dd5e22a 100644 (file)
@@ -64,7 +64,7 @@ int node(int argc, char **argv)
   /* Initialize the node's data-structures */
   int myid = xbt_str_parse_int(argv[1], "Invalid ID received as first node parameter: %s");
   snprintf(my_mbox, MAILBOX_NAME_SIZE - 1, "%d", myid);
-  sC = xbt_matrix_double_new_zeros(NODE_MATRIX_SIZE, NODE_MATRIX_SIZE);
+  xbt_matrix_t sC = xbt_matrix_double_new_zeros(NODE_MATRIX_SIZE, NODE_MATRIX_SIZE);
 
   if (myid == 0){
     /* Create the matrices to multiply and one to store the result */
@@ -90,7 +90,6 @@ int node(int argc, char **argv)
   for (int k=0; k < GRID_SIZE; k++){
     xbt_matrix_t sA;
     xbt_matrix_t sB;
-    xbt_matrix_t sC;
 
     if(k == myjob->col){
       XBT_VERB("Broadcast sA(%d,%d) to row %d", myjob->row, k, myjob->row);
@@ -244,7 +243,10 @@ int main(int argc, char *argv[])
   xbt_os_timer_t timer = xbt_os_timer_new();
 
   MSG_init(&argc, argv);
-  MSG_create_environment(argv[1]);
+  const char *platform = "../../platforms/cluster.xml";
+  if (argc > 1)
+     platform = argv[1];
+  MSG_create_environment(platform);
 
   MSG_function_register("node", node);
   for(int i = 0 ; i< 9; i++) {
@@ -260,7 +262,7 @@ int main(int argc, char *argv[])
   xbt_os_cputimer_start(timer);
   msg_error_t res = MSG_main();
   xbt_os_cputimer_stop(timer);
-  XBT_CRITICAL("Simulated time: %g", MSG_get_clock());
+  XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   return res != MSG_OK;
 }