Skip to content

Commit

Permalink
Correct passing Fortran strings from C
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Apr 11, 2023
1 parent 95e75cb commit 9b06f80
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors:
given-names: Erik
orcid: https://orcid.org/0000-0002-4518-9017
title: MPItrampoline
version: v5.2.1
version: v5.2.2
doi: 10.5281/zenodo.6174408
date-released: 2023-01-31
date-released: 2023-04-11
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12...3.20)
project(
MPItrampoline VERSION 5.2.1
MPItrampoline VERSION 5.2.2
DESCRIPTION "MPI trampoline"
HOMEPAGE_URL "https://github.com/eschnett/MPItrampoline"
LANGUAGES NONE
Expand Down
48 changes: 44 additions & 4 deletions mpiabi/mpi_functions_fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@
("const MPI_Aint *", "outsize"),
("MPI_Aint *", "position"),
("MPI_Fint *", "ierror"),
("const size_t *", "datarep_len"),
]),

("void", "MPI_Unpack_external", [
Expand All @@ -691,6 +692,7 @@
("const MPI_Fint *", "outcount"),
("const MPI_Datatype *", "datatype"),
("MPI_Fint *", "ierror"),
("const size_t *", "datarep_len"),
]),

("void", "MPI_Pack_external_size", [
Expand All @@ -699,6 +701,7 @@
("const MPI_Datatype *", "datatype"),
("MPI_Aint *", "size"),
("MPI_Fint *", "ierror"),
("const size_t *", "datarep_len"),
]),

# 5.3 Barrier Synchronization
Expand Down Expand Up @@ -1501,39 +1504,45 @@
("const MPI_Comm *", "comm"),
("const char *", "comm_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "comm_name_len"),
]),

("void", "MPI_Comm_get_name", [
("const MPI_Comm *", "comm"),
("char *", "comm_name"),
("int *", "resultlen"),
("MPI_Fint *", "ierror"),
("const size_t *", "comm_name_len"),
]),

("void", "MPI_Type_set_name", [
("const MPI_Datatype *", "type"),
("const char *", "type_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "type_name_len"),
]),

("void", "MPI_Type_get_name", [
("const MPI_Datatype *", "type"),
("char *", "type_name"),
("int *", "resultlen"),
("MPI_Fint *", "ierror"),
("const size_t *", "type_name_len"),
]),

("void", "MPI_Win_set_name", [
("const MPI_Win *", "win"),
("const char *", "win_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "win_name_len"),
]),

("void", "MPI_Win_get_name", [
("const MPI_Win *", "win"),
("char *", "win_name"),
("int *", "resultlen"),
("MPI_Fint *", "ierror"),
("const size_t *", "win_name_len"),
]),

# 7.5 Topology Constructors
Expand Down Expand Up @@ -1850,12 +1859,15 @@
("void", "MPI_Get_library_version",[
("char *", "version"),
("int *", "resultlen"),
("MPI_Fint *", "ierror"),
("const size_t *", "version_len"),
]),

("void", "MPI_Get_processor_name", [
("char *", "name"),
("int *", "resultlen"),
("MPI_Fint *", "ierror"),
("const size_t *", "name_len"),
]),

# 8.2 Memory Allocation
Expand Down Expand Up @@ -1959,6 +1971,7 @@
("char *", "string"),
("int *", "resultlen"),
("MPI_Fint *", "ierror"),
("const size_t *", "string_len"),
]),

# 8.4 Error Codes and Classes
Expand Down Expand Up @@ -1986,6 +1999,7 @@
("const MPI_Fint *", "errorcode"),
("const char *", "string"),
("MPI_Fint *", "ierror"),
("const size_t *", "string_len"),
]),

("void", "MPI_Comm_call_errhandler", [
Expand Down Expand Up @@ -2017,8 +2031,8 @@
# 8.7 Startup

("void", "MPI_Init", [
("int *", "argc"),
("char ***", "argv"),
# ("int *", "argc"),
# ("char ***", "argv"),
("MPI_Fint *", "ierror"),
]),

Expand Down Expand Up @@ -2052,12 +2066,15 @@
("const char *", "key"),
("const char *", "value"),
("MPI_Fint *", "ierror"),
("const size_t *", "key_len"),
("const size_t *", "value_len"),
]),

("void", "MPI_Info_delete", [
("const MPI_Info *", "info"),
("const char *", "key"),
("MPI_Fint *", "ierror"),
("const size_t *", "key_len"),
]),

("void", "MPI_Info_get", [
Expand All @@ -2067,6 +2084,8 @@
("char *", "value"),
("int *", "flag"),
("MPI_Fint *", "ierror"),
("const size_t *", "key_len"),
("const size_t *", "value_len"),
]),

("void", "MPI_Info_get_valuelen", [
Expand All @@ -2075,6 +2094,7 @@
("int *", "valuelen"),
("int *", "flag"),
("MPI_Fint *", "ierror"),
("const size_t *", "key_len"),
]),

("void", "MPI_Info_get_nkeys", [
Expand All @@ -2088,6 +2108,7 @@
("const MPI_Fint *", "n"),
("char *", "key"),
("MPI_Fint *", "ierror"),
("const size_t *", "key_len"),
]),

("void", "MPI_Info_dup", [
Expand All @@ -2113,6 +2134,8 @@
("MPI_Comm *", "intercomm"),
("int *", "array_off_errcodes"),
("MPI_Fint *", "ierror"),
("const size_t *", "command_len"),
("const size_t *", "argv_len"),
]),

("void", "MPI_Comm_get_parent", [
Expand All @@ -2130,6 +2153,9 @@
("const MPI_Comm *", "comm"),
("MPI_Comm *", "intercomm"),
("int *", "array_of_errcodes"),
("MPI_Fint *", "ierror"),
("const size_t *", "arrray_of_commands_len"),
("const size_t *", "arrray_of_argv_len"),
]),

# 10.4 Establishing Communication
Expand All @@ -2138,11 +2164,13 @@
("const MPI_Info *", "info"),
("char *", "port_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "port_name_len"),
]),

("void", "MPI_Close_port", [
("const char *", "port_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "port_name_len"),
]),

("void", "MPI_Comm_accept", [
Expand All @@ -2152,6 +2180,7 @@
("const MPI_Comm *", "comm"),
("MPI_Comm *", "newcomm"),
("MPI_Fint *", "ierror"),
("const size_t *", "port_name_len"),
]),

("void", "MPI_Comm_connect", [
Expand All @@ -2161,27 +2190,34 @@
("const MPI_Comm *", "comm"),
("MPI_Comm *", "newcomm"),
("MPI_Fint *", "ierror"),
("const size_t *", "port_name_len"),
]),

("void", "MPI_Publish_name", [
("const char *", "service_name"),
("const MPI_Info *", "info"),
("const char *", "port_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "service_name_len"),
("const size_t *", "port_name_len"),
]),

("void", "MPI_Unpublish_name", [
("const char *", "service_name"),
("const MPI_Info *", "info"),
("const char *", "port_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "service_name_len"),
("const size_t *", "port_name_len"),
]),

("void", "MPI_Lookup_name", [
("const char *", "service_name"),
("const MPI_Info *", "info"),
("char *", "port_name"),
("MPI_Fint *", "ierror"),
("const size_t *", "service_name_len"),
("const size_t *", "port_name_len"),
]),

# 10.5 Other Functionality
Expand Down Expand Up @@ -2547,8 +2583,8 @@
# 12.4 MPI and Threads

("void", "MPI_Init_thread", [
("int *", "argc"),
("char * * *", "argv"),
# ("int *", "argc"),
# ("char ***", "argv"),
("const MPI_Fint *", "required"),
("int *", "provided"),
("MPI_Fint *", "ierror"),
Expand All @@ -2573,6 +2609,7 @@
("const MPI_Info *", "info"),
("MPI_File *", "fh"),
("MPI_Fint *", "ierror"),
("const size_t *", "filename_len"),
]),

("void", "MPI_File_close", [
Expand All @@ -2584,6 +2621,7 @@
("const char *", "filename"),
("const MPI_Info *", "info"),
("MPI_Fint *", "ierror"),
("const size_t *", "filename_len"),
]),

("void", "MPI_File_set_size", [
Expand Down Expand Up @@ -2638,6 +2676,7 @@
("const char *", "datarep"),
("const MPI_Info *", "info"),
("MPI_Fint *", "ierror"),
("const size_t *", "datarep_len"),
]),

("void", "MPI_File_get_view", [
Expand All @@ -2647,6 +2686,7 @@
("MPI_Datatype *", "filetype"),
("char *", "datarep"),
("MPI_Fint *", "ierror"),
("const size_t *", "datarep_len"),
]),

# 13.4 Data Access
Expand Down

0 comments on commit 9b06f80

Please sign in to comment.