ADMB Documentation  11.1.1631
 All Classes Files Functions Variables Typedefs Friends Defines
adpvm2.h
Go to the documentation of this file.
00001 /*
00002  * $Id: adpvm2.h 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  *
00007  * ADModelbuilder and associated libraries and documentations are
00008  * provided under the general terms of the "BSD" license.
00009  *
00010  * License:
00011  *
00012  * Redistribution and use in source and binary forms, with or without
00013  * modification, are permitted provided that the following conditions are
00014  * met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright
00017  * notice, this list of conditions and the following disclaimer.
00018  *
00019  * 2.  Redistributions in binary form must reproduce the above copyright
00020  * notice, this list of conditions and the following disclaimer in the
00021  * documentation and/or other materials provided with the distribution.
00022  *
00023  * 3.  Neither the name of the  University of California, Otter Research,
00024  * nor the ADMB Foundation nor the names of its contributors may be used
00025  * to endorse or promote products derived from this software without
00026  * specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00029  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00030  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00031  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00032  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00033  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00034  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00035  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00036  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00038  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  */
00045 #if defined(USE_ADPVM)
00046 
00047 #if !defined(__ADPVM2__)
00048 #  define __ADPVM2__
00049 
00050 #include <admodel.h>
00051 
00052 #if defined(__cplusplus)
00053 //  extern "C" {
00054 #  endif
00055 #if defined(__BORLANDC__)
00056 #  if !defined(__linux__)
00057 #   include <pvm3bor.h>
00058 #   include <pvm3.h>
00059 #  endif
00060 #else
00061 #  include <pvm3.h>
00062 #endif
00063 #if defined(__cplusplus)
00064 //}
00065 #endif
00066 
00067 #if defined(WIN32)  && !defined(__linux__)
00068 #  include <windows.h>
00069 #endif
00070 
00071 
00072 int adpvm_initsend( int mode);
00073 int adpvm_recv( int id,int n );
00074 void adpvm_pack_number_derivative(void);
00075 void adpvm_send_derivatives(void);
00076 void adpvm_receive_derivatives(void);
00077 void adpvm_send(int id,int n);
00078 void adpvm_unpack_vector_derivatives(void);
00079 void initialize_pvm_buffer(void);
00080 void  adpvm_end_receive(void);
00081 void  pvm_end_receive(void);
00082 void adpvm_unpack_number_derivative(void);
00083 void adpvm_pack_vector_derivatives(void);
00084 
00085 void pvm_pack(const prevariable& _v);
00086 void pvm_pack(const dvar_vector& _v);
00087 void pvm_pack(const dvar_matrix & _m);
00088 void pvm_pack(const dvar3_array & _m);
00089 void pvm_pack(const dvar4_array & _m);
00090 void pvm_pack(const dvar5_array & _m);
00091 
00092 void pvm_unpack(const int& _v);
00093 void pvm_unpack(const prevariable& _v);
00094 void pvm_unpack(const dvar_vector& _v);
00095 void pvm_unpack(const dvar_matrix & _m);
00096 void pvm_unpack(const dvar3_array & _m);
00097 void pvm_unpack(const dvar4_array & _m);
00098 void pvm_unpack(const dvar5_array & _m);
00099 
00100 void pvm_pack(double v);
00101 void pvm_pack(const dvector& _v);
00102 void pvm_pack(const dmatrix & _m);
00103 void pvm_pack(const d3_array & _m);
00104 void pvm_pack(const d4_array & _m);
00105 void pvm_pack(const d5_array & _m);
00106 
00107 void pvm_unpack(const double& _v);
00108 void pvm_unpack(const dvector& _v);
00109 void pvm_unpack(const dmatrix & _m);
00110 void pvm_unpack(const d3_array & _m);
00111 void pvm_unpack(const d4_array & _m);
00112 void pvm_unpack(const d5_array & _m);
00113 
00114 void pvm_pack(int v);
00115 void pvm_pack(const ivector& _v);
00116 void pvm_pack(const imatrix & _m);
00117 void pvm_pack(const i3_array & _m);
00118 //void pvm_pack(const i4_array & _m);
00119 //void pvm_pack(const i5_array & _m);
00120 
00121 void pvm_unpack(const int& _v);
00122 void pvm_unpack(const ivector& _v);
00123 void pvm_unpack(const imatrix & _m);
00124 void pvm_unpack(const i3_array & _m);
00125 //void pvm_unpack(const i4_array & _m);
00126 //void pvm_unpack(const i5_array & _m);
00127 
00128 void adpvm_pack(const prevariable& _v);
00129 void adpvm_pack(const dvar_vector& _v);
00130 void adpvm_pack(const dvar_matrix & _m);
00131 void adpvm_pack(const dvar3_array & _m);
00132 void adpvm_pack(const dvar4_array & _m);
00133 void adpvm_pack(const dvar5_array & _m);
00134 
00135 void adpvm_unpack(const int& _v);
00136 void adpvm_unpack(const prevariable& _v);
00137 void adpvm_unpack(const dvar_vector& _v);
00138 void adpvm_unpack(const dvar_matrix & _m);
00139 void adpvm_unpack(const dvar3_array & _m);
00140 void adpvm_unpack(const dvar4_array & _m);
00141 void adpvm_unpack(const dvar5_array & _m);
00142 
00143 void adpvm_pack(double v);
00144 void adpvm_pack(const dvector& _v);
00145 void adpvm_pack(const dmatrix & _m);
00146 void adpvm_pack(const d3_array & _m);
00147 void adpvm_pack(const d4_array & _m);
00148 void adpvm_pack(const d5_array & _m);
00149 
00150 void adpvm_unpack(const double& _v);
00151 void adpvm_unpack(const dvector& _v);
00152 void adpvm_unpack(const dmatrix & _m);
00153 void adpvm_unpack(const d3_array & _m);
00154 void adpvm_unpack(const d4_array & _m);
00155 void adpvm_unpack(const d5_array & _m);
00156 
00157 void adpvm_pack(int v);
00158 void adpvm_pack(const ivector& _v);
00159 void adpvm_pack(const imatrix & _m);
00160 void adpvm_pack(const i3_array & _m);
00161 //void adpvm_pack(const i4_array & _m);
00162 //void adpvm_pack(const i5_array & _m);
00163 
00164 void adpvm_unpack(const int& _v);
00165 void adpvm_unpack(const ivector& _v);
00166 void adpvm_unpack(const imatrix & _m);
00167 void adpvm_unpack(const i3_array & _m);
00168 #if defined(linux)
00169 #  define __declspec(dllexport)
00170 #endif
00171 
00172 int load_adpvm_library(void);
00173 
00174 int adpvm_slave_vinitsend(int mode);
00175 
00176 int adpvm_slave_cinitsend(int mode);
00177 
00178 void adpvm_slave_vsend(int ptid);
00179 
00180 void adpvm_slave_csend(int ptid);
00181 
00182 int adpvm_slave_vrecv(int ptid);
00183 
00184 int adpvm_slave_crecv(int ptid);
00185 
00186 int adpvm_master_vinitsend(int mode);
00187 
00188 int adpvm_master_cinitsend(int mode);
00189 
00190 void adpvm_master_csend(int id);
00191 
00192 void adpvm_master_vsend(int id);
00193 
00194 int adpvm_master_vrecv(int id);
00195 
00196 int adpvm_master_crecv(int id) ;
00197 
00198 void  adpvm_master_end_vreceive(void);
00199 
00200 void  adpvm_slave_end_vreceive(void);
00201 
00202 void  adpvm_master_end_creceive(void);
00203 
00204 void  adpvm_slave_end_creceive(void);
00205 
00206 void adpvm_unpack(char * v,int n);
00207 
00208 void adpvm_pack(char * v,int n);
00209 
00210 #endif
00211 #endif  // #if defined(USE_ADPVM)