|
Packit Service |
c5cf8c |
#! /usr/bin/env perl
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
$routine_prefix = "MPI_";
|
|
Packit Service |
c5cf8c |
$routine_pattern = "[A-Z][a-z0-9_]*";
|
|
Packit Service |
c5cf8c |
%unimplemented = ( "Lookup_name" => 1,
|
|
Packit Service |
c5cf8c |
"Comm_join" => 1,
|
|
Packit Service |
c5cf8c |
"Comm_get_parent" => 1,
|
|
Packit Service |
c5cf8c |
"Close_port" => 1,
|
|
Packit Service |
c5cf8c |
"Comm_accept" => 1,
|
|
Packit Service |
c5cf8c |
"Comm_connect" => 1,
|
|
Packit Service |
c5cf8c |
"Comm_spawn_multiple" => 1,
|
|
Packit Service |
c5cf8c |
"Win_set_attr" => 1,
|
|
Packit Service |
c5cf8c |
"Type_delete_attr" => 1,
|
|
Packit Service |
c5cf8c |
"File_call_errhandler" => 1,
|
|
Packit Service |
c5cf8c |
"File_create_errhandler" => 1,
|
|
Packit Service |
c5cf8c |
"Type_create_subarray" => 1,
|
|
Packit Service |
c5cf8c |
"Win_get_name" => 1,
|
|
Packit Service |
c5cf8c |
"Pack_external" => 1,
|
|
Packit Service |
c5cf8c |
"File_get_errhandler" => 1,
|
|
Packit Service |
c5cf8c |
"Win_lock" => 1,
|
|
Packit Service |
c5cf8c |
"Win_unlock" => 1,
|
|
Packit Service |
c5cf8c |
"Win_create_keyval" => 1,
|
|
Packit Service |
c5cf8c |
"Type_get_attr" => 1,
|
|
Packit Service |
c5cf8c |
"Win_free_keyval" => 1,
|
|
Packit Service |
c5cf8c |
"Win_get_attr" => 1,
|
|
Packit Service |
c5cf8c |
"File_set_errhandler" => 1,
|
|
Packit Service |
c5cf8c |
"Comm_disconnect" => 1,
|
|
Packit Service |
c5cf8c |
"Pack_external_size" => 1,
|
|
Packit Service |
c5cf8c |
"Publish_name" => 1,
|
|
Packit Service |
c5cf8c |
"Type_create_indexed_block" => 1,
|
|
Packit Service |
c5cf8c |
"Win_set_name" => 1,
|
|
Packit Service |
c5cf8c |
"Status_c2f" => 1,
|
|
Packit Service |
c5cf8c |
"Type_create_darray" => 1,
|
|
Packit Service |
c5cf8c |
"Type_create_resized" => 1,
|
|
Packit Service |
c5cf8c |
"Type_free_keyval" => 1,
|
|
Packit Service |
c5cf8c |
"Unpublish_name" => 1,
|
|
Packit Service |
c5cf8c |
"Unpack_external" => 1,
|
|
Packit Service |
c5cf8c |
"Status_f2c" => 1,
|
|
Packit Service |
c5cf8c |
"Win_test" => 1,
|
|
Packit Service |
c5cf8c |
"Type_set_attr" => 1,
|
|
Packit Service |
c5cf8c |
"Win_delete_attr" => 1,
|
|
Packit Service |
c5cf8c |
"Type_create_keyval" => 1,
|
|
Packit Service |
c5cf8c |
"Open_port" => 1,
|
|
Packit Service |
c5cf8c |
"Type_count" => 1,
|
|
Packit Service |
c5cf8c |
);
|
|
Packit Service |
c5cf8c |
open( FD, "
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
# Skip to prototypes
|
|
Packit Service |
c5cf8c |
while (<FD>) {
|
|
Packit Service |
c5cf8c |
if ( /\/\*\s*Begin Prototypes/ ) { last; }
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
%routine_names = ();
|
|
Packit Service |
c5cf8c |
# Read each one
|
|
Packit Service |
c5cf8c |
while (<FD>) {
|
|
Packit Service |
c5cf8c |
# Remove any comments
|
|
Packit Service |
c5cf8c |
s/\/\*.*\*\///g;
|
|
Packit Service |
c5cf8c |
print $_ if $debug;
|
|
Packit Service |
c5cf8c |
if (/\/\*\s*End Prototypes/) { last; }
|
|
Packit Service |
c5cf8c |
if (/^int\s+$routine_prefix($routine_pattern)\s*\((.*)/) {
|
|
Packit Service |
c5cf8c |
$routine_name = $1;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
$args = $2;
|
|
Packit Service |
c5cf8c |
while (! ($args =~ /;/)) {
|
|
Packit Service |
c5cf8c |
$args .= <FD>;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
$routine_names{$1} = $args;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
close FD;
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# Generate a simple test program with no prototypes
|
|
Packit Service |
c5cf8c |
open (OFD, ">tpmpi.c" ) || die "Cannot open tpmpi.c";
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
print OFD "int main( int argc, char *argv[] )\n{\n";
|
|
Packit Service |
c5cf8c |
foreach $key (keys(%routine_names)) {
|
|
Packit Service |
c5cf8c |
if (defined($unimplemented{$key})) { next; }
|
|
Packit Service |
c5cf8c |
print OFD " MPI_$key();\n";
|
|
Packit Service |
c5cf8c |
print OFD " PMPI_$key();\n";
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
print OFD "}\n";
|
|
Packit Service |
c5cf8c |
close OFD;
|