executing comes back (ON_FAILURE="RESTART" on deployment file,
MSG_process_auto_restart_set).
* Use the "msg_" prefix for all datatypes (instead of m_, msg_ and MSG_),
- please stop using the old ones.
+ please stop using the old ones, they are DEPRECATED.
+ * Deprecate MSG_clean(). No need to call it anymore.
Simix:
* Bug fixes around the resource failures: don't let the processes
to avoid memory leaks.
* Add an interface to auto-restart processes when the host in which they are
executing comes back.
+ * Ensures that SIMIX_clean is called automatically. It's not part of
+ the public interface anymore (bindings should be updated).
SimDag:
* New types of typed tasks. SD_TASK_COMP_PAR_AMDAHL represents a
ADD_TEST(simdag-test-simdag2 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh)
ADD_TEST(simdag-test-seq-access ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh)
ADD_TEST(simdag-test-typed-tasks ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_typed_tasks.tesh)
- ADD_TEST(simdag-test-fail ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_fail.tesh)
+ ADD_TEST(simdag-test-fail ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_fail.tesh)
ADD_TEST(simdag-test-comm-throttling ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_comm_throttling.tesh)
ADD_TEST(simdag-test-dax-cycle ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dax --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.tesh)
ADD_TEST(simdag-test-prop ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
endif(CONTEXT_UCONTEXT)
if(HAVE_TRACING)
ADD_TEST(smpi-tracing-ptp ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh)
- ADD_TEST(smpi-replay ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh)
+ ADD_TEST(smpi-replay ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh)
endif(HAVE_TRACING)
endif(enable_smpi)
configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform_with_routers.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml COPYONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/tracing/platform.xml ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_bcast.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_bcast.txt COPYONLY)
set(generated_files_to_clean
${generated_files_to_clean}
${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml
${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml
${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_bcast.txt
)
endif("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
find_program(GCOV_PATH gcov)
if(GCOV_PATH)
SET(COVERAGE_COMMAND "${GCOV_PATH}" CACHE TYPE FILEPATH FORCE)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCOVERAGE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(TESH_OPTION --enable-coverage)
ADD_TEST(memcheck-simdag-test-simdag2-0 ${CMAKE_BINARY_DIR}/examples/simdag/sd_test2 ${CMAKE_HOME_DIRECTORY}/examples/simdag/2clusters.xml --cd ${CMAKE_BINARY_DIR}/examples/simdag/)
ADD_TEST(memcheck-simdag-test-seq-access-0 ${CMAKE_BINARY_DIR}/examples/simdag/sd_seq_access ${CMAKE_HOME_DIRECTORY}/examples/simdag/2clusters.xml --cd ${CMAKE_BINARY_DIR}/examples/simdag/)
ADD_TEST(memcheck-simdag-test-typed-tasks-0 ${CMAKE_BINARY_DIR}/examples/simdag/sd_typed_tasks_test --cfg=network/TCP_gamma:4194304 ${CMAKE_HOME_DIRECTORY}/examples/simdag/2clusters.xml --cd ${CMAKE_BINARY_DIR}/examples/simdag/)
-ADD_TEST(memcheck-simdag-test-fail-0 ${CMAKE_BINARY_DIR}/examples/simdag/sd_fail --cd ${CMAKE_BINARY_DIR}/examples/simdag/)
+ADD_TEST(memcheck-simdag-test-fail-0 ${CMAKE_BINARY_DIR}/examples/simdag/sd_fail --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/)
ADD_TEST(memcheck-simdag-test-comm-throttling-0 ${CMAKE_BINARY_DIR}/examples/simdag/sd_comm_throttling --cfg=network/TCP_gamma:4194304 ${CMAKE_HOME_DIRECTORY}/examples/simdag/2clusters.xml --cd ${CMAKE_BINARY_DIR}/examples/simdag/)
ADD_TEST(memcheck-simdag-test-dax-cycle-0 ${CMAKE_BINARY_DIR}/examples/simdag/dax/dax_test --log=no_loc ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/../2clusters.xml ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.xml --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax/)
ADD_TEST(memcheck-simdag-test-prop-0 ${CMAKE_BINARY_DIR}/examples/simdag/properties/sd_prop ${CMAKE_HOME_DIRECTORY}/examples/simdag/../platforms/prop.xml --cd ${CMAKE_BINARY_DIR}/examples/simdag/)
res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
if (res == MSG_OK)
return 0;
MSG_main();
- MSG_clean();
-
return 0;
}
MSG_main();
- MSG_clean();
-
return 0;
}
XBT_CRITICAL("Messages created: %ld", smx_total_comms);
XBT_INFO("Simulated time: %g", MSG_get_clock());
- MSG_clean();
chord_exit();
if (res == MSG_OK)
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
free(hosts);
free(hostnames);
xbt_dynar_free(&hosts_dynar);
XBT_INFO("GPU task %p was created", mytask);
- MSG_clean();
-
if (res == MSG_OK)
return 0;
else
res = test_all(argv[1], argv[2]);
- MSG_clean();
-
if (res == MSG_OK)
return 0;
else
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
if (res == MSG_OK)
return 0;
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
if (res == MSG_OK)
return 0;
else
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
if (res == MSG_OK)
return 0;
else
XBT_CRITICAL("Messages created: %ld", smx_total_comms);
XBT_INFO("Simulated time: %g", MSG_get_clock());
- MSG_clean();
if (res == MSG_OK)
return 0;
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
-
if (res == MSG_OK)
return 0;
else
MSG_init(&argc, argv);
res = test_all();
- MSG_clean();
if (res == MSG_OK)
return 0;
MSG_init(&argc, argv);
res = test_all(argv[1]);
- MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
res = test_all(argv[1]);
- MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
test_all(argv[1], argv[2]);
- res = MSG_clean();
if (res == MSG_OK)
return 0;
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
if (res == MSG_OK)
return 0;
MSG_main();
- MSG_clean();
-
return 0;
}
xbt_cond_destroy(cond);
xbt_mutex_destroy(mutex);
- if (res == MSG_OK)
- res = MSG_clean();
-
if (res == MSG_OK)
return 0;
else
res = test_all(argv[1], argv[2]);
- MSG_clean();
-
if (res == MSG_OK)
return 0;
else
exit(1);
}
res = test_all(argv[1]);
- MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
if (res == MSG_OK)
return 0;
#endif
XBT_CRITICAL("Simulated time: %g", MSG_get_clock());
- MSG_clean();
-
if (res == MSG_OK)
return 0;
else
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
#ifdef _MSC_VER
_set_output_format(prev_exponent_format);
exit(1);
}
res = test_all(argv[1], argv[2]);
- MSG_clean();
if (res == MSG_OK)
return 0;
XBT_INFO("Total simulation time: %le", MSG_get_clock());
- MSG_clean();
-
#ifdef _MSC_VER
_set_output_format(prev_exponent_format);
#endif
exit(1);
}
test_all(argv[1], argv[2]);
- res = MSG_clean();
if (res == MSG_OK)
return 0;
exit(1);
}
test_all(argv[1], argv[2]);
- res = MSG_clean();
if (res == MSG_OK)
return 0;
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
if (res == MSG_OK)
return 0;
else
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
+
if (res == MSG_OK)
return 0;
else
MSG_launch_application(deployment_file);
MSG_main();
- MSG_clean();
return 0;
}
MSG_launch_application(deployment_file);
MSG_main();
- MSG_clean();
return 0;
}
MSG_launch_application(deployment_file);
MSG_main();
- MSG_clean();
return 0;
}
xbt_dynar_free (&marks);
}
- MSG_clean();
return 0;
} /* end_of_main */
MSG_launch_application(deployment_file);
MSG_main();
- MSG_clean();
return 0;
} /* end_of_main */
MSG_launch_application(deployment_file);
MSG_main();
- MSG_clean();
return 0;
}
char *platform_file = argv[1];
MSG_create_environment(platform_file);
MSG_main();
- MSG_clean();
return 0;
}
FILE *fp;
fp = fopen ("triva_graph.plist", "w");
if (!fp){
- MSG_clean();
return 1;
}
fprintf (fp, "{\n node = (");
fprintf (fp, "}\n");
fclose (fp);
- MSG_clean();
return 0;
}
p Test of the management of failed tasks simdag
-$ $SG_TEST_EXENV ./sd_fail
+$ $SG_TEST_EXENV ${bindir:=.}/sd_fail
> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
> [0.000000] [sd_fail/INFO] First test: COMP_SEQ task
> [0.000000] [sd_fail/INFO] Schedule task 'Poor task' on workstation 'Faulty Host'
int main(int argc, char **argv)
{
- int recv_buff, err, size, rank;
+ int x,y, err, size, rank;
MPI_Status status;
/* Initialize MPI */
}
if (rank % 3 == 0) {
- MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
- printf("(%d) receive %d\n", rank, recv_buff);
- MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
- printf("(%d) receive %d\n", rank, recv_buff);
+ MPI_Recv(&x, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+ printf("(%d) x <- %d\n", rank, x);
+ MPI_Recv(&y, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+ printf("(%d) y <- %d\n", rank, y);
}else{
MPI_Send(&rank, 1, MPI_INT, (rank / 3) * 3, 42, MPI_COMM_WORLD);
printf("Sent %d to rank %d\n", rank, (rank / 3) * 3);
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
> [Tremblay:0:(0) 0.000000] [smpi_replay/VERBOSE] 0 comm_size 3 0.000000
-> [Fafard:2:(0) 75.475893] [smpi_replay/VERBOSE] 2 bcast 5e8 75.475893
-> [Fafard:2:(0) 82.029316] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424
-> [Jupiter:1:(0) 85.401170] [smpi_replay/VERBOSE] 1 bcast 5e8 85.401170
-> [Tremblay:0:(0) 85.401170] [smpi_replay/VERBOSE] 0 bcast 5e8 85.401170
-> [Jupiter:1:(0) 88.022539] [smpi_replay/VERBOSE] 1 compute 2e8 2.621369
-> [Tremblay:0:(0) 90.498269] [smpi_replay/VERBOSE] 0 compute 5e8 5.097100
-> [Fafard:2:(0) 165.974172] [smpi_replay/VERBOSE] 2 bcast 5e8 83.944856
-> [Fafard:2:(0) 172.527595] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424
-> [Jupiter:1:(0) 175.899449] [smpi_replay/VERBOSE] 1 bcast 5e8 87.876910
-> [Tremblay:0:(0) 175.899449] [smpi_replay/VERBOSE] 0 bcast 5e8 85.401180
-> [Jupiter:1:(0) 178.520818] [smpi_replay/VERBOSE] 1 compute 2e8 2.621369
-> [Tremblay:0:(0) 180.996549] [smpi_replay/VERBOSE] 0 compute 5e8 5.097100
-> [Fafard:2:(0) 256.472441] [smpi_replay/VERBOSE] 2 reduce 5e8 5e8 83.944846
-> [Jupiter:1:(0) 266.397728] [smpi_replay/VERBOSE] 1 reduce 5e8 5e8 87.876910
-> [Tremblay:0:(0) 266.397728] [smpi_replay/VERBOSE] 0 reduce 5e8 5e8 85.401180
-> [Tremblay:0:(0) 266.397728] [smpi_replay/INFO] Simulation time 266.398
+> [Fafard:2:(0) 65.176535] [smpi_replay/VERBOSE] 2 bcast 5e8 65.176535
+> [Fafard:2:(0) 71.729958] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424
+> [Jupiter:1:(0) 73.739750] [smpi_replay/VERBOSE] 1 bcast 5e8 73.739750
+> [Tremblay:0:(0) 73.739750] [smpi_replay/VERBOSE] 0 bcast 5e8 73.739750
+> [Jupiter:1:(0) 76.361119] [smpi_replay/VERBOSE] 1 compute 2e8 2.621369
+> [Tremblay:0:(0) 78.836850] [smpi_replay/VERBOSE] 0 compute 5e8 5.097100
+> [Fafard:2:(0) 144.013395] [smpi_replay/VERBOSE] 2 bcast 5e8 72.283436
+> [Fafard:2:(0) 150.566818] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424
+> [Jupiter:1:(0) 152.576610] [smpi_replay/VERBOSE] 1 bcast 5e8 76.215490
+> [Tremblay:0:(0) 152.576610] [smpi_replay/VERBOSE] 0 bcast 5e8 73.739760
+> [Jupiter:1:(0) 155.197979] [smpi_replay/VERBOSE] 1 compute 2e8 2.621369
+> [Tremblay:0:(0) 157.673709] [smpi_replay/VERBOSE] 0 compute 5e8 5.097100
+> [Fafard:2:(0) 222.850244] [smpi_replay/VERBOSE] 2 reduce 5e8 5e8 72.283426
+> [Jupiter:1:(0) 231.413469] [smpi_replay/VERBOSE] 1 reduce 5e8 5e8 76.215490
+> [Tremblay:0:(0) 231.413469] [smpi_replay/VERBOSE] 0 reduce 5e8 5e8 73.739760
+> [Tremblay:0:(0) 231.413469] [smpi_replay/INFO] Simulation time 231.413
+
p The same with tracing activated
$ ../../bin/smpirun --log=replay.thresh:critical --log=no_loc --cfg=tracing:1 --cfg=tracing/smpi:1 --cfg=tracing/smpi/computing:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/one_trace
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to '1'
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to '1'
> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [Tremblay:0:(0) 266.397728] [smpi_replay/INFO] Simulation time 266.398
+> [Tremblay:0:(0) 231.413469] [smpi_replay/INFO] Simulation time 231.413
+
$ cat ./simgrid.trace
> #This file was generated using SimGrid-3.8.0
> 12 0 2 3 4
> 13 0 2 3
> 12 0 2 3 5
-> 13 75.475893 2 3
-> 12 75.475893 2 3 4
-> 13 82.029316 2 3
-> 12 82.029316 2 3 5
-> 13 85.401170 2 2
-> 12 85.401170 2 2 4
-> 13 85.401170 2 1
-> 12 85.401170 2 1 4
+> 13 65.176535 2 3
+> 12 65.176535 2 3 4
+> 13 71.729958 2 3
+> 12 71.729958 2 3 5
+> 13 73.739750 2 2
+> 12 73.739750 2 2 4
+> 13 73.739750 2 1
+> 12 73.739750 2 1 4
> 5 6 2 action_reduce "0 1 0"
-> 13 88.022539 2 2
-> 12 88.022539 2 2 5
-> 13 90.498269 2 1
-> 12 90.498269 2 1 5
-> 13 165.974172 2 3
-> 12 165.974172 2 3 4
-> 13 172.527595 2 3
-> 12 172.527595 2 3 6
-> 13 175.899449 2 2
-> 12 175.899449 2 2 4
-> 13 175.899449 2 1
-> 12 175.899449 2 1 4
-> 13 178.520818 2 2
-> 12 178.520818 2 2 6
-> 13 180.996549 2 1
-> 12 180.996549 2 1 6
-> 13 256.472441 2 3
-> 12 256.472441 2 3 4
-> 13 256.472442 2 3
-> 7 256.472442 1 3
-> 13 266.397728 2 2
-> 12 266.397728 2 2 4
-> 13 266.397728 2 1
-> 12 266.397728 2 1 4
-> 13 266.397729 2 1
-> 7 266.397729 1 1
-> 13 266.397729 2 2
-> 7 266.397729 1 2
+> 13 76.361119 2 2
+> 12 76.361119 2 2 5
+> 13 78.836850 2 1
+> 12 78.836850 2 1 5
+> 13 144.013395 2 3
+> 12 144.013395 2 3 4
+> 13 150.566818 2 3
+> 12 150.566818 2 3 6
+> 13 152.576610 2 2
+> 12 152.576610 2 2 4
+> 13 152.576610 2 1
+> 12 152.576610 2 1 4
+> 13 155.197979 2 2
+> 12 155.197979 2 2 6
+> 13 157.673709 2 1
+> 12 157.673709 2 1 6
+> 13 222.850244 2 3
+> 12 222.850244 2 3 4
+> 13 222.850244 2 3
+> 7 222.850244 1 3
+> 13 231.413469 2 2
+> 12 231.413469 2 2 4
+> 13 231.413469 2 2
+> 7 231.413469 1 2
+> 13 231.413469 2 1
+> 12 231.413469 2 1 4
+> 13 231.413469 2 1
+> 7 231.413469 1 1
+
$ rm -f ./simgrid.trace
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [Tremblay:0:(0) 0.173741] [smpi_replay/VERBOSE] 0 send 1 1e6 0.173741
-> [Jupiter:1:(0) 0.173741] [smpi_replay/VERBOSE] 1 recv 0 1e6 0.173741
-> [Jupiter:1:(0) 13.280588] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847
-> [Jupiter:1:(0) 13.280588] [smpi_replay/VERBOSE] 1 Isend 0 1e6 0.000000
-> [Jupiter:1:(0) 13.280588] [smpi_replay/VERBOSE] 1 Irecv 0 1e6 0.000000
-> [Tremblay:0:(0) 13.593030] [smpi_replay/VERBOSE] 0 recv 1 1e6 13.419289
-> [Jupiter:1:(0) 13.905472] [smpi_replay/VERBOSE] 1 wait 0.624884
-> [Tremblay:0:(0) 13.905472] [smpi_replay/VERBOSE] 0 send 1 1e6 0.312442
-> [Tremblay:0:(0) 13.905472] [smpi_replay/INFO] Simulation time 13.9055
+> [Tremblay:0:(0) 0.164463] [smpi_replay/VERBOSE] 0 send 1 1e6 0.164463
+> [Jupiter:1:(0) 0.164463] [smpi_replay/VERBOSE] 1 recv 0 1e6 0.164463
+> [Jupiter:1:(0) 13.271310] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847
+> [Jupiter:1:(0) 13.271310] [smpi_replay/VERBOSE] 1 Isend 0 1e6 0.000000
+> [Jupiter:1:(0) 13.271310] [smpi_replay/VERBOSE] 1 Irecv 0 1e6 0.000000
+> [Tremblay:0:(0) 13.574474] [smpi_replay/VERBOSE] 0 recv 1 1e6 13.410011
+> [Jupiter:1:(0) 13.877637] [smpi_replay/VERBOSE] 1 wait 0.606328
+> [Tremblay:0:(0) 13.877637] [smpi_replay/VERBOSE] 0 send 1 1e6 0.303164
+> [Tremblay:0:(0) 13.877637] [smpi_replay/INFO] Simulation time 13.8776
XBT_PUBLIC(void) MSG_init_nocheck(int *argc, char **argv);
XBT_PUBLIC(msg_error_t) MSG_main(void);
-XBT_PUBLIC(msg_error_t) MSG_clean(void);
XBT_PUBLIC(void) MSG_function_register(const char *name,
xbt_main_func_t code);
XBT_PUBLIC(void) MSG_function_register_default(xbt_main_func_t code);
#define MSG_process_change_host(h) MSG_process_migrate(MSG_process_self(),h);
XBT_PUBLIC(msg_error_t) MSG_get_errno(void);
+XBT_PUBLIC(msg_error_t) MSG_clean(void);
+
XBT_PUBLIC(msg_error_t) MSG_task_get(msg_task_t * task, m_channel_t channel);
XBT_PUBLIC(msg_error_t) MSG_task_get_with_timeout(msg_task_t * task,
m_channel_t channel,
/********************************** Global ************************************/
/* Initialization and exit */
XBT_PUBLIC(void) SIMIX_global_init(int *argc, char **argv);
-XBT_PUBLIC(void) SIMIX_clean(void);
XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_pfn_smxprocess_t function);
#define MPI_UNEQUAL 2
#define MPI_CONGRUENT 3
#define MPI_WTIME_IS_GLOBAL 1
+#define MPI_TAG_UB 1000000
+#define MPI_HOST 0
+#define MPI_IO 0
+
typedef ptrdiff_t MPI_Aint;
typedef long long MPI_Offset;
(int incount, MPI_Request requests[],
int *outcount, int *indices,
MPI_Status status[]));
-
+MPI_CALL(XBT_PUBLIC(int), MPI_Testsome,
+ (int incount, MPI_Request requests[],
+ int *outcount, int *indices,
+ MPI_Status status[]));
MPI_CALL(XBT_PUBLIC(int), MPI_Bcast,
(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm));
MPI_CALL(XBT_PUBLIC(int), MPI_Cancel, (MPI_Request* request));
MPI_CALL(XBT_PUBLIC(int), MPI_Buffer_attach, (void* buffer, int size));
MPI_CALL(XBT_PUBLIC(int), MPI_Buffer_detach, (void* buffer, int* size));
-MPI_CALL(XBT_PUBLIC(int), MPI_Testsome, (int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses));
MPI_CALL(XBT_PUBLIC(int), MPI_Comm_test_inter, (MPI_Comm comm, int* flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_attr, (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag));
MPI_CALL(XBT_PUBLIC(int), MPI_Unpack, (void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm));
MPI_CALL(XBT_PUBLIC(int), MPI_Ssend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
MPI_CALL(XBT_PUBLIC(int), MPI_Ssend_init, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request));
* @{
*/
/** @brief Kill the program in silence */
+#ifdef COVERAGE
+/* Call __gcov_flush on abort when compiling with coverage options. */
+#define xbt_abort() \
+ do { \
+ extern void __gcov_flush(void); \
+ __gcov_flush(); \
+ abort(); \
+ } while (0)
+#else
#define xbt_abort() abort()
+#endif
/**
* @brief Kill the program with an error message
volatile bw_request_t request = *(bw_request_t *) payload;
bw_request_t answer;
xbt_ex_t e;
- int port;
- int tooshort = 1;
+ volatile int port;
+ volatile int tooshort = 1;
gras_msg_cb_ctx_t ctx_reask;
static xbt_dynar_t msgtwaited = NULL;
*/
static int simgrid_gc(lua_State * L)
{
- if (sglua_is_maestro(L)) {
- MSG_clean();
- }
+ // There is no need to cleanup the C world anymore, as it gets cleaned at system process closing automatically
+ // Maybe at some point we'll want to reintroduce this, for example when encapsulating the simulation properly
+ //if (sglua_is_maestro(L)) {
+ // MSG_clean();
+ //}
return 0;
}
gras_socket_server_range(unsigned short minport, unsigned short maxport,
unsigned long int buf_size, int measurement)
{
-
- int port;
+ volatile int port;
xbt_socket_t res = NULL;
xbt_ex_t e;
return;
}
-void gras_clean()
-{
- SIMIX_clean();
+void gras_clean(){ /* this function is not needed anymore and could be removed, but I feel so lazy */
}
"Logging specific to MSG (kernel)");
MSG_Global_t msg_global = NULL;
+static void MSG_exit(void);
/********************************* MSG **************************************/
XBT_DEBUG("ADD MSG LEVELS");
MSG_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __MSG_host_destroy);
+
+ atexit(MSG_exit);
}
#ifdef MSG_USE_DEPRECATED
}
-/** \ingroup msg_simulation
- * \brief Clean the MSG simulation
- */
-msg_error_t MSG_clean(void)
-{
- XBT_DEBUG("Closing MSG");
+static void MSG_exit(void) {
+ if (msg_global==NULL)
+ return;
#ifdef HAVE_TRACING
TRACE_surf_release();
#endif
- MSG_process_killall(0);
-
/* initialization of the action module */
_MSG_action_exit();
TRACE_end();
#endif
- SIMIX_clean();
-
xbt_swag_free(msg_global->vms);
free(msg_global);
msg_global = NULL;
-
- return MSG_OK;
}
{
return msg_global->sent_msg;
}
+
+#ifdef MSG_USE_DEPRECATED
+msg_error_t MSG_clean(void) {
+ return MSG_OK;
+}
+#endif
}
/**
- * \brief This function is called by SIMIX to copy the data of a comm.
+ * \brief This function is called by SIMIX in kernel mode to copy the data of a comm.
* \param comm the comm
* \param buff the data copied
* \param buff_size size of the buffer
static void SIMIX_action_mallocator_free_f(void* action);
static void SIMIX_action_mallocator_reset_f(void* action);
+static void SIMIX_clean(void);
+
/* FIXME: Yeah, I'll do it in a portable maner one day [Mt] */
#include <signal.h>
XBT_DEBUG("ADD SIMIX LEVELS");
SIMIX_HOST_LEVEL = xbt_lib_add_level(host_lib,SIMIX_host_destroy);
+
+ atexit(SIMIX_clean);
}
/**
*
* This functions remove the memory used by SIMIX
*/
-void SIMIX_clean(void)
+static void SIMIX_clean(void)
{
#ifdef TIME_BENCH_PER_SR
smx_ctx_raw_new_sr();
XBT_DEBUG("iprobe from %p %p\n", rdv, rdv->comm_fifo);
smx_action_t this_action = SIMIX_comm_new(SIMIX_COMM_RECEIVE);
- smx_action_t other_action;
+ smx_action_t other_action=NULL;
if(rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0){
//find a match in the already received fifo
+ XBT_DEBUG("first try in the perm recv mailbox \n");
+
other_action = SIMIX_fifo_probe_comm(rdv->done_comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
- }else{
- other_action = SIMIX_fifo_probe_comm(rdv->comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
}
+ // }else{
+ if(!other_action){
+ XBT_DEBUG("second try in the other mailbox");
+ other_action = SIMIX_fifo_probe_comm(rdv->comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
+ }
+// }
if(other_action)other_action->comm.refcount--;
SIMIX_comm_destroy(this_action);
void smpi_datatype_commit(MPI_Datatype* datatype);
-
+void smpi_empty_status(MPI_Status * status);
MPI_Op smpi_op_new(MPI_User_function * function, int commute);
void smpi_op_destroy(MPI_Op op);
void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
int smpi_mpi_testall(int count, MPI_Request requests[],
MPI_Status status[]);
void smpi_mpi_probe(int source, int tag, MPI_Comm comm, MPI_Status* status);
-MPI_Request smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag,
+void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag,
MPI_Status* status);
int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype);
void smpi_mpi_wait(MPI_Request * request, MPI_Status * status);
MPI_Status status[]);
int smpi_mpi_waitsome(int incount, MPI_Request requests[], int *indices,
MPI_Status status[]);
+int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices,
+ MPI_Status status[]);
void smpi_mpi_bcast(void *buf, int count, MPI_Datatype datatype, int root,
MPI_Comm comm);
void smpi_mpi_barrier(MPI_Comm comm);
static int match_recv(void* a, void* b, smx_action_t ignored) {
- MPI_Request ref = (MPI_Request)a;
- MPI_Request req = (MPI_Request)b;
+ MPI_Request ref = (MPI_Request)a;
+ MPI_Request req = (MPI_Request)b;
+ XBT_DEBUG("Trying to match a recv of src %d against %d, tag %d against %d",ref->src,req->src, ref->tag, req->tag);
xbt_assert(ref, "Cannot match recv against null reference");
xbt_assert(req, "Cannot match recv against null request");
}
static int match_send(void* a, void* b,smx_action_t ignored) {
- MPI_Request ref = (MPI_Request)a;
- MPI_Request req = (MPI_Request)b;
-
- xbt_assert(ref, "Cannot match send against null reference");
- xbt_assert(req, "Cannot match send against null request");
- return (req->src == MPI_ANY_SOURCE || req->src == ref->src)
- && (req->tag == MPI_ANY_TAG || req->tag == ref->tag);
+ MPI_Request ref = (MPI_Request)a;
+ MPI_Request req = (MPI_Request)b;
+ XBT_DEBUG("Trying to match a send of src %d against %d, tag %d against %d",ref->src,req->src, ref->tag, req->tag);
+ xbt_assert(ref, "Cannot match send against null reference");
+ xbt_assert(req, "Cannot match send against null request");
+ return (req->src == MPI_ANY_SOURCE || req->src == ref->src)
+ && (req->tag == MPI_ANY_TAG || req->tag == ref->tag);
}
static MPI_Request build_request(void *buf, int count,
return request;
}
+
+void smpi_empty_status(MPI_Status * status) {
+ if(status != MPI_STATUS_IGNORE) {
+ status->MPI_SOURCE=MPI_ANY_SOURCE;
+ status->MPI_TAG=MPI_ANY_TAG;
+ status->count=0;
+ }
+}
+
void smpi_action_trace_run(char *path)
{
char *name;
request->action = simcall_comm_irecv(mailbox, request->buf, &request->size, &match_recv, request);
} else {
print_request("New send", request);
-
- if (request->size < xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres")) { // eager mode => detached send (FIXME: this limit should be configurable)
+ if (request->size < xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres")) { // eager mode
mailbox = smpi_process_remote_mailbox_small(
smpi_group_index(smpi_comm_group(request->comm), request->dst));
}else{
int smpi_mpi_test(MPI_Request * request, MPI_Status * status) {
int flag;
+ //assume that request is not MPI_REQUEST_NULL (filtered in PMPI_Test or smpi_mpi_testall before)
if ((*request)->action == NULL)
flag = 1;
else
flag = simcall_comm_test((*request)->action);
if(flag) {
finish_wait(request, status);
+ }else{
+ smpi_empty_status(status);
}
return flag;
}
map = xbt_new(int, count);
size = 0;
for(i = 0; i < count; i++) {
- if(requests[i]->action) {
- xbt_dynar_push(comms, &requests[i]->action);
- map[size] = i;
- size++;
+ if((requests[i]!=MPI_REQUEST_NULL) && requests[i]->action) {
+ xbt_dynar_push(comms, &requests[i]->action);
+ map[size] = i;
+ size++;
}
}
if(size > 0) {
i = simcall_comm_testany(comms);
- // FIXME: MPI_UNDEFINED or does SIMIX have a return code?
- if(i != MPI_UNDEFINED) {
+ // not MPI_UNDEFINED, as this is a simix return code
+ if(i != -1) {
*index = map[i];
- smpi_mpi_wait(&requests[*index], status);
+ finish_wait(&requests[*index], status);
flag = 1;
}
+ }else{
+ //all requests are null or inactive, return true
+ flag=1;
+ smpi_empty_status(status);
}
xbt_free(map);
xbt_dynar_free(&comms);
}
+
return flag;
}
int smpi_mpi_testall(int count, MPI_Request requests[],
MPI_Status status[])
{
+ MPI_Status stat;
+ MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
int flag=1;
int i;
- for(i=0; i<count; i++)
- if (smpi_mpi_test(&requests[i], &status[i])!=1)
- flag=0;
-
+ for(i=0; i<count; i++){
+ if(requests[i]!= MPI_REQUEST_NULL){
+ if (smpi_mpi_test(&requests[i], pstat)!=1){
+ flag=0;
+ }
+ }else{
+ smpi_empty_status(pstat);
+ }
+ if(status != MPI_STATUSES_IGNORE) {
+ memcpy(&status[i], pstat, sizeof(*pstat));
+ }
+ }
return flag;
}
int flag=0;
//FIXME find another wait to avoid busy waiting ?
// the issue here is that we have to wait on a nonexistent comm
- MPI_Request request;
while(flag==0){
- request = smpi_mpi_iprobe(source, tag, comm, &flag, status);
+ smpi_mpi_iprobe(source, tag, comm, &flag, status);
XBT_DEBUG("Busy Waiting on probing : %d", flag);
if(!flag) {
- smpi_mpi_request_free(&request);
simcall_process_sleep(0.0001);
}
}
}
-MPI_Request smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status){
- MPI_Request request = build_request(NULL, 0, MPI_CHAR, source, smpi_comm_rank(comm), tag,
- comm, NON_PERSISTENT | RECV);
+void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status){
+ MPI_Request request =build_request(NULL, 0, MPI_CHAR, source, smpi_comm_rank(comm), tag,
+ comm, NON_PERSISTENT | RECV);
+
// behave like a receive, but don't do it
smx_rdv_t mailbox;
print_request("New iprobe", request);
// We have to test both mailboxes as we don't know if we will receive one one or another
- if (xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres")>0){
- mailbox = smpi_process_mailbox_small();
- request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);
-
- }
- if (request->action==NULL){
- mailbox = smpi_process_mailbox();
- request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);
- }
+ if (xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres")>0){
+ mailbox = smpi_process_mailbox_small();
+ XBT_DEBUG("trying to probe the perm recv mailbox");
+ request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);
+ }
+ if (request->action==NULL){
+ mailbox = smpi_process_mailbox();
+ XBT_DEBUG("trying to probe the other mailbox");
+ request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);
+ }
if(request->action){
MPI_Request req = (MPI_Request)SIMIX_comm_get_src_data(request->action);
}
}
else *flag=false;
+ smpi_mpi_request_free(&request);
- return request;
+ return;
}
void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
if(size > 0) {
i = simcall_comm_waitany(comms);
- // FIXME: MPI_UNDEFINED or does SIMIX have a return code?
- if (i != MPI_UNDEFINED) {
+ // not MPI_UNDEFINED, as this is a simix return code
+ if (i != -1) {
index = map[i];
finish_wait(&requests[index], status);
-
}
}
xbt_free(map);
xbt_dynar_free(&comms);
}
+
+ if (index==MPI_UNDEFINED)
+ smpi_empty_status(status);
+
return index;
}
void smpi_mpi_waitall(int count, MPI_Request requests[],
MPI_Status status[])
{
- int index, c;
+ int index, c;
MPI_Status stat;
- MPI_Status *pstat = status == MPI_STATUS_IGNORE ? MPI_STATUS_IGNORE : &stat;
-
+ MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
+ //tag invalid requests in the set
for(c = 0; c < count; c++) {
- if(MC_IS_ENABLED) {
- smpi_mpi_wait(&requests[c], pstat);
- index = c;
- } else {
- index = smpi_mpi_waitany(count, requests, pstat);
- if(index == MPI_UNDEFINED) {
- break;
+ if(requests[c]==MPI_REQUEST_NULL || requests[c]->dst == MPI_PROC_NULL ){
+ if(status != MPI_STATUSES_IGNORE)
+ smpi_empty_status(&status[c]);
+ }else if(requests[c]->src == MPI_PROC_NULL ){
+ if(status != MPI_STATUSES_IGNORE) {
+ smpi_empty_status(&status[c]);
+ status[c].MPI_SOURCE=MPI_PROC_NULL;
}
}
- if(status != MPI_STATUS_IGNORE) {
- memcpy(&status[index], pstat, sizeof(*pstat));
+ }
+
+ for(c = 0; c < count; c++) {
+ if(MC_IS_ENABLED) {
+ smpi_mpi_wait(&requests[c], pstat);
+ index = c;
+ } else {
+ index = smpi_mpi_waitany(count, requests, pstat);
+ if(index == MPI_UNDEFINED) {
+ break;
+ }
+ if(status != MPI_STATUSES_IGNORE) {
+ memcpy(&status[index], pstat, sizeof(*pstat));
+
+ }
}
}
}
MPI_Status status[])
{
int i, count, index;
+ MPI_Status stat;
+ MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
count = 0;
- for(i = 0; i < incount; i++) {
- if(smpi_mpi_testany(incount, requests, &index, status)) {
+ for(i = 0; i < incount; i++)
+ {
+ index=smpi_mpi_waitany(incount, requests, pstat);
+ if(index!=MPI_UNDEFINED){
indices[count] = index;
count++;
+ if(status != MPI_STATUSES_IGNORE) {
+ memcpy(&status[index], pstat, sizeof(*pstat));
+ }
+ }else{
+ return MPI_UNDEFINED;
}
}
return count;
}
+int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices,
+ MPI_Status status[])
+{
+ int i, count, count_dead;
+ MPI_Status stat;
+ MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
+
+ count = 0;
+ for(i = 0; i < incount; i++) {
+ if((requests[i] != MPI_REQUEST_NULL)) {
+ if(smpi_mpi_test(&requests[i], pstat)) {
+ indices[count] = i;
+ count++;
+ if(status != MPI_STATUSES_IGNORE) {
+ memcpy(&status[i], pstat, sizeof(*pstat));
+ }
+ }
+ }else{
+ count_dead++;
+ }
+ }
+ if(count_dead==incount)return MPI_UNDEFINED;
+ else return count;
+}
+
void smpi_mpi_bcast(void *buf, int count, MPI_Datatype datatype, int root,
MPI_Comm comm)
{
smpi_mpi_startall(size - 1, requests);
for(src = 0; src < size - 1; src++) {
index = smpi_mpi_waitany(size - 1, requests, MPI_STATUS_IGNORE);
- XBT_VERB("finished waiting any request with index %d", index);
+ XBT_DEBUG("finished waiting any request with index %d", index);
if(index == MPI_UNDEFINED) {
break;
}
TRACE_end();
#endif
- SIMIX_clean();
return 0;
}
return PMPI_Comm_size(comm, size);
}
+int MPI_Comm_get_attr (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag)
+{
+ return PMPI_Comm_get_attr (comm, comm_keyval, attribute_val, flag);
+}
+
int MPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
{
return PMPI_Comm_get_name(comm, name, len);
retval = MPI_ERR_ARG;
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
+ } else if (dst == MPI_PROC_NULL) {
+ retval = MPI_SUCCESS;
} else {
*request = smpi_mpi_send_init(buf, count, datatype, dst, tag, comm);
retval = MPI_SUCCESS;
retval = MPI_ERR_ARG;
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
+ } else if (src == MPI_PROC_NULL) {
+ retval = MPI_SUCCESS;
} else {
*request = smpi_mpi_recv_init(buf, count, datatype, src, tag, comm);
retval = MPI_SUCCESS;
int retval;
smpi_bench_end();
- if (request == NULL) {
+ if (request == NULL || *request == MPI_REQUEST_NULL) {
retval = MPI_ERR_ARG;
} else {
smpi_mpi_start(*request);
int retval;
smpi_bench_end();
- if (request == NULL) {
+ if (request == MPI_REQUEST_NULL) {
retval = MPI_ERR_ARG;
} else {
smpi_mpi_request_free(request);
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
- int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+ int src_traced = smpi_group_index(smpi_comm_group(comm), src);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
#endif
if (request == NULL) {
retval = MPI_ERR_ARG;
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
+ }else if (src == MPI_PROC_NULL) {
+ *request = MPI_REQUEST_NULL;
+ retval = MPI_SUCCESS;
} else {
*request = smpi_mpi_irecv(buf, count, datatype, src, tag, comm);
retval = MPI_SUCCESS;
int retval;
smpi_bench_end();
-#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
- TRACE_smpi_computing_out(rank);
- int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
- TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
- TRACE_smpi_send(rank, rank, dst_traced);
-#endif
if (request == NULL) {
retval = MPI_ERR_ARG;
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
+ } else if (dst == MPI_PROC_NULL) {
+ *request = MPI_REQUEST_NULL;
+ retval = MPI_SUCCESS;
} else {
+
+#ifdef HAVE_TRACING
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+ TRACE_smpi_computing_out(rank);
+ int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
+ TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
+ TRACE_smpi_send(rank, rank, dst_traced);
+#endif
+
*request = smpi_mpi_isend(buf, count, datatype, dst, tag, comm);
retval = MPI_SUCCESS;
- }
+
#ifdef HAVE_TRACING
TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
(*request)->send = 1;
TRACE_smpi_computing_in(rank);
#endif
+ }
+
smpi_bench_begin();
return retval;
}
int retval;
smpi_bench_end();
+
+ if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (src == MPI_PROC_NULL) {
+ smpi_empty_status(status);
+ status->MPI_SOURCE = MPI_PROC_NULL;
+ retval = MPI_SUCCESS;
+ } else {
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
- int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+ int src_traced = smpi_group_index(smpi_comm_group(comm), src);
TRACE_smpi_computing_out(rank);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
#endif
- if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
- } else {
+
smpi_mpi_recv(buf, count, datatype, src, tag, comm, status);
retval = MPI_SUCCESS;
- }
+
#ifdef HAVE_TRACING
//the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
- if(status!=MPI_STATUS_IGNORE)src_traced = smpi_group_rank(smpi_comm_group(comm), status->MPI_SOURCE);
+ if(status!=MPI_STATUS_IGNORE)src_traced = smpi_group_index(smpi_comm_group(comm), status->MPI_SOURCE);
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
TRACE_smpi_recv(rank, src_traced, rank);
TRACE_smpi_computing_in(rank);
#endif
+ }
+
smpi_bench_begin();
return retval;
}
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
+ int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
TRACE_smpi_send(rank, rank, dst_traced);
#endif
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
+ } else if (dst == MPI_PROC_NULL) {
+ retval = MPI_SUCCESS;
} else {
smpi_mpi_send(buf, count, datatype, dst, tag, comm);
retval = MPI_SUCCESS;
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
- int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
+ int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
+ int src_traced = smpi_group_index(smpi_comm_group(comm), src);
TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
TRACE_smpi_send(rank, rank, dst_traced);
TRACE_smpi_send(rank, src_traced, rank);
} else if (sendtype == MPI_DATATYPE_NULL
|| recvtype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
+ } else if (src == MPI_PROC_NULL || dst == MPI_PROC_NULL) {
+ smpi_empty_status(status);
+ status->MPI_SOURCE = MPI_PROC_NULL;
+ retval = MPI_SUCCESS;
} else {
smpi_mpi_sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf,
recvcount, recvtype, src, recvtag, comm, status);
int retval;
smpi_bench_end();
- if (request == NULL || flag == NULL) {
+ if (request == MPI_REQUEST_NULL || flag == NULL) {
retval = MPI_ERR_ARG;
} else if (*request == MPI_REQUEST_NULL) {
+ *flag= TRUE;
retval = MPI_ERR_REQUEST;
} else {
*flag = smpi_mpi_test(request, status);
smpi_bench_end();
if (status == NULL) {
- retval = MPI_ERR_ARG;
- }else if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
+ retval = MPI_ERR_ARG;
+ } else if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (source == MPI_PROC_NULL) {
+ smpi_empty_status(status);
+ status->MPI_SOURCE = MPI_PROC_NULL;
+ retval = MPI_SUCCESS;
} else {
- smpi_mpi_probe(source, tag, comm, status);
- retval = MPI_SUCCESS;
+ smpi_mpi_probe(source, tag, comm, status);
+ retval = MPI_SUCCESS;
}
smpi_bench_begin();
return retval;
smpi_bench_end();
if (flag == NULL) {
- retval = MPI_ERR_ARG;
- }else if (status == NULL) {
- retval = MPI_ERR_ARG;
- }else if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
+ retval = MPI_ERR_ARG;
+ } else if (status == NULL) {
+ retval = MPI_ERR_ARG;
+ } else if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (source == MPI_PROC_NULL) {
+ smpi_empty_status(status);
+ status->MPI_SOURCE = MPI_PROC_NULL;
+ retval = MPI_SUCCESS;
} else {
- smpi_mpi_iprobe(source, tag, comm, flag, status);
- retval = MPI_SUCCESS;
+ smpi_mpi_iprobe(source, tag, comm, flag, status);
+ retval = MPI_SUCCESS;
}
smpi_bench_begin();
return retval;
int retval;
smpi_bench_end();
+
+ if (request == NULL) {
+ retval = MPI_ERR_ARG;
+ } else if (*request == MPI_REQUEST_NULL) {
+ retval = MPI_ERR_REQUEST;
+ } else {
+
#ifdef HAVE_TRACING
int rank = request && (*request)->comm != MPI_COMM_NULL
- ? smpi_comm_rank((*request)->comm)
+ ? smpi_process_index()
: -1;
TRACE_smpi_computing_out(rank);
MPI_Group group = smpi_comm_group((*request)->comm);
- int src_traced = smpi_group_rank(group, (*request)->src);
- int dst_traced = smpi_group_rank(group, (*request)->dst);
+ int src_traced = smpi_group_index(group, (*request)->src);
+ int dst_traced = smpi_group_index(group, (*request)->dst);
int is_wait_for_receive = (*request)->recv;
TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
#endif
- if (request == NULL) {
- retval = MPI_ERR_ARG;
- } else if (*request == MPI_REQUEST_NULL) {
- retval = MPI_ERR_REQUEST;
- } else {
+
smpi_mpi_wait(request, status);
retval = MPI_SUCCESS;
- }
+
#ifdef HAVE_TRACING
TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
if (is_wait_for_receive) {
TRACE_smpi_recv(rank, src_traced, dst_traced);
}
TRACE_smpi_computing_in(rank);
-
#endif
+
+ }
+
smpi_bench_begin();
return retval;
}
xbt_free(t);
}
}
- int rank_traced = smpi_comm_rank(MPI_COMM_WORLD);
+ int rank_traced = smpi_process_index();
TRACE_smpi_computing_out(rank_traced);
TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), NULL);
xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), NULL);
for (i = 0; i < count; i++) {
- MPI_Request req = requests[i]; //all req should be valid in Waitall
- int *asrc = xbt_new(int, 1);
- int *adst = xbt_new(int, 1);
- int *arecv = xbt_new(int, 1);
- *asrc = req->src;
- *adst = req->dst;
- *arecv = req->recv;
- xbt_dynar_insert_at(srcs, i, asrc);
- xbt_dynar_insert_at(dsts, i, adst);
- xbt_dynar_insert_at(recvs, i, arecv);
- xbt_free(asrc);
- xbt_free(adst);
- xbt_free(arecv);
- }
- int rank_traced = smpi_comm_rank (MPI_COMM_WORLD);
+ MPI_Request req = requests[i];
+ if(req){
+ int *asrc = xbt_new(int, 1);
+ int *adst = xbt_new(int, 1);
+ int *arecv = xbt_new(int, 1);
+ *asrc = req->src;
+ *adst = req->dst;
+ *arecv = req->recv;
+ xbt_dynar_insert_at(srcs, i, asrc);
+ xbt_dynar_insert_at(dsts, i, adst);
+ xbt_dynar_insert_at(recvs, i, arecv);
+ xbt_free(asrc);
+ xbt_free(adst);
+ xbt_free(arecv);
+ }else {
+ int *t = xbt_new(int, 1);
+ xbt_dynar_insert_at(srcs, i, t);
+ xbt_dynar_insert_at(dsts, i, t);
+ xbt_dynar_insert_at(recvs, i, t);
+ xbt_free(t);
+ }
+ }
+ int rank_traced = smpi_process_index();
TRACE_smpi_computing_out(rank_traced);
TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
return retval;
}
+int PMPI_Testsome(int incount, MPI_Request requests[], int* outcount,
+ int* indices, MPI_Status status[])
+{
+ int retval;
+
+ smpi_bench_end();
+ if (outcount == NULL || indices == NULL) {
+ retval = MPI_ERR_ARG;
+ } else {
+ *outcount = smpi_mpi_testsome(incount, requests, indices, status);
+ retval = MPI_SUCCESS;
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
+
int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
{
int retval;
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
+ int root_traced = smpi_group_index(smpi_comm_group(comm), root);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
#endif
if (comm == MPI_COMM_NULL) {
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
+ int root_traced = smpi_group_index(smpi_comm_group(comm), root);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
#endif
if (comm == MPI_COMM_NULL) {
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
+ int root_traced = smpi_group_index(smpi_comm_group(comm), root);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
#endif
if (comm == MPI_COMM_NULL) {
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
+ int root_traced = smpi_group_index(smpi_comm_group(comm), root);
+
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
#endif
if (comm == MPI_COMM_NULL) {
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
+ int root_traced = smpi_group_index(smpi_comm_group(comm), root);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
#endif
if (comm == MPI_COMM_NULL) {
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
- int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
+ int root_traced = smpi_group_index(smpi_comm_group(comm), root);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
#endif
if (comm == MPI_COMM_NULL) {
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
{
int retval, i, size, count;
int *displs;
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
smpi_bench_end();
#ifdef HAVE_TRACING
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
smpi_bench_end();
#ifdef HAVE_TRACING
- int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
return not_yet_implemented();
}
-int PMPI_Testsome(int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses) {
+int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
return not_yet_implemented();
}
-int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
+int PMPI_Comm_get_attr (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag)
+{
return not_yet_implemented();
}
**/
void xbt_datadesc_postexit(void)
{
- XBT_VERB("Exiting DataDesc");
xbt_set_free(&xbt_datadesc_set_local);
xbt_dict_free(&xbt_dd_constants);
- XBT_DEBUG("Exited DataDesc");
}
/** This is mainly to debug */
* This is crude and rather compiler-specific, unfortunately.
*/
static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200);
-static void xbt_postexit(void) _XBT_GNUC_DESTRUCTOR(200);
+static void xbt_postexit(void);
#ifdef _XBT_WIN32
# undef _XBT_NEED_INIT_PRAGMA
#ifdef _XBT_NEED_INIT_PRAGMA
#pragma init (xbt_preinit)
-#pragma fini (xbt_postexit)
#endif
#ifdef _XBT_WIN32
} else if (fdwReason == DLL_PROCESS_DETACH
&& xbt_dll_process_is_attached == 1) {
xbt_dll_process_is_attached = 0;
- xbt_postexit();
}
return 1;
}
xbt_dict_preinit();
xbt_datadesc_preinit();
xbt_trp_preinit();
+
+ atexit(xbt_postexit);
}
static void xbt_postexit(void)
MSG_create_environment(argv[1]);
MSG_launch_application(argv[1]);
res = MSG_main();
- MSG_clean();
+
if (res == MSG_OK)
return 0;
else
/* Run the example. */
res = MSG_main();
- MSG_clean();
-
if (res == MSG_OK)
return 0;
else
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- MSG_clean();
+
if (res == MSG_OK)
return 0;
else
if (status == 0){
XBT_INFO ("%s expects --cfg=tracing:1 --cfg=tracing/platform:1", argv[0]);
}
- MSG_clean();
#else
XBT_INFO ("works only if simgrid was compiled with tracing enabled.");
#endif