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
try to fix some compilation erros
[simgrid.git]
/
src
/
simix
/
smx_io.c
diff --git
a/src/simix/smx_io.c
b/src/simix/smx_io.c
index
365c90b
..
3d388e7
100644
(file)
--- a/
src/simix/smx_io.c
+++ b/
src/simix/smx_io.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2007-2010, 2012-201
4
. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-201
5
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-50,19
+50,19
@@
void SIMIX_storage_destroy(void *s)
}
//SIMIX FILE READ
}
//SIMIX FILE READ
-void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, s
mx
_host_t host)
+void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, s
g
_host_t host)
{
{
- smx_synchro_t synchro = SIMIX_file_read(
simcall->issuer,
fd, size, host);
+ smx_synchro_t synchro = SIMIX_file_read(fd, size, host);
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_read(smx_
process_t process, smx_file_t fd, sg_size_t size, smx
_host_t host)
+smx_synchro_t SIMIX_file_read(smx_
file_t fd, sg_size_t size, sg
_host_t host)
{
smx_synchro_t synchro;
/* check if the host is active */
{
smx_synchro_t synchro;
/* check if the host is active */
- if (surf_
resource_get_state(surf_workstation
_resource_priv(host)) != SURF_RESOURCE_ON) {
+ if (surf_
host_get_state(surf_host
_resource_priv(host)) != SURF_RESOURCE_ON) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
@@
-70,12
+70,10
@@
smx_synchro_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t si
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
-#ifdef HAVE_TRACING
synchro->category = NULL;
synchro->category = NULL;
-#endif
synchro->io.host = host;
synchro->io.host = host;
- synchro->io.surf_io = surf_
workstation
_read(host, fd->surf_file, size);
+ synchro->io.surf_io = surf_
host
_read(host, fd->surf_file, size);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
@@
-84,19
+82,19
@@
smx_synchro_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t si
}
//SIMIX FILE WRITE
}
//SIMIX FILE WRITE
-void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, s
mx
_host_t host)
+void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, s
g
_host_t host)
{
{
- smx_synchro_t synchro = SIMIX_file_write(
simcall->issuer,
fd, size, host);
+ smx_synchro_t synchro = SIMIX_file_write(fd, size, host);
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_write(smx_
process_t process, smx_file_t fd, sg_size_t size, smx
_host_t host)
+smx_synchro_t SIMIX_file_write(smx_
file_t fd, sg_size_t size, sg
_host_t host)
{
smx_synchro_t synchro;
/* check if the host is active */
{
smx_synchro_t synchro;
/* check if the host is active */
- if (surf_
resource_get_state(surf_workstation
_resource_priv(host)) != SURF_RESOURCE_ON) {
+ if (surf_
host_get_state(surf_host
_resource_priv(host)) != SURF_RESOURCE_ON) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
@@
-104,12
+102,10
@@
smx_synchro_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t s
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
-#ifdef HAVE_TRACING
synchro->category = NULL;
synchro->category = NULL;
-#endif
synchro->io.host = host;
synchro->io.host = host;
- synchro->io.surf_io = surf_
workstation
_write(host, fd->surf_file, size);
+ synchro->io.surf_io = surf_
host
_write(host, fd->surf_file, size);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
@@
-118,19
+114,19
@@
smx_synchro_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t s
}
//SIMIX FILE OPEN
}
//SIMIX FILE OPEN
-void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, s
mx
_host_t host)
+void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, s
g
_host_t host)
{
{
- smx_synchro_t synchro = SIMIX_file_open(
simcall->issuer,
fullpath, host);
+ smx_synchro_t synchro = SIMIX_file_open(fullpath, host);
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_open(
smx_process_t process, const char* fullpath, smx
_host_t host)
+smx_synchro_t SIMIX_file_open(
const char* fullpath, sg
_host_t host)
{
smx_synchro_t synchro;
/* check if the host is active */
{
smx_synchro_t synchro;
/* check if the host is active */
- if (surf_
resource_get_state(surf_workstation
_resource_priv(host)) != SURF_RESOURCE_ON) {
+ if (surf_
host_get_state(surf_host
_resource_priv(host)) != SURF_RESOURCE_ON) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
@@
-138,12
+134,10
@@
smx_synchro_t SIMIX_file_open(smx_process_t process, const char* fullpath, smx_h
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
-#ifdef HAVE_TRACING
synchro->category = NULL;
synchro->category = NULL;
-#endif
synchro->io.host = host;
synchro->io.host = host;
- synchro->io.surf_io = surf_
workstation
_open(host, fullpath);
+ synchro->io.surf_io = surf_
host
_open(host, fullpath);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
@@
-152,19
+146,19
@@
smx_synchro_t SIMIX_file_open(smx_process_t process, const char* fullpath, smx_h
}
//SIMIX FILE CLOSE
}
//SIMIX FILE CLOSE
-void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, s
mx
_host_t host)
+void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, s
g
_host_t host)
{
{
- smx_synchro_t synchro = SIMIX_file_close(
simcall->issuer,
fd, host);
+ smx_synchro_t synchro = SIMIX_file_close(fd, host);
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_close(smx_
process_t process, smx_file_t fd, smx
_host_t host)
+smx_synchro_t SIMIX_file_close(smx_
file_t fd, sg
_host_t host)
{
smx_synchro_t synchro;
/* check if the host is active */
{
smx_synchro_t synchro;
/* check if the host is active */
- if (surf_
resource_get_state(surf_workstation
_resource_priv(host)) != SURF_RESOURCE_ON) {
+ if (surf_
host_get_state(surf_host
_resource_priv(host)) != SURF_RESOURCE_ON) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
@@
-172,12
+166,10
@@
smx_synchro_t SIMIX_file_close(smx_process_t process, smx_file_t fd, smx_host_t
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
synchro->type = SIMIX_SYNC_IO;
synchro->name = NULL;
-#ifdef HAVE_TRACING
synchro->category = NULL;
synchro->category = NULL;
-#endif
synchro->io.host = host;
synchro->io.host = host;
- synchro->io.surf_io = surf_
workstation
_close(host, fd->surf_file);
+ synchro->io.surf_io = surf_
host
_close(host, fd->surf_file);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
surf_action_set_data(synchro->io.surf_io, synchro);
XBT_DEBUG("Create io synchro %p", synchro);
@@
-187,20
+179,15
@@
smx_synchro_t SIMIX_file_close(smx_process_t process, smx_file_t fd, smx_host_t
//SIMIX FILE UNLINK
//SIMIX FILE UNLINK
-int simcall_HANDLER_file_unlink(smx_simcall_t simcall, smx_file_t fd, smx_host_t host)
-{
- return SIMIX_file_unlink(simcall->issuer, fd, host);
-}
-
-int SIMIX_file_unlink(smx_process_t process, smx_file_t fd, smx_host_t host)
+int SIMIX_file_unlink(smx_file_t fd, sg_host_t host)
{
/* check if the host is active */
{
/* check if the host is active */
- if (surf_
resource_get_state(surf_workstation
_resource_priv(host)) != SURF_RESOURCE_ON) {
+ if (surf_
host_get_state(surf_host
_resource_priv(host)) != SURF_RESOURCE_ON) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
- int res = surf_
workstation
_unlink(host, fd->surf_file);
+ int res = surf_
host
_unlink(host, fd->surf_file);
xbt_free(fd);
return !!res;
}
xbt_free(fd);
return !!res;
}
@@
-212,8
+199,8
@@
sg_size_t simcall_HANDLER_file_get_size(smx_simcall_t simcall, smx_file_t fd)
sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd)
{
sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd)
{
- s
mx_host_t host = process->smx_
host;
- return surf_
workstation
_get_size(host, fd->surf_file);
+ s
g_host_t host = process->
host;
+ return surf_
host
_get_size(host, fd->surf_file);
}
sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd)
}
sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd)
@@
-223,8
+210,8
@@
sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd)
sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd)
{
sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd)
{
- s
mx_host_t host = process->smx_
host;
- return surf_
workstation
_file_tell(host, fd->surf_file);
+ s
g_host_t host = process->
host;
+ return surf_
host
_file_tell(host, fd->surf_file);
}
}
@@
-235,8
+222,8
@@
xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd)
xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd)
{
xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd)
{
- s
mx_host_t host = process->smx_
host;
- return surf_
workstation
_get_info(host, fd->surf_file);
+ s
g_host_t host = process->
host;
+ return surf_
host
_get_info(host, fd->surf_file);
}
int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin)
}
int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin)
@@
-246,8
+233,8
@@
int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t
int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin)
{
int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin)
{
- s
mx_host_t host = process->smx_
host;
- return surf_
workstation
_file_seek(host, fd->surf_file, offset, origin);
+ s
g_host_t host = process->
host;
+ return surf_
host
_file_seek(host, fd->surf_file, offset, origin);
}
int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t file, const char* fullpath)
}
int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t file, const char* fullpath)
@@
-257,8
+244,8
@@
int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t file, const char
int SIMIX_file_move(smx_process_t process, smx_file_t file, const char* fullpath)
{
int SIMIX_file_move(smx_process_t process, smx_file_t file, const char* fullpath)
{
- s
mx_host_t host = process->smx_
host;
- return surf_
workstation
_file_move(host, file->surf_file, fullpath);
+ s
g_host_t host = process->
host;
+ return surf_
host
_file_move(host, file->surf_file, fullpath);
}
sg_size_t SIMIX_storage_get_size(smx_storage_t storage){
}
sg_size_t SIMIX_storage_get_size(smx_storage_t storage){
@@
-286,9
+273,6
@@
sg_size_t SIMIX_storage_get_used_size(smx_process_t process, smx_storage_t stora
return surf_storage_get_used_size(storage);
}
return surf_storage_get_used_size(storage);
}
-xbt_dict_t simcall_HANDLER_storage_get_properties(smx_simcall_t simcall, smx_storage_t storage){
- return SIMIX_storage_get_properties(storage);
-}
xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage){
xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
return surf_resource_get_properties(surf_storage_resource_priv(storage));
xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage){
xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
return surf_resource_get_properties(surf_storage_resource_priv(storage));
@@
-299,10
+283,6
@@
const char* SIMIX_storage_get_name(smx_storage_t storage){
return sg_storage_name(storage);
}
return sg_storage_name(storage);
}
-xbt_dict_t simcall_HANDLER_storage_get_content(smx_simcall_t simcall, smx_storage_t storage){
- return SIMIX_storage_get_content(storage);
-}
-
xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage){
xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
return surf_storage_get_content(storage);
xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage){
xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
return surf_storage_get_content(storage);
@@
-395,7
+375,7
@@
void SIMIX_io_finish(smx_synchro_t synchro)
(int)synchro->state);
}
(int)synchro->state);
}
- if (surf_
resource_get_state(surf_workstation_resource_priv(simcall->issuer->smx_
host)) != SURF_RESOURCE_ON) {
+ if (surf_
host_get_state(surf_host_resource_priv(simcall->issuer->
host)) != SURF_RESOURCE_ON) {
simcall->issuer->context->iwannadie = 1;
}
simcall->issuer->context->iwannadie = 1;
}