def check(self):
# smx_user.c simcall_BODY_
- # smx_*.c void SIMIX_pre_host_on(smx_simcall_t simcall, smx_host_t h)
+ # smx_*.c void simcall_HANDLER_host_on(smx_simcall_t simcall, smx_host_t h)
self.check_body()
self.check_pre()
def check_body(self):
if self.simcalls_BODY is None:
- f = open('smx_user.c')
+ f = open('libsmx.c')
self.simcalls_BODY = set(re.findall('simcall_BODY_(.*?)\(', f.read()))
f.close()
if self.name not in self.simcalls_BODY:
print '# ERROR: No function calling simcall_BODY_%s'%self.name
- print '# Add something like this to smx_user.c:'
+ print '# Add something like this to libsmx.c:'
print '''%s simcall_%s(%s)
{
return simcall_BODY_%s(%s);
self.simcalls_PRE = set()
for fn in glob.glob('smx_*') + glob.glob('../mc/*'):
f = open(fn)
- self.simcalls_PRE |= set(re.findall('SIMIX_pre_(.*?)\(', f.read()))
+ self.simcalls_PRE |= set(re.findall('simcall_HANDLER_(.*?)\(', f.read()))
f.close()
if self.name not in self.simcalls_PRE:
- print '# ERROR: No function called SIMIX_pre_%s'%self.name
+ print '# ERROR: No function called simcall_HANDLER_%s'%self.name
print '# Add something like this to smx_.*.c:'
- print '''%s SIMIX_pre_%s(smx_simcall_t simcall%s)
+ print '''%s simcall_HANDLER_%s(smx_simcall_t simcall%s)
{
// Your code handling the simcall
}\n'''%(self.res.ret()
def case(self):
return '''case SIMCALL_%s:
- %sSIMIX_pre_%s(simcall %s);
+ %ssimcall_HANDLER_%s(simcall %s);
%sbreak;
'''%(self.name.upper(),
'simcall->result.%s = '%self.res.field() if self.res.type != 'void' and self.has_answer else ' ',
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_pre_%s(%s);
+ if (0) simcall_HANDLER_%s(%s);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
self->simcall.call = SIMCALL_%s;
SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
SIMIX_process_yield(self);
} else {
- SIMIX_simcall_enter(&self->simcall, 0);
+ SIMIX_simcall_handle(&self->simcall, 0);
}
%s
}'''%(self.res.ret()
###
### smx_popping_accessors.c
###
- fd = header('smx_popping_accessors.h')
+ fd = header('popping_accessors.h')
handle(fd, Simcall.accessors, simcalls, simcalls_dict)
fd.close()
###
### smx_popping_enum.c
###
- fd = header("smx_popping_enum.h")
+ fd = header("popping_enum.h")
fd.write('/**\n')
fd.write(' * @brief All possible simcalls.\n')
fd.write(' */\n')
### smx_popping_generated.c
###
- fd = header("smx_popping_generated.c")
+ fd = header("popping_generated.c")
fd.write('#include "smx_private.h"\n');
fd.write('#ifdef HAVE_MC\n');
fd.write('#include "mc/mc_private.h"\n');
fd.write('#endif\n');
fd.write('\n');
- fd.write('XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_smurf);\n\n');
+ fd.write('XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);\n\n');
fd.write('/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
fd.write('const char* simcall_names[] = {\n')
fd.write(' * \n')
fd.write(' * This function is generated from src/simix/simcalls.in\n')
fd.write(' */\n');
- fd.write('void SIMIX_simcall_enter(smx_simcall_t simcall, int value) {\n');
+ fd.write('void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {\n');
fd.write(' XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));\n');
fd.write(' SIMCALL_SET_MC_VALUE(simcall, value);\n');
fd.write(' if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)\n');
###
### smx_popping_bodies.c
###
- fd = header('smx_popping_bodies.c')
+ fd = header('popping_bodies.c')
fd.write('#include "smx_private.h"\n')
fd.write('#include "mc/mc_interface.h"\n')
fd.write('#include "xbt/ex.h"\n')