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
[simix] Move other simcall to the Host class
[simgrid.git]
/
src
/
simix
/
simcalls.py
diff --git
a/src/simix/simcalls.py
b/src/simix/simcalls.py
index
aa2a54d
..
c249a21
100755
(executable)
--- a/
src/simix/simcalls.py
+++ b/
src/simix/simcalls.py
@@
-1,7
+1,7
@@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (c) 2014. The SimGrid Team. All rights reserved.
+# Copyright (c) 2014
-2015
. The SimGrid Team. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
@@
-58,7
+58,7
@@
class Simcall(object):
def check(self):
# libsmx.c simcall_BODY_
if self.simcalls_BODY is None:
def check(self):
# libsmx.c simcall_BODY_
if self.simcalls_BODY is None:
- f = open('libsmx.c')
+ f = open('libsmx.c
pp
')
self.simcalls_BODY = set(re.findall('simcall_BODY_(.*?)\(', f.read()))
f.close()
if self.name not in self.simcalls_BODY:
self.simcalls_BODY = set(re.findall('simcall_BODY_(.*?)\(', f.read()))
f.close()
if self.name not in self.simcalls_BODY:
@@
-98,7
+98,7
@@
class Simcall(object):
return ' SIMCALL_%s,'%(self.name.upper())
def string(self):
return ' SIMCALL_%s,'%(self.name.upper())
def string(self):
- return '
[SIMCALL_%s] = "SIMCALL_%s",'%(self.name.upper(), self.name.upper())
+ return '
"SIMCALL_%s",'% self.name.upper()
def accessors(self):
res = []
def accessors(self):
res = []
@@
-168,7
+168,8
@@
class Simcall(object):
res.append(' SIMIX_simcall_handle(&self->simcall, 0);')
res.append(' } ')
if self.res.type != 'void':
res.append(' SIMIX_simcall_handle(&self->simcall, 0);')
res.append(' } ')
if self.res.type != 'void':
- res.append(' return self->simcall.result.%s;'%self.res.field())
+ res.append(' return (%s) self->simcall.result.%s;' %
+ (self.res.rettype(), self.res.field()))
else:
res.append(' ')
res.append(' }')
else:
res.append(' ')
res.append(' }')
@@
-274,15
+275,15
@@
if __name__=='__main__':
fd.close()
###
fd.close()
###
- ### smx_popping_generated.c
+ ### smx_popping_generated.c
pp
###
###
- fd = header("popping_generated.c")
+ fd = header("popping_generated.c
pp
")
fd.write('#include <xbt/base.h>\n');
fd.write('#include "smx_private.h"\n');
fd.write('#ifdef HAVE_MC\n');
fd.write('#include <xbt/base.h>\n');
fd.write('#include "smx_private.h"\n');
fd.write('#ifdef HAVE_MC\n');
- fd.write('#include "mc/mc_forward.h"\n');
+ fd.write('#include "
src/
mc/mc_forward.h"\n');
fd.write('#endif\n');
fd.write('\n');
fd.write('XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);\n\n');
fd.write('#endif\n');
fd.write('\n');
fd.write('XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);\n\n');
@@
-290,9
+291,9
@@
if __name__=='__main__':
fd.write('/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
fd.write('const char* simcall_names[] = {\n')
fd.write('/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
fd.write('const char* simcall_names[] = {\n')
+ fd.write(' "SIMCALL_NONE",');
handle(fd, Simcall.string, simcalls, simcalls_dict)
handle(fd, Simcall.string, simcalls, simcalls_dict)
- fd.write('[SIMCALL_NONE] = "NONE"\n')
fd.write('};\n\n')
fd.write('};\n\n')
@@
-325,11
+326,12
@@
if __name__=='__main__':
fd.close()
###
fd.close()
###
- ### smx_popping_bodies.c
+ ### smx_popping_bodies.c
pp
###
###
- fd = header('popping_bodies.c')
+ fd = header('popping_bodies.c
pp
')
fd.write('#include "smx_private.h"\n')
fd.write('#include "smx_private.h"\n')
- fd.write('#include "mc/mc_forward.h"\n')
+ fd.write('#include "
src/
mc/mc_forward.h"\n')
fd.write('#include "xbt/ex.h"\n')
fd.write('#include "xbt/ex.h"\n')
+ fd.write('#include <simgrid/simix.hpp>\n')
handle(fd, Simcall.body, simcalls, simcalls_dict)
fd.close()
handle(fd, Simcall.body, simcalls, simcalls_dict)
fd.close()