Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix code generation (broken call to inspector_->is_pending), and reindent.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 1 Mar 2021 12:07:29 +0000 (13:07 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 1 Mar 2021 15:10:13 +0000 (16:10 +0100)
src/simix/simcalls.py

index da35fdf..1051d4a 100755 (executable)
@@ -229,30 +229,19 @@ def parse(fn):
 
 def header(name):
     fd = open(name, 'w')
-    fd.write(
-        '/**********************************************************************/\n')
-    fd.write(
-        '/* File generated by src/simix/simcalls.py from src/simix/simcalls.in */\n')
-    fd.write(
-        '/*                                                                    */\n')
-    fd.write(
-        '/*                    DO NOT EVER CHANGE THIS FILE                    */\n')
-    fd.write(
-        '/*                                                                    */\n')
-    fd.write(
-        '/* change simcalls specification in src/simix/simcalls.in             */\n')
-    fd.write(
-        '/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved.    */\n')
-    fd.write(
-        '/**********************************************************************/\n\n')
+    fd.write('/**********************************************************************/\n')
+    fd.write('/* File generated by src/simix/simcalls.py from src/simix/simcalls.in */\n')
+    fd.write('/*                                                                    */\n')
+    fd.write('/*                    DO NOT EVER CHANGE THIS FILE                    */\n')
+    fd.write('/*                                                                    */\n')
+    fd.write('/* change simcalls specification in src/simix/simcalls.in             */\n')
+    fd.write('/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved.    */\n')
+    fd.write('/**********************************************************************/\n\n')
     fd.write('/*\n')
-    fd.write(
-        ' * Note that the name comes from http://en.wikipedia.org/wiki/Popping\n')
-    fd.write(
-        ' * Indeed, the control flow is doing a strange dance in there.\n')
+    fd.write(' * Note that the name comes from http://en.wikipedia.org/wiki/Popping\n')
+    fd.write(' * Indeed, the control flow is doing a strange dance in there.\n')
     fd.write(' *\n')
-    fd.write(
-        ' * That\'s not about http://en.wikipedia.org/wiki/Poop, despite the odor :)\n')
+    fd.write(' * That\'s not about http://en.wikipedia.org/wiki/Poop, despite the odor :)\n')
     fd.write(' */\n\n')
     return fd
 
@@ -332,8 +321,7 @@ if __name__ == '__main__':
 
     fd.write('using simgrid::simix::Simcall;')
     fd.write('\n')
-    fd.write(
-        '/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
+    fd.write('/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
     fd.write('constexpr std::array<const char*, simgrid::simix::NUM_SIMCALLS> simcall_names{{\n')
 
     fd.write('    "Simcall::NONE",\n')
@@ -342,18 +330,16 @@ if __name__ == '__main__':
     fd.write('}};\n\n')
 
     fd.write('/** @private\n')
-    fd.write(
-        ' * @brief (in kernel mode) unpack the simcall and activate the handler\n')
+    fd.write(' * @brief (in kernel mode) unpack the simcall and activate the handler\n')
     fd.write(' *\n')
     fd.write(' * This function is generated from src/simix/simcalls.in\n')
     fd.write(' */\n')
-    fd.write(
-        'void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered_) {\n')
-    fd.write(
-        '  XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_.call_));\n')
+    fd.write('void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered_)\n')
+    fd.write('{\n')
+    fd.write('  XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_.call_));\n')
     fd.write('  SIMCALL_SET_MC_VALUE(simcall_, times_considered_);\n')
     fd.write('  if (simcall_.inspector_ != nullptr)\n')
-    fd.write('    simcall_.inspector_->is_pending(times_considered_);\n')
+    fd.write('    simcall_.inspector_->prepare(times_considered_);\n')
 
     fd.write('  if (context_->wannadie())\n')
     fd.write('    return;\n')