X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a592611f5e360a3769c0d3ae38bf8c27f1c458a0..fa54dd19890f64268c0654470eea2f3e04d6a7f7:/tools/smpi/generate_smpi_defines.pl diff --git a/tools/smpi/generate_smpi_defines.pl b/tools/smpi/generate_smpi_defines.pl index a719771890..7aa83d9299 100755 --- a/tools/smpi/generate_smpi_defines.pl +++ b/tools/smpi/generate_smpi_defines.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright 2016 Vincent Danjean # # Call this script like this: @@ -25,7 +25,7 @@ if (defined $options{f}) { } print "$commentChar This file has been automatically generated by the script\n"; -print "$commentChar in tools/smpi/" . __FILE__ ."\n"; +print "$commentChar in tools/smpi/generate_smpi_defines.pl\n"; print "$commentChar DO NOT EDIT MANUALLY. ALL CHANGES WILL BE OVERWRITTEN!\n"; # Formatting of the output @@ -40,7 +40,12 @@ sub output_macro { print "#define ". uc($id) ." smpi_trace_set_call_location(__FILE__,__LINE__); call ". lc $id ."\n"; } else { - print "#define $id(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); $id(__VA_ARGS__); })\n"; + if ($id eq "MPI_Init") { + print "#define MPI_Init(...) ({ smpi_process_init(__VA_ARGS__); smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Init(NULL, NULL); })\n"; + } + else { + print "#define $id(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); $id(__VA_ARGS__); })\n"; + } } }