;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;  6/25/2003   by    Fu Jie Huang
;;;
;;;  generated semiautomatically from the MPI Standard 1.1 from
;;; http://www-unix.mcs.anl.gov/mpi/mpi-standard/mpi-report-1.1/mpi-report.html
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "mpi-config")
(libload "libc/constants")


(eval `(de mpi-dummy () ,mpi-cpheader-cmd ()))

(de alloc_MPI_Status ()
  (gptr #{ malloc(sizeof(MPI_Status)) #}))

(de MPI_Send  (buf count datatype dest tag comm) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Send($buf, $count, $datatype, $dest, $tag, $comm) #}))

(de MPI_Recv  (buf count datatype source tag comm status) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) source)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Recv($buf, $count, $datatype, $source, $tag, $comm, $status) #}))

(de MPI_Get_count  (status datatype count) 
  ((-gptr- "MPI_Status *") status)
  ((MPI_Datatype) datatype)
  ((-gptr- "int *") count) 
  (int  #{ MPI_Get_count($status, $datatype, $count) #}))

(de MPI_Bsend  (buf count datatype dest tag comm) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Bsend($buf, $count, $datatype, $dest, $tag, $comm) #}))

(de MPI_Ssend  (buf count datatype dest tag comm) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Ssend($buf, $count, $datatype, $dest, $tag, $comm) #}))

(de MPI_Rsend  (buf count datatype dest tag comm) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Rsend($buf, $count, $datatype, $dest, $tag, $comm) #}))

(de MPI_Buffer_attach  (buffer size) 
  ((-gptr-) buffer)
  ((-int-) size) 
  (int  #{ MPI_Buffer_attach($buffer, $size) #}))

(de MPI_Buffer_detach  (buffer size) 
  ((-gptr-) buffer)
  ((-gptr- "int*") size) 
  (int  #{ MPI_Buffer_detach($buffer, $size) #}))

(de MPI_Isend  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Isend($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Ibsend  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Ibsend($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Issend  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Issend($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Irsend  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Irsend($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Irecv  (buf count datatype source tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) source)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Irecv($buf, $count, $datatype, $source, $tag, $comm, $request) #}))

(de MPI_Wait  (request status) 
  ((-gptr- "MPI_Request *") request)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Wait($request, $status) #}))

(de MPI_Test  (request flag status) 
  ((-gptr- "MPI_Request *") request)
  ((-gptr- "int *") flag)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Test($request, $flag, $status) #}))

(de MPI_Request_free  (request) 
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Request_free($request) #}))

(de MPI_Waitany  (count array_of_requests index status) 
  ((-int-) count)
  ((-gptr- "MPI_Request *") array_of_requests)
  ((-gptr- "int *") index)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Waitany($count, $array_of_requests, $index, $status) #}))

(de MPI_Testany  (count array_of_requests index flag status) 
  ((-int-) count)
  ((-gptr- "MPI_Request *") array_of_requests)
  ((-gptr- "int *") index)
  ((-gptr- "int *") flag)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Testany($count, $array_of_requests, $index, $flag, $status) #}))

(de MPI_Waitall  (count array_of_requests array_of_statuses) 
  ((-int-) count)
  ((-gptr- "MPI_Request *") array_of_requests)
  ((-gptr- "MPI_Status *") array_of_statuses) 
  (int  #{ MPI_Waitall($count, $array_of_requests, $array_of_statuses) #}))

(de MPI_Testall  (count array_of_requests flag array_of_statuses) 
  ((-int-) count)
  ((-gptr- "MPI_Request *") array_of_requests)
  ((-gptr- "int *") flag)
  ((-gptr- "MPI_Status *") array_of_statuses) 
  (int  #{ MPI_Testall($count, $array_of_requests, $flag, $array_of_statuses) #}))

(de MPI_Waitsome  (incount array_of_requests outcount array_of_indices array_of_statuses) 
  ((-int-) incount)
  ((-gptr- "MPI_Request *") array_of_requests)
  ((-gptr- "int *") outcount)
  ((-gptr- "int *") array_of_indices)
  ((-gptr- "MPI_Status *") array_of_statuses) 
  (int  #{ MPI_Waitsome($incount, $array_of_requests, $outcount, $array_of_indices, $array_of_statuses) #}))

(de MPI_Testsome  (incount array_of_requests outcount array_of_indices array_of_statuses) 
  ((-int-) incount)
  ((-gptr- "MPI_Request *") array_of_requests)
  ((-gptr- "int *") outcount)
  ((-gptr- "int *") array_of_indices)
  ((-gptr- "MPI_Status *") array_of_statuses) 
  (int  #{ MPI_Testsome($incount, $array_of_requests, $outcount, $array_of_indices, $array_of_statuses) #}))

(de MPI_Iprobe  (source tag comm flag status) 
  ((-int-) source)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "int *") flag)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Iprobe($source, $tag, $comm, $flag, $status) #}))

(de MPI_Probe  (source tag comm status) 
  ((-int-) source)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Probe($source, $tag, $comm, $status) #}))

(de MPI_Cancel  (request) 
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Cancel($request) #}))

(de MPI_Test_cancelled  (status flag) 
  ((-gptr- "MPI_Status *") status)
  ((-gptr- "int *") flag) 
  (int  #{ MPI_Test_cancelled($status, $flag) #}))

(de MPI_Send_init  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Send_init($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Bsend_init  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Bsend_init($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Ssend_init  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Ssend_init($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Rsend_init  (buf count datatype dest tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Rsend_init($buf, $count, $datatype, $dest, $tag, $comm, $request) #}))

(de MPI_Recv_init  (buf count datatype source tag comm request) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) source)
  ((-int-) tag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Recv_init($buf, $count, $datatype, $source, $tag, $comm, $request) #}))

(de MPI_Start  (request) 
  ((-gptr- "MPI_Request *") request) 
  (int  #{ MPI_Start($request) #}))

(de MPI_Startall  (count array_of_requests) 
  ((-int-) count)
  ((-gptr- "MPI_Request *") array_of_requests) 
  (int  #{ MPI_Startall($count, $array_of_requests) #}))

(de MPI_Sendrecv  (sendbuf sendcount sendtype dest sendtag recvbuf recvcount recvtype source recvtag comm status) 
  ((-gptr-) sendbuf)
  ((-int-) sendcount)
  ((MPI_Datatype) sendtype)
  ((-int-) dest)
  ((-int-) sendtag)
  ((-gptr-) recvbuf)
  ((-int-) recvcount)
  ((MPI_Datatype) recvtype)
  ((-int-) source)
  ((-int-) recvtag)             ;; different from the standard?
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Sendrecv($sendbuf, $sendcount, $sendtype, $dest, $sendtag, $recvbuf, $recvcount, $recvtype, $source, $recvtag, $comm, $status) #}))

(de MPI_Sendrecv_replace  (buf count datatype dest sendtag source recvtag comm status) 
  ((-gptr-) buf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) dest)
  ((-int-) sendtag)
  ((-int-) source)
  ((-int-) recvtag)
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Status *") status) 
  (int  #{ MPI_Sendrecv_replace($buf, $count, $datatype, $dest, $sendtag, $source, $recvtag, $comm, $status) #}))

(de MPI_Type_contiguous  (count oldtype newtype) 
  ((-int-) count)
  ((MPI_Datatype) oldtype)
  ((-gptr- "MPI_Datatype *") newtype) 
  (int  #{ MPI_Type_contiguous($count, $oldtype, $newtype) #}))

(de MPI_Type_vector  (count blocklength stride oldtype newtype) 
  ((-int-) count)
  ((-int-) blocklength)
  ((-int-) stride)
  ((MPI_Datatype) oldtype)
  ((-gptr- "MPI_Datatype *") newtype) 
  (int  #{ MPI_Type_vector($count, $blocklength, $stride, $oldtype, $newtype) #}))

(de MPI_Type_hvector  (count blocklength stride oldtype newtype) 
  ((-int-) count)
  ((-int-) blocklength)
  ((MPI_Aint) stride)
  ((MPI_Datatype) oldtype)
  ((-gptr- "MPI_Datatype *") newtype) 
  (int  #{ MPI_Type_hvector($count, $blocklength, $stride, $oldtype, $newtype) #}))

(de MPI_Type_indexed  (count array_of_blocklengths array_of_displacements oldtype newtype) 
  ((-int-) count)
  ((-gptr- "int *") array_of_blocklengths)
  ((-gptr- "int *") array_of_displacements)
  ((MPI_Datatype) oldtype)
  ((-gptr- "MPI_Datatype *") newtype) 
  (int  #{ MPI_Type_indexed($count, $array_of_blocklengths, $array_of_displacements, $oldtype, $newtype) #}))

(de MPI_Type_hindexed  (count array_of_blocklengths array_of_displacements oldtype newtype) 
  ((-int-) count)
  ((-gptr- "int *") array_of_blocklengths)
  ((-gptr- "MPI_Aint *") array_of_displacements)
  ((MPI_Datatype) oldtype)
  ((-gptr- "MPI_Datatype *") newtype) 
  (int  #{ MPI_Type_hindexed($count, $array_of_blocklengths, $array_of_displacements, $oldtype, $newtype) #}))

(de MPI_Type_struct  (count array_of_blocklengths array_of_displacements array_of_types newtype) 
  ((-int-) count)
  ((-gptr- "int *") array_of_blocklengths)
  ((-gptr- "MPI_Aint *") array_of_displacements)
  ((-gptr- "MPI_Datatype *") array_of_types)
  ((-gptr- "MPI_Datatype *") newtype) 
  (int  #{ MPI_Type_struct($count, $array_of_blocklengths, $array_of_displacements, $array_of_types, $newtype) #}))

(de MPI_Address  (location address) 
  ((-gptr-) location)
  ((-gptr- "MPI_Aint *") address) 
  (int  #{ MPI_Address($location, $address) #}))

(de MPI_Type_extent  (datatype extent) 
  ((MPI_Datatype) datatype)
  ((-gptr- "MPI_Aint *") extent) 
  (int  #{ MPI_Type_extent($datatype, $extent) #}))

(de MPI_Type_size  (datatype size) 
  ((MPI_Datatype) datatype)
  ((-gptr- "int *") size) 
  (int  #{ MPI_Type_size($datatype, $size) #}))

(de MPI_Type_lb  (datatype displacement) 
  ((MPI_Datatype) datatype)
  ((-gptr- "MPI_Aint*") displacement) 
  (int  #{ MPI_Type_lb($datatype, $displacement) #}))

(de MPI_Type_ub  (datatype displacement) 
  ((MPI_Datatype) datatype)
  ((-gptr- "MPI_Aint*") displacement) 
  (int  #{ MPI_Type_ub($datatype, $displacement) #}))

(de MPI_Type_commit  (datatype) 
  ((-gptr- "MPI_Datatype *") datatype) 
  (int  #{ MPI_Type_commit($datatype) #}))

(de MPI_Type_free  (datatype) 
  ((-gptr- "MPI_Datatype *") datatype) 
  (int  #{ MPI_Type_free($datatype) #}))

(de MPI_Get_elements  (status datatype count) 
  ((-gptr- "MPI_Status *") status)
  ((MPI_Datatype) datatype)
  ((-gptr- "int *") count) 
  (int  #{ MPI_Get_elements($status, $datatype, $count) #}))

(de MPI_Pack  (inbuf incount datatype outbuf outsize position comm) 
  ((-gptr-) inbuf)
  ((-int-) incount)
  ((MPI_Datatype) datatype)
  ((-gptr- "void *") outbuf)
  ((-int-) outsize)
  ((-gptr- "int *") position)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Pack($inbuf, $incount, $datatype, $outbuf, $outsize, $position, $comm) #}))

(de MPI_Unpack  (inbuf insize position outbuf outcount datatype comm) 
  ((-gptr-) inbuf)
  ((-int-) insize)
  ((-gptr- "int *") position)
  ((-gptr- "void *") outbuf)
  ((-int-) outcount)
  ((MPI_Datatype) datatype)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Unpack($inbuf, $insize, $position, $outbuf, $outcount, $datatype, $comm) #}))

(de MPI_Pack_size  (incount datatype comm size) 
  ((-int-) incount)
  ((MPI_Datatype) datatype)
  ((MPI_Comm) comm)
  ((-gptr- "int *") size) 
  (int  #{ MPI_Pack_size($incount, $datatype, $comm, $size)  #}))

(de MPI_Barrier  (comm) 
  ((MPI_Comm) comm) 
  (int  #{ MPI_Barrier($comm) #}))

(de MPI_Bcast  (buffer count datatype root comm) 
  ((-gptr-) buffer)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((-int-) root)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Bcast($buffer, $count, $datatype, $root, $comm) #}))

(de MPI_Gather  (sendbuf sendcount sendtype recvbuf recvcount recvtype root comm) 
  ((-gptr-) sendbuf)
  ((-int-) sendcount)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-int-) recvcount)
  ((MPI_Datatype) recvtype)
  ((-int-) root)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Gather($sendbuf, $sendcount, $sendtype, $recvbuf, $recvcount, $recvtype, $root, $comm) #}))

(de MPI_Gatherv  (sendbuf sendcount sendtype recvbuf recvcounts displs recvtype root comm) 
  ((-gptr-) sendbuf)
  ((-int-) sendcount)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-gptr- "int *") recvcounts)
  ((-gptr- "int *") displs)
  ((MPI_Datatype) recvtype)
  ((-int-) root)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Gatherv($sendbuf, $sendcount, $sendtype, $recvbuf, $recvcounts, $displs, $recvtype, $root, $comm) #}))

(de MPI_Scatter  (sendbuf sendcount sendtype recvbuf recvcount recvtype root comm) 
  ((-gptr-) sendbuf)
  ((-int-) sendcount)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-int-) recvcount)
  ((MPI_Datatype) recvtype)
  ((-int-) root)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Scatter($sendbuf, $sendcount, $sendtype, $recvbuf, $recvcount, $recvtype, $root, $comm) #}))

(de MPI_Scatterv  (sendbuf sendcounts displs sendtype recvbuf recvcount recvtype root comm) 
  ((-gptr-) sendbuf)
  ((-gptr- "int *") sendcounts)
  ((-gptr- "int *") displs)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-int-) recvcount)
  ((MPI_Datatype) recvtype)
  ((-int-) root)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Scatterv($sendbuf, $sendcounts, $displs, $sendtype, $recvbuf, $recvcount, $recvtype, $root, $comm) #}))

(de MPI_Allgather  (sendbuf sendcount sendtype recvbuf recvcount recvtype comm) 
  ((-gptr-) sendbuf)
  ((-int-) sendcount)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-int-) recvcount)
  ((MPI_Datatype) recvtype)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Allgather($sendbuf, $sendcount, $sendtype, $recvbuf, $recvcount, $recvtype, $comm) #}))

(de MPI_Allgatherv  (sendbuf sendcount sendtype recvbuf recvcounts displs recvtype comm) 
  ((-gptr-) sendbuf)
  ((-int-) sendcount)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-gptr- "int *") recvcounts)
  ((-gptr- "int *") displs)
  ((MPI_Datatype) recvtype)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Allgatherv($sendbuf, $sendcount, $sendtype, $recvbuf, $recvcounts, $displs, $recvtype, $comm) #}))

(de MPI_Alltoall  (sendbuf sendcount sendtype recvbuf recvcount recvtype comm) 
  ((-gptr-) sendbuf)
  ((-int-) sendcount)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-int-) recvcount)
  ((MPI_Datatype) recvtype)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Alltoall($sendbuf, $sendcount, $sendtype, $recvbuf, $recvcount, $recvtype, $comm) #}))

(de MPI_Alltoallv  (sendbuf sendcounts sdispls sendtype recvbuf recvcounts rdispls recvtype comm) 
  ((-gptr-) sendbuf)
  ((-gptr- "int *") sendcounts)
  ((-gptr- "int *") sdispls)
  ((MPI_Datatype) sendtype)
  ((-gptr-) recvbuf)
  ((-gptr- "int *") recvcounts)
  ((-gptr- "int *") rdispls)
  ((MPI_Datatype) recvtype)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Alltoallv($sendbuf, $sendcounts, $sdispls, $sendtype, $recvbuf, $recvcounts, $rdispls, $recvtype, $comm) #}))

(de MPI_Reduce  (sendbuf recvbuf count datatype op root comm) 
  ((-gptr-) sendbuf)
  ((-gptr-) recvbuf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((MPI_Op) op)
  ((-int-) root)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Reduce($sendbuf, $recvbuf, $count, $datatype, $op, $root, $comm) #}))

(de MPI_Op_create  (function commute op) 
  ((-gptr- "MPI_User_function *") function)
  ((-int-) commute)
  ((-gptr- "MPI_Op *") op) 
  (int  #{ MPI_Op_create($function, $commute, $op) #}))

(de MPI_Op_free  (op) 
  ((-gptr- "MPI_Op *") op) 
  (int  #{ MPI_Op_free($op) #}))

(de MPI_Allreduce  (sendbuf recvbuf count datatype op comm) 
  ((-gptr-) sendbuf)
  ((-gptr-) recvbuf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((MPI_Op) op)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Allreduce($sendbuf, $recvbuf, $count, $datatype, $op, $comm) #}))

(de MPI_Reduce_scatter  (sendbuf recvbuf recvcounts datatype op comm) 
  ((-gptr-) sendbuf)
  ((-gptr-) recvbuf)
  ((-gptr- "int *") recvcounts)
  ((MPI_Datatype) datatype)
  ((MPI_Op) op)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Reduce_scatter($sendbuf, $recvbuf, $recvcounts, $datatype, $op, $comm) #}))

(de MPI_Scan  (sendbuf recvbuf count datatype op comm) 
  ((-gptr-) sendbuf)
  ((-gptr-) recvbuf)
  ((-int-) count)
  ((MPI_Datatype) datatype)
  ((MPI_Op) op)
  ((MPI_Comm) comm) 
  (int  #{ MPI_Scan($sendbuf, $recvbuf, $count, $datatype, $op, $comm)  #}))

(de MPI_Group_size  (group size) 
  ((MPI_Group) group)
  ((-gptr- "int *") size) 
  (int  #{ MPI_Group_size($group, $size) #}))

(de MPI_Group_rank  (group rank) 
  ((MPI_Group) group)
  ((-gptr- "int *") rank) 
  (int  #{ MPI_Group_rank($group, $rank) #}))

(de MPI_Group_translate_ranks  (group1 n ranks1 group2 ranks2) 
  ((MPI_Group) group1)
  ((-int-) n)
  ((-gptr- "int *") ranks1)
  ((MPI_Group) group2)
  ((-gptr- "int *") ranks2) 
  (int  #{ MPI_Group_translate_ranks ($group1, $n, $ranks1, $group2, $ranks2) #}))

(de MPI_Group_compare  (group1 group2 result) 
  ((MPI_Group) group1)
  ((MPI_Group) group2)
  ((-gptr- "int *") result) 
  (int  #{ MPI_Group_compare($group1, $group2, $result) #}))

(de MPI_Comm_group  (comm group) 
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Group *") group) 
  (int  #{ MPI_Comm_group($comm, $group) #}))

(de MPI_Group_union  (group1 group2 newgroup) 
  ((MPI_Group) group1)
  ((MPI_Group) group2)
  ((-gptr- "MPI_Group *") newgroup) 
  (int  #{ MPI_Group_union($group1, $group2, $newgroup) #}))

(de MPI_Group_intersection  (group1 group2 newgroup) 
  ((MPI_Group) group1)
  ((MPI_Group) group2)
  ((-gptr- "MPI_Group *") newgroup) 
  (int  #{ MPI_Group_intersection($group1, $group2, $newgroup) #}))

(de MPI_Group_difference  (group1 group2 newgroup) 
  ((MPI_Group) group1)
  ((MPI_Group) group2)
  ((-gptr- "MPI_Group *") newgroup) 
  (int  #{ MPI_Group_difference($group1, $group2, $newgroup) #}))

(de MPI_Group_incl  (group n ranks newgroup) 
  ((MPI_Group) group)
  ((-int-) n)
  ((-gptr- "int *") ranks)
  ((-gptr- "MPI_Group *") newgroup) 
  (int  #{ MPI_Group_incl($group, $n, $ranks, $newgroup) #}))

(de MPI_Group_excl  (group n ranks newgroup) 
  ((MPI_Group) group)
  ((-int-) n)
  ((-gptr- "int *") ranks)
  ((-gptr- "MPI_Group *") newgroup) 
  (int  #{ MPI_Group_excl($group, $n, $ranks, $newgroup) #}))

(de MPI_Group_free  (group) 
  ((-gptr- "MPI_Group *") group) 
  (int  #{ MPI_Group_free($group) #}))

(de MPI_Comm_size  (comm size) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") size) 
  (int  #{ MPI_Comm_size($comm, $size) #}))

(de MPI_Comm_rank  (comm rank) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") rank) 
  (int  #{ MPI_Comm_rank($comm, $rank) #}))

(de MPI_Comm_compare  (comm1 comm2 result) 
  ((MPI_Comm) comm1)
  ((MPI_Comm) comm2)
  ((-gptr- "int *") result) 
  (int  #{ MPI_Comm_compare($comm1, $comm2, $result) #}))

(de MPI_Comm_dup  (comm newcomm) 
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Comm *") newcomm) 
  (int  #{ MPI_Comm_dup($comm, $newcomm) #}))

(de MPI_Comm_create  (comm group newcomm) 
  ((MPI_Comm) comm)
  ((MPI_Group) group)
  ((-gptr- "MPI_Comm *") newcomm) 
  (int  #{ MPI_Comm_create($comm, $group, $newcomm) #}))

(de MPI_Comm_split  (comm color key newcomm) 
  ((MPI_Comm) comm)
  ((-int-) color)
  ((-int-) key)
  ((-gptr- "MPI_Comm *") newcomm) 
  (int  #{ MPI_Comm_split($comm, $color, $key, $newcomm) #}))

(de MPI_Comm_free  (comm) 
  ((-gptr- "MPI_Comm *") comm) 
  (int  #{ MPI_Comm_free($comm) #}))

(de MPI_Comm_test_inter  (comm flag) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") flag) 
  (int  #{ MPI_Comm_test_inter($comm, $flag) #}))

(de MPI_Comm_remote_size  (comm size) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") size) 
  (int  #{ MPI_Comm_remote_size($comm, $size) #}))

(de MPI_Comm_remote_group  (comm group) 
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Group *") group) 
  (int  #{ MPI_Comm_remote_group($comm, $group) #}))

(de MPI_Intercomm_create  (local_comm local_leader peer_comm remote_leader tag newintercomm) 
  ((MPI_Comm) local_comm)
  ((-int-) local_leader)
  ((MPI_Comm) peer_comm)
  ((-int-) remote_leader)
  ((-int-) tag)
  ((-gptr- "MPI_Comm *") newintercomm) 
  (int  #{ MPI_Intercomm_create($local_comm, $local_leader, $peer_comm, $remote_leader, $tag, $newintercomm) #}))

(de MPI_Intercomm_merge  (intercomm high newintracomm) 
  ((MPI_Comm) intercomm)
  ((-int-) high)
  ((-gptr- "MPI_Comm *") newintracomm) 
  (int  #{ MPI_Intercomm_merge($intercomm, $high, $newintracomm) #}))

(de MPI_Keyval_create  (copy_fn delete_fn keyval extra_state) 
  ((-gptr- "MPI_Copy_function *") copy_fn)
  ((-gptr- "MPI_Delete_function *") delete_fn)
  ((-gptr- "int *") keyval)
  ((-gptr-) extra_state) 
  (int  #{ MPI_Keyval_create($copy_fn, $delete_fn, $keyval, $extra_state) #}))

(de MPI_Keyval_free  (keyval) 
  ((-gptr- "int *") keyval) 
  (int  #{ MPI_Keyval_free($keyval) #}))

(de MPI_Attr_put  (comm keyval attribute_val) 
  ((MPI_Comm) comm)
  ((-int-) keyval)
  ((-gptr-) attribute_val) 
  (int  #{ MPI_Attr_put($comm, $keyval, $attribute_val) #}))

(de MPI_Attr_get  (comm keyval attribute_val flag) 
  ((MPI_Comm) comm)
  ((-int-) keyval)
  ((-gptr-) attribute_val)
  ((-gptr- "int *") flag) 
  (int  #{ MPI_Attr_get($comm, $keyval, $attribute_val, $flag) #}))

(de MPI_Attr_delete  (comm keyval) 
  ((MPI_Comm) comm)
  ((-int-) keyval) 
  (int  #{ MPI_Attr_delete($comm, $keyval)  #}))

(de MPI_Cart_create  (comm_old ndims dims periods reorder comm_cart) 
  ((MPI_Comm) comm_old)
  ((-int-) ndims)
  ((-gptr- "int *") dims)
  ((-gptr- "int *") periods)
  ((-int-) reorder)
  ((-gptr- "MPI_Comm *") comm_cart) 
  (int  #{ MPI_Cart_create($comm_old, $ndims, $dims, $periods, $reorder, $comm_cart) #}))

(de MPI_Dims_create  (nnodes ndims dims) 
  ((-int-) nnodes)
  ((-int-) ndims)
  ((-gptr- "int *") dims) 
  (int  #{ MPI_Dims_create($nnodes, $ndims, $dims) #}))

(de MPI_Graph_create  (comm_old nnodes index edges reorder comm_graph) 
  ((MPI_Comm) comm_old)
  ((-int-) nnodes)
  ((-gptr- "int *") index)
  ((-gptr- "int *") edges)
  ((-int-) reorder)
  ((-gptr- "MPI_Comm *") comm_graph) 
  (int  #{ MPI_Graph_create($comm_old, $nnodes, $index, $edges, $reorder, $comm_graph) #}))

(de MPI_Topo_test  (comm status) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") status) 
  (int  #{ MPI_Topo_test($comm, $status) #}))

(de MPI_Graphdims_get  (comm nnodes nedges) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") nnodes)
  ((-gptr- "int *") nedges) 
  (int  #{ MPI_Graphdims_get($comm, $nnodes, $nedges) #}))

(de MPI_Graph_get  (comm maxindex maxedges index edges) 
  ((MPI_Comm) comm)
  ((-int-) maxindex)
  ((-int-) maxedges)
  ((-gptr- "int *") index)
  ((-gptr- "int *") edges) 
  (int  #{ MPI_Graph_get($comm, $maxindex, $maxedges, $index, $edges) #}))

(de MPI_Cartdim_get  (comm ndims) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") ndims) 
  (int  #{ MPI_Cartdim_get($comm, $ndims) #}))

(de MPI_Cart_get  (comm maxdims dims periods coords) 
  ((MPI_Comm) comm)
  ((-int-) maxdims)
  ((-gptr- "int *") dims)
  ((-gptr- "int *") periods)
  ((-gptr- "int *") coords) 
  (int  #{ MPI_Cart_get($comm, $maxdims, $dims, $periods, $coords) #}))

(de MPI_Cart_rank  (comm coords rank) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") coords)
  ((-gptr- "int *") rank) 
  (int  #{ MPI_Cart_rank($comm, $coords, $rank) #}))

(de MPI_Cart_coords  (comm rank maxdims coords) 
  ((MPI_Comm) comm)
  ((-int-) rank)
  ((-int-) maxdims)
  ((-gptr- "int *") coords) 
  (int  #{ MPI_Cart_coords($comm, $rank, $maxdims, $coords) #}))

(de MPI_Graph_neighbors_count  (comm rank nneighbors) 
  ((MPI_Comm) comm)
  ((-int-) rank)
  ((-gptr- "int *") nneighbors) 
  (int  #{ MPI_Graph_neighbors_count($comm, $rank, $nneighbors) #}))

(de MPI_Graph_neighbors  (comm rank maxneighbors neighbors) 
  ((MPI_Comm) comm)
  ((-int-) rank)
  ((-int-) maxneighbors)
  ((-gptr- "int *") neighbors) 
  (int  #{ MPI_Graph_neighbors($comm, $rank, $maxneighbors, $neighbors) #}))

(de MPI_Cart_shift  (comm direction disp rank_source rank_dest) 
  ((MPI_Comm) comm)
  ((-int-) direction)
  ((-int-) disp)
  ((-gptr- "int *") rank_source)
  ((-gptr- "int *") rank_dest) 
  (int  #{ MPI_Cart_shift($comm, $direction, $disp, $rank_source, $rank_dest) #}))

(de MPI_Cart_sub  (comm remain_dims newcomm) 
  ((MPI_Comm) comm)
  ((-gptr- "int *") remain_dims)
  ((-gptr- "MPI_Comm *") newcomm) 
  (int  #{ MPI_Cart_sub($comm, $remain_dims, $newcomm) #}))

(de MPI_Cart_map  (comm ndims dims periods newrank) 
  ((MPI_Comm) comm)
  ((-int-) ndims)
  ((-gptr- "int *") dims)
  ((-gptr- "int *") periods)
  ((-gptr- "int *") newrank) 
  (int  #{ MPI_Cart_map($comm, $ndims, $dims, $periods, $newrank) #}))

(de MPI_Graph_map  (comm nnodes index edges newrank) 
  ((MPI_Comm) comm)
  ((-int-) nnodes)
  ((-gptr- "int *") index)
  ((-gptr- "int *") edges)
  ((-gptr- "int *") newrank) 
  (int  #{ MPI_Graph_map($comm, $nnodes, $index, $edges, $newrank)  #}))

(de MPI_Get_processor_name  (name resultlen) 
  ((-gptr- "char *") name)
  ((-gptr- "int *") resultlen) 
  (int  #{ MPI_Get_processor_name($name, $resultlen) #}))

(de MPI_Errhandler_create  (function errhandler) 
  ((-gptr- "MPI_Handler_function *") function)
  ((-gptr- "MPI_Errhandler *") errhandler) 
  (int  #{ MPI_Errhandler_create($function, $errhandler) #}))

(de MPI_Errhandler_set  (comm errhandler) 
  ((MPI_Comm) comm)
  ((MPI_Errhandler) errhandler) 
  (int  #{ MPI_Errhandler_set($comm, $errhandler) #}))

(de MPI_Errhandler_get  (comm errhandler) 
  ((MPI_Comm) comm)
  ((-gptr- "MPI_Errhandler *") errhandler) 
  (int  #{ MPI_Errhandler_get($comm, $errhandler) #}))

(de MPI_Errhandler_free  (errhandler) 
  ((-gptr- "MPI_Errhandler *") errhandler) 
  (int  #{ MPI_Errhandler_free($errhandler) #}))

(de MPI_Error_string  (errorcode string resultlen) 
  ((-int-) errorcode)
  ((-gptr- "char *") string)
  ((-gptr- "int *") resultlen) 
  (int  #{ MPI_Error_string($errorcode, $string, $resultlen) #}))

(de MPI_Error_class  (errorcode errorclass) 
  ((-int-) errorcode)
  ((-gptr- "int *") errorclass) 
  (int  #{ MPI_Error_class($errorcode, $errorclass) #}))

(de MPI_Wtime  () 
  (double  #{ MPI_Wtime() #}))

(de MPI_Wtick  () 
  (double  #{ MPI_Wtick() #}))

(de MPI_Initialized  (flag) 
  ((-gptr- "int *") flag) 
  (int  #{ MPI_Initialized($flag) #}))

(de MPI_Abort  (comm errorcode) 
  ((MPI_Comm) comm)
  ((-int-) errorcode) 
  (int  #{ MPI_Abort($comm, $errorcode)  #}))

;;(de MPI_Pcontrol  (level const int) level) ...,  
;;    ((-...-)) #}))
;;
;;(de MPI_Group_range_incl  (group n ranges[][3] newgroup)
;;
;;    ((-int-) n)
;;    ((-int-) ranges[][3])
;;    ((-gptr- "MPI_Group *") newgroup) 
;;    (int  #{ MPI_Group_range_incl($group, $n, $ranges[][3]
;;    ((-gptr- "MPI_Group *") newgroup)) #}))
;;
;;(de MPI_Group_range_excl  ($group n ranges[][3] newgroup)
;;  ((MPI_Group) group)
;;  ((-int-) n)
;;  ((-int-) ranges[][3]) newgroup 
;;  (int  #{ MPI_Group_range_excl($group, $n, $ranges[][3]
;;    ((-gptr- "MPI_Group *") newgroup)) #}))


;;************************************************************
;;*********  constants ***************************************
;;************************************************************


(de get_MPI_SUCCESS ()  
  (to-int #{ MPI_SUCCESS #} ))

(de get_MPI_ERR_BUFFER ()      
  (to-int #{ MPI_ERR_BUFFER #} ))

(de get_MPI_ERR_COUNT ()  
  (to-int #{ MPI_ERR_COUNT #} ))

(de get_MPI_ERR_TYPE ()  
  (to-int #{ MPI_ERR_TYPE #} ))

(de get_MPI_ERR_TAG ()  
  (to-int #{ MPI_ERR_TAG #} ))

(de get_MPI_ERR_COMM ()  
  (to-int #{ MPI_ERR_COMM #} ))

(de get_MPI_ERR_RANK ()  
  (to-int #{ MPI_ERR_RANK #} ))

(de get_MPI_ERR_REQUEST ()  
  (to-int #{ MPI_ERR_REQUEST #} ))

(de get_MPI_ERR_ROOT ()  
  (to-int #{ MPI_ERR_ROOT #} ))

(de get_MPI_ERR_GROUP ()  
  (to-int #{ MPI_ERR_GROUP #} ))

(de get_MPI_ERR_OP ()  
  (to-int #{ MPI_ERR_OP #} ))

(de get_MPI_ERR_TOPOLOGY ()  
  (to-int #{ MPI_ERR_TOPOLOGY #} ))

(de get_MPI_ERR_DIMS ()  
  (to-int #{ MPI_ERR_DIMS #} ))

(de get_MPI_ERR_ARG ()  
  (to-int #{ MPI_ERR_ARG #} ))

(de get_MPI_ERR_UNKNOWN ()  
  (to-int #{ MPI_ERR_UNKNOWN #} ))

(de get_MPI_ERR_TRUNCATE ()  
  (to-int #{ MPI_ERR_TRUNCATE #} ))

(de get_MPI_ERR_OTHER ()  
  (to-int #{ MPI_ERR_OTHER #} ))

(de get_MPI_ERR_INTERN ()  
  (to-int #{ MPI_ERR_INTERN #} ))

;;(de get_MPI_PENDING ()  
;;  (to-int #{ MPI_PENDING #} ))

(de get_MPI_ERR_IN_STATUS ()  
  (to-int #{ MPI_ERR_IN_STATUS #} ))

(de get_MPI_ERR_LASTCODE ()  
  (to-int #{ MPI_ERR_LASTCODE #} ))

(de get_MPI_BOTTOM ()  
  (to-gptr #{ MPI_BOTTOM #} ))

(de get_MPI_PROC_NULL ()  
  (to-int #{ MPI_PROC_NULL #} ))

(de get_MPI_ANY_SOURCE ()  
  (to-int #{ MPI_ANY_SOURCE #} ))

(de get_MPI_ANY_TAG ()  
  (to-int #{ MPI_ANY_TAG #} ))

(de get_MPI_UNDEFINED ()  
  (to-int #{ MPI_UNDEFINED #} ))

(de get_MPI_BSEND_OVERHEAD ()  
  (to-int #{ MPI_BSEND_OVERHEAD #} ))

(de get_MPI_KEYVAL_INVALID ()  
  (to-int #{ MPI_KEYVAL_INVALID #} ))

(de get_MPI_ERRORS_ARE_FATAL ()  
  (to-mpi-errhandler #{ MPI_ERRORS_ARE_FATAL #} ))

(de get_MPI_ERRORS_RETURN ()  
  (to-mpi-errhandler #{ MPI_ERRORS_RETURN #} ))

(de get_MPI_MAX_PROCESSOR_NAME ()  
  (to-int #{ MPI_MAX_PROCESSOR_NAME #} ))

(de get_MPI_MAX_ERROR_STRING ()  
  (to-int #{ MPI_MAX_ERROR_STRING #} ))

(de get_MPI_CHAR ()  
  (to-mpi-datatype #{ MPI_CHAR #} ))

(de get_MPI_SHORT ()  
  (to-mpi-datatype #{ MPI_SHORT #} ))

(de get_MPI_INT ()  
  (to-mpi-datatype #{ MPI_INT #} ))

(de get_MPI_LONG ()  
  (to-mpi-datatype #{ MPI_LONG #} ))

(de get_MPI_UNSIGNED_CHAR ()  
  (to-mpi-datatype #{ MPI_UNSIGNED_CHAR #} ))

(de get_MPI_UNSIGNED_SHORT ()  
  (to-mpi-datatype #{ MPI_UNSIGNED_SHORT #} ))

(de get_MPI_UNSIGNED ()  
  (to-mpi-datatype #{ MPI_UNSIGNED #} ))

(de get_MPI_UNSIGNED_LONG ()  
  (to-mpi-datatype #{ MPI_UNSIGNED_LONG #} ))

(de get_MPI_FLOAT ()  
  (to-mpi-datatype #{ MPI_FLOAT #} ))

(de get_MPI_DOUBLE ()  
  (to-mpi-datatype #{ MPI_DOUBLE #} ))

(de get_MPI_LONG_DOUBLE ()  
  (to-mpi-datatype #{ MPI_LONG_DOUBLE #} ))

(de get_MPI_BYTE ()  
  (to-mpi-datatype #{ MPI_BYTE #} ))

(de get_MPI_PACKED ()  
  (to-mpi-datatype #{ MPI_PACKED #} ))

(de get_MPI_FLOAT_INT ()  
  (to-mpi-datatype #{ MPI_FLOAT_INT #} ))

(de get_MPI_DOUBLE_INT ()  
  (to-mpi-datatype #{ MPI_DOUBLE_INT #} ))

(de get_MPI_LONG_INT ()  
  (to-mpi-datatype #{ MPI_LONG_INT #} ))

(de get_MPI_2INT ()  
  (to-mpi-datatype #{ MPI_2INT #} ))

(de get_MPI_SHORT_INT ()  
  (to-mpi-datatype #{ MPI_SHORT_INT #} ))

(de get_MPI_LONG_DOUBLE_INT ()  
  (to-mpi-datatype #{ MPI_LONG_DOUBLE_INT #} ))

(de get_MPI_LONG_LONG_INT ()  
  (to-mpi-datatype #{ MPI_LONG_LONG_INT #} ))

(de get_MPI_UB ()  
  (to-mpi-datatype #{ MPI_UB #} ))

(de get_MPI_LB ()  
  (to-mpi-datatype #{ MPI_LB #} ))

(de get_MPI_COMM_WORLD ()  
  (to-mpi-comm #{ MPI_COMM_WORLD #} ))

(de get_MPI_COMM_SELF ()  
  (to-mpi-comm #{ MPI_COMM_SELF #} ))

(de get_MPI_IDENT ()  
  (to-int #{ MPI_IDENT #} ))

(de get_MPI_CONGRUENT ()  
  (to-int #{ MPI_CONGRUENT #} ))

(de get_MPI_SIMILAR ()  
  (to-int #{ MPI_SIMILAR #} ))

(de get_MPI_UNEQUAL ()  
  (to-int #{ MPI_UNEQUAL #} ))

(de get_MPI_TAG_UB ()  
  (to-int #{ MPI_TAG_UB #} ))

(de get_MPI_IO ()  
  (to-int #{ MPI_IO #} ))

(de get_MPI_HOST ()  
  (to-int #{ MPI_HOST #} ))

(de get_MPI_WTIME_IS_GLOBAL ()  
  (to-int #{ MPI_WTIME_IS_GLOBAL #} ))

(de get_MPI_MAX ()  
  (to-mpi-op #{ MPI_MAX #} ))

(de get_MPI_MIN ()  
  (to-mpi-op #{ MPI_MIN #} ))

(de get_MPI_SUM ()  
  (to-mpi-op #{ MPI_SUM #} ))

(de get_MPI_PROD ()  
  (to-mpi-op #{ MPI_PROD #} ))

(de get_MPI_MAXLOC ()  
  (to-mpi-op #{ MPI_MAXLOC #} ))

(de get_MPI_MINLOC ()  
  (to-mpi-op #{ MPI_MINLOC #} ))

(de get_MPI_BAND ()  
  (to-mpi-op #{ MPI_BAND #} ))

(de get_MPI_BOR ()  
  (to-mpi-op #{ MPI_BOR #} ))

(de get_MPI_BXOR ()  
  (to-mpi-op #{ MPI_BXOR #} ))

(de get_MPI_LAND ()  
  (to-mpi-op #{ MPI_LAND #} ))

(de get_MPI_LOR ()  
  (to-mpi-op #{ MPI_LOR #} ))

(de get_MPI_LXOR ()  
  (to-mpi-op #{ MPI_LXOR #} ))

(de get_MPI_GROUP_NULL ()  
  (to-mpi-group #{ MPI_GROUP_NULL #} ))

(de get_MPI_COMM_NULL ()  
  (to-mpi-comm #{ MPI_COMM_NULL #} ))

(de get_MPI_DATATYPE_NULL ()  
  (to-mpi-datatype #{ MPI_DATATYPE_NULL #} ))

(de get_MPI_REQUEST_NULL ()  
  (to-mpi-request #{ MPI_REQUEST_NULL #} ))

(de get_MPI_OP_NULL ()  
  (to-mpi-op #{ MPI_OP_NULL #} ))

(de get_MPI_ERRHANDLER_NULL ()  
  (to-mpi-errhandler #{ MPI_ERRHANDLER_NULL #} ))

(de get_MPI_GROUP_EMPTY ()  
  (to-mpi-group #{ MPI_GROUP_EMPTY #} ))

(de get_MPI_GRAPH ()  
  (to-int #{ MPI_GRAPH #} ))

(de get_MPI_CART ()  
  (to-int #{ MPI_CART #} ))

(dhc-make-with-libs () (list mpi-libmpi) 
                    mpi-dummy 
                    alloc_MPI_Status MPI_Send MPI_Recv MPI_Get_count
                    MPI_Bsend MPI_Ssend MPI_Rsend MPI_Buffer_attach
                    MPI_Buffer_detach MPI_Isend MPI_Ibsend MPI_Issend
                    MPI_Irsend MPI_Irecv MPI_Wait MPI_Test
                    MPI_Request_free MPI_Waitany MPI_Testany
                    MPI_Waitall MPI_Testall MPI_Waitsome MPI_Testsome
                    MPI_Iprobe MPI_Probe MPI_Cancel MPI_Test_cancelled
                    MPI_Send_init MPI_Bsend_init MPI_Ssend_init
                    MPI_Rsend_init MPI_Recv_init MPI_Start
                    MPI_Startall MPI_Sendrecv MPI_Sendrecv_replace
                    MPI_Type_contiguous MPI_Type_vector
                    MPI_Type_hvector MPI_Type_indexed
                    MPI_Type_hindexed MPI_Type_struct MPI_Address
                    MPI_Type_extent MPI_Type_size MPI_Type_lb
                    MPI_Type_ub MPI_Type_commit MPI_Type_free
                    MPI_Get_elements MPI_Pack MPI_Unpack MPI_Pack_size
                    MPI_Barrier MPI_Bcast MPI_Gather MPI_Gatherv
                    MPI_Scatter MPI_Scatterv MPI_Allgather
                    MPI_Allgatherv MPI_Alltoall MPI_Alltoallv
                    MPI_Reduce MPI_Op_create MPI_Op_free MPI_Allreduce
                    MPI_Reduce_scatter MPI_Scan MPI_Group_size
                    MPI_Group_rank MPI_Group_translate_ranks
                    MPI_Group_compare MPI_Comm_group MPI_Group_union
                    MPI_Group_intersection MPI_Group_difference
                    MPI_Group_incl MPI_Group_excl MPI_Group_free
                    MPI_Comm_size MPI_Comm_rank MPI_Comm_compare
                    MPI_Comm_dup MPI_Comm_create MPI_Comm_split
                    MPI_Comm_free MPI_Comm_test_inter
                    MPI_Comm_remote_size MPI_Comm_remote_group
                    MPI_Intercomm_create MPI_Intercomm_merge
                    MPI_Keyval_create MPI_Keyval_free MPI_Attr_put
                    MPI_Attr_get MPI_Attr_delete MPI_Cart_create
                    MPI_Dims_create MPI_Graph_create MPI_Topo_test
                    MPI_Graphdims_get MPI_Graph_get MPI_Cartdim_get
                    MPI_Cart_get MPI_Cart_rank MPI_Cart_coords
                    MPI_Graph_neighbors_count MPI_Graph_neighbors
                    MPI_Cart_shift MPI_Cart_sub MPI_Cart_map
                    MPI_Graph_map MPI_Get_processor_name
                    MPI_Errhandler_create MPI_Errhandler_set
                    MPI_Errhandler_get MPI_Errhandler_free
                    MPI_Error_string MPI_Error_class MPI_Wtime
                    MPI_Wtick MPI_Initialized MPI_Abort
                    get_MPI_SUCCESS get_MPI_ERR_BUFFER
                    get_MPI_ERR_COUNT get_MPI_ERR_TYPE get_MPI_ERR_TAG
                    get_MPI_ERR_COMM get_MPI_ERR_RANK
                    get_MPI_ERR_REQUEST get_MPI_ERR_ROOT
                    get_MPI_ERR_GROUP get_MPI_ERR_OP
                    get_MPI_ERR_TOPOLOGY get_MPI_ERR_DIMS
                    get_MPI_ERR_ARG get_MPI_ERR_UNKNOWN
                    get_MPI_ERR_TRUNCATE get_MPI_ERR_OTHER
                    get_MPI_ERR_INTERN get_MPI_ERR_IN_STATUS
                    get_MPI_ERR_LASTCODE get_MPI_BOTTOM
                    get_MPI_PROC_NULL get_MPI_ANY_SOURCE
                    get_MPI_ANY_TAG get_MPI_UNDEFINED
                    get_MPI_BSEND_OVERHEAD get_MPI_KEYVAL_INVALID
                    get_MPI_ERRORS_ARE_FATAL get_MPI_ERRORS_RETURN
                    get_MPI_MAX_PROCESSOR_NAME
                    get_MPI_MAX_ERROR_STRING get_MPI_CHAR
                    get_MPI_SHORT get_MPI_INT get_MPI_LONG
                    get_MPI_UNSIGNED_CHAR get_MPI_UNSIGNED_SHORT
                    get_MPI_UNSIGNED get_MPI_UNSIGNED_LONG
                    get_MPI_FLOAT get_MPI_DOUBLE get_MPI_LONG_DOUBLE
                    get_MPI_BYTE get_MPI_PACKED get_MPI_FLOAT_INT
                    get_MPI_DOUBLE_INT get_MPI_LONG_INT get_MPI_2INT
                    get_MPI_SHORT_INT get_MPI_LONG_DOUBLE_INT
                    get_MPI_LONG_LONG_INT get_MPI_UB get_MPI_LB
                    get_MPI_COMM_WORLD get_MPI_COMM_SELF get_MPI_IDENT
                    get_MPI_CONGRUENT get_MPI_SIMILAR get_MPI_UNEQUAL
                    get_MPI_TAG_UB get_MPI_IO get_MPI_HOST
                    get_MPI_WTIME_IS_GLOBAL get_MPI_MAX get_MPI_MIN
                    get_MPI_SUM get_MPI_PROD get_MPI_MAXLOC
                    get_MPI_MINLOC get_MPI_BAND get_MPI_BOR
                    get_MPI_BXOR get_MPI_LAND get_MPI_LOR get_MPI_LXOR
                    get_MPI_GROUP_NULL get_MPI_COMM_NULL
                    get_MPI_DATATYPE_NULL get_MPI_REQUEST_NULL
                    get_MPI_OP_NULL get_MPI_ERRHANDLER_NULL
                    get_MPI_GROUP_EMPTY get_MPI_GRAPH get_MPI_CART )

(mpi-init)

(defconstant "MPI_SUCCESS" (get_MPI_SUCCESS))
(defconstant "MPI_ERR_BUFFER" (get_MPI_ERR_BUFFER))
(defconstant "MPI_ERR_COUNT" (get_MPI_ERR_COUNT))
(defconstant "MPI_ERR_TYPE" (get_MPI_ERR_TYPE))
(defconstant "MPI_ERR_TAG" (get_MPI_ERR_TAG))
(defconstant "MPI_ERR_COMM" (get_MPI_ERR_COMM))
(defconstant "MPI_ERR_RANK" (get_MPI_ERR_RANK))
(defconstant "MPI_ERR_REQUEST" (get_MPI_ERR_REQUEST))
(defconstant "MPI_ERR_ROOT" (get_MPI_ERR_ROOT))
(defconstant "MPI_ERR_GROUP" (get_MPI_ERR_GROUP))
(defconstant "MPI_ERR_OP" (get_MPI_ERR_OP))
(defconstant "MPI_ERR_TOPOLOGY" (get_MPI_ERR_TOPOLOGY))
(defconstant "MPI_ERR_DIMS" (get_MPI_ERR_DIMS))
(defconstant "MPI_ERR_ARG" (get_MPI_ERR_ARG))
(defconstant "MPI_ERR_UNKNOWN" (get_MPI_ERR_UNKNOWN))
(defconstant "MPI_ERR_TRUNCATE" (get_MPI_ERR_TRUNCATE))
(defconstant "MPI_ERR_OTHER" (get_MPI_ERR_OTHER))
(defconstant "MPI_ERR_INTERN" (get_MPI_ERR_INTERN))
(defconstant "MPI_ERR_IN_STATUS" (get_MPI_ERR_IN_STATUS))
(defconstant "MPI_ERR_LASTCODE" (get_MPI_ERR_LASTCODE))
(defconstant "MPI_BOTTOM" (get_MPI_BOTTOM))
(defconstant "MPI_PROC_NULL" (get_MPI_PROC_NULL))
(defconstant "MPI_ANY_SOURCE" (get_MPI_ANY_SOURCE))
(defconstant "MPI_ANY_TAG" (get_MPI_ANY_TAG))
(defconstant "MPI_UNDEFINED" (get_MPI_UNDEFINED))
(defconstant "MPI_BSEND_OVERHEAD" (get_MPI_BSEND_OVERHEAD))
(defconstant "MPI_KEYVAL_INVALID" (get_MPI_KEYVAL_INVALID))
(defconstant "MPI_ERRORS_ARE_FATAL" (get_MPI_ERRORS_ARE_FATAL))
(defconstant "MPI_ERRORS_RETURN" (get_MPI_ERRORS_RETURN))
(defconstant "MPI_MAX_PROCESSOR_NAME" (get_MPI_MAX_PROCESSOR_NAME))
(defconstant "MPI_MAX_ERROR_STRING" (get_MPI_MAX_ERROR_STRING))
(defconstant "MPI_CHAR" (get_MPI_CHAR))
(defconstant "MPI_SHORT" (get_MPI_SHORT))
(defconstant "MPI_INT" (get_MPI_INT))
(defconstant "MPI_LONG" (get_MPI_LONG))
(defconstant "MPI_UNSIGNED_CHAR" (get_MPI_UNSIGNED_CHAR))
(defconstant "MPI_UNSIGNED_SHORT" (get_MPI_UNSIGNED_SHORT))
(defconstant "MPI_UNSIGNED" (get_MPI_UNSIGNED))
(defconstant "MPI_UNSIGNED_LONG" (get_MPI_UNSIGNED_LONG))
(defconstant "MPI_FLOAT" (get_MPI_FLOAT))
(defconstant "MPI_DOUBLE" (get_MPI_DOUBLE))
(defconstant "MPI_LONG_DOUBLE" (get_MPI_LONG_DOUBLE))
(defconstant "MPI_BYTE" (get_MPI_BYTE))
(defconstant "MPI_PACKED" (get_MPI_PACKED))
(defconstant "MPI_FLOAT_INT" (get_MPI_FLOAT_INT))
(defconstant "MPI_DOUBLE_INT" (get_MPI_DOUBLE_INT))
(defconstant "MPI_LONG_INT" (get_MPI_LONG_INT))
(defconstant "MPI_2INT" (get_MPI_2INT))
(defconstant "MPI_SHORT_INT" (get_MPI_SHORT_INT))
(defconstant "MPI_LONG_DOUBLE_INT" (get_MPI_LONG_DOUBLE_INT))
(defconstant "MPI_LONG_LONG_INT" (get_MPI_LONG_LONG_INT))
(defconstant "MPI_UB" (get_MPI_UB))
(defconstant "MPI_LB" (get_MPI_LB))
(defconstant "MPI_COMM_WORLD" (get_MPI_COMM_WORLD))
(defconstant "MPI_COMM_SELF" (get_MPI_COMM_SELF))
(defconstant "MPI_IDENT" (get_MPI_IDENT))
(defconstant "MPI_CONGRUENT" (get_MPI_CONGRUENT))
(defconstant "MPI_SIMILAR" (get_MPI_SIMILAR))
(defconstant "MPI_UNEQUAL" (get_MPI_UNEQUAL))
(defconstant "MPI_TAG_UB" (get_MPI_TAG_UB))
(defconstant "MPI_IO" (get_MPI_IO))
(defconstant "MPI_HOST" (get_MPI_HOST))
(defconstant "MPI_WTIME_IS_GLOBAL" (get_MPI_WTIME_IS_GLOBAL))
(defconstant "MPI_MAX" (get_MPI_MAX))
(defconstant "MPI_MIN" (get_MPI_MIN))
(defconstant "MPI_SUM" (get_MPI_SUM))
(defconstant "MPI_PROD" (get_MPI_PROD))
(defconstant "MPI_MAXLOC" (get_MPI_MAXLOC))
(defconstant "MPI_MINLOC" (get_MPI_MINLOC))
(defconstant "MPI_BAND" (get_MPI_BAND))
(defconstant "MPI_BOR" (get_MPI_BOR))
(defconstant "MPI_BXOR" (get_MPI_BXOR))
(defconstant "MPI_LAND" (get_MPI_LAND))
(defconstant "MPI_LOR" (get_MPI_LOR))
(defconstant "MPI_LXOR" (get_MPI_LXOR))
(defconstant "MPI_GROUP_NULL" (get_MPI_GROUP_NULL))
(defconstant "MPI_COMM_NULL" (get_MPI_COMM_NULL))
(defconstant "MPI_DATATYPE_NULL" (get_MPI_DATATYPE_NULL))
(defconstant "MPI_REQUEST_NULL" (get_MPI_REQUEST_NULL))
(defconstant "MPI_OP_NULL" (get_MPI_OP_NULL))
(defconstant "MPI_ERRHANDLER_NULL" (get_MPI_ERRHANDLER_NULL))
(defconstant "MPI_GROUP_EMPTY" (get_MPI_GROUP_EMPTY))
(defconstant "MPI_GRAPH" (get_MPI_GRAPH))
(defconstant "MPI_CART" (get_MPI_CART))
