1 /* Copyright (c) 2008-2010, 2012-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "simgrid/msg.h"
10 #define FILENAME1 "/sd1/doc/simgrid/examples/cxx/autoDestination/Main.cxx"
12 XBT_LOG_NEW_DEFAULT_CATEGORY(storage,"Messages specific for this simulation");
14 static int host(int argc, char *argv[])
17 sprintf(name,"%s%i", FILENAME1,MSG_process_self_PID());
18 msg_file_t file = MSG_file_open(name, NULL);
19 //MSG_file_read(file, MSG_file_get_size(file));
20 MSG_file_write(file, 500000);
22 XBT_INFO("Size of %s: %llu", MSG_file_get_name(file), MSG_file_get_size(file));
28 int main(int argc, char **argv)
30 MSG_init(&argc, argv);
31 MSG_create_environment(argv[1]);
33 MSG_function_register("host", host);
34 for(int i = 0 ; i<10; i++){
35 MSG_process_create(xbt_strdup("host"), host, NULL, MSG_host_by_name(xbt_strdup("host")));
39 XBT_INFO("Simulation time %g", MSG_get_clock());