Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I shouldn't do dcommit that fast
[simgrid.git] / teshsuite / simdag / network / p2p / test_latency1.c
1
2 /*
3  * SimDag
4  * Latency tests
5  * Copyright (C) 2007 
6  * Sascha Hunold, Frederic Suter
7  */
8
9 #include <stdio.h>
10 #include <stdlib.h>
11
12 #include "simdag/simdag.h"
13
14 /*
15  * simple latency test
16  * send one byte from 0 to 1 
17  * 
18  * this is a test for multiple platforms
19  * see tesh file for expected output
20  * 
21  */
22 int main(int argc, char **argv) {
23         double time;
24         double communication_amount[] = { 0.0, 1.0, 0.0, 0.0 };
25         const double no_cost[] = { 0.0, 0.0 };
26         SD_task_t task;
27
28         SD_init(&argc, argv);
29         SD_create_environment(argv[1]);
30
31         task = SD_task_create("Comm 1", NULL, 1.0);
32
33         SD_task_schedule(task, 2, SD_workstation_get_list(), no_cost,
34                         communication_amount, -1.0);
35
36         SD_simulate(-1.0);
37
38         time = SD_get_clock();
39
40         printf("%g\n", time);
41         fflush(stdout);
42
43         SD_task_destroy(task);
44
45         SD_exit();
46
47         return 0;
48 }
49