ADMB Documentation  11.1.1631
 All Classes Files Functions Variables Typedefs Friends Defines
pvm3.h
Go to the documentation of this file.
00001 /*
00002  * $Id: pvm3.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 /*
00046  *         PVM version 3.4:  Parallel Virtual Machine System
00047  *               University of Tennessee, Knoxville TN.
00048  *           Oak Ridge National Laboratory, Oak Ridge TN.
00049  *                   Emory University, Atlanta GA.
00050  *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer
00051  *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
00052  *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
00053  *                   (C) 1997 All Rights Reserved
00054  *
00055  *                              NOTICE
00056  *
00057  * Permission to use, copy, modify, and distribute this software and
00058  * its documentation for any purpose and without fee is hereby granted
00059  * provided that the above copyright notice appear in all copies and
00060  * that both the copyright notice and this permission notice appear in
00061  * supporting documentation.
00062  *
00063  * Neither the Institutions (Emory University, Oak Ridge National
00064  * Laboratory, and University of Tennessee) nor the Authors make any
00065  * representations about the suitability of this software for any
00066  * purpose.  This software is provided ``as is'' without express or
00067  * implied warranty.
00068  *
00069  * PVM version 3 was funded in part by the U.S. Department of Energy,
00070  * the National Science Foundation and the State of Tennessee.
00071  */
00072 
00073 /*
00074  *  pvm3.h
00075  *
00076  *  Libpvm3 includes.
00077  *
00078  * $Log: pvm3.h,v $
00079  * Revision 1.51  2001/09/27 21:24:18  pvmsrc
00080  * Increased default PVMTMPNAMLEN to 64...
00081  *  - suggested by BEOSCYLD / Joe Vitale <vitale@scyld.com>
00082  *  - seems like a good idea.  :-)
00083  * (Spanker=kohl)
00084  *
00085  * Revision 1.50  2001/09/27 18:24:39  pvmsrc
00086  * Upped version to 3.4.4.
00087  * (Spanker=kohl)
00088  *
00089  * Revision 1.49  2001/09/26 21:55:51  pvmsrc
00090  * Oops...  fixed function proto for pvmtmpnam()...
00091  *  - leftover bogus cruft...
00092  * (Spanker=kohl)
00093  *
00094  * Revision 1.48  2001/09/25 21:17:49  pvmsrc
00095  * Minor TMPNAMFUN()/tmpnam() cleanup.
00096  *  - moved macro def to pvm3.h, renamed PVMTNPMAN().
00097  *  - same for LEN_OF_TMP_NAM -> PVMTMPNAMLEN.
00098  *  - mostly a huge waste of time, since *both* tmpnam() & mktemp()
00099  *    produce the same "dangerous" warning message in Linux/gcc...
00100  *  - damn.
00101  * (Spanker=kohl)
00102  *
00103  * Revision 1.47  2001/06/18 18:38:23  pvmsrc
00104  * Added missing function prototype for pvm_freezegroup()...
00105  * (Spanker=kohl)
00106  *
00107  * Revision 1.46  2000/02/16 22:50:01  pvmsrc
00108  * Upped version to 3.4.3 so I don't forget later.
00109  * (Spanker=kohl)
00110  *
00111  * Revision 1.45  2000/02/10 23:53:09  pvmsrc
00112  * Added new PvmIPLoopback error code.
00113  *  - Master Host IP Address tied to Loopback.
00114  * (Spanker=kohl)
00115  *
00116  * Revision 1.44  1999/11/08 17:21:32  pvmsrc
00117  * Added PvmMboxDirectIndex stuff:
00118  *  - PvmMboxMaxFlag: capped regular flags to squeeze in direct index...
00119  *  - PvmMboxDirectIndexShift: # of bits to shift index in flags
00120  *  - PvmMboxMaxDirectIndex: max direct index value, for error checking
00121  *  - PvmMboxDirectIndex(): macro to convert direct index into flag bits
00122  *  - PvmMboxDirectIndexOf(): macro to decode direct index from flags
00123  * (Spanker=kohl)
00124  *
00125  * Revision 1.43  1999/10/27 18:48:40  pvmsrc
00126  * Fixed (yet again) the prototype for pvm_recvf().
00127  *  - hopefully got it right this time...  :-Q
00128  * (Spanker=kohl)
00129  *
00130  * Revision 1.42  1999/10/22 13:34:55  pvmsrc
00131  * Fixed prototype for pvm_recvf().
00132  *  - reported by "Ed D'Azevedo" <efdazedo@alcor.epm.ornl.gov>.
00133  * (Spanker=kohl)
00134  *
00135  * Revision 1.41  1999/10/18 21:22:00  pvmsrc
00136  * Added function prototypes for:
00137  *  - pvm_pkmesg(), pvm_pkmesgbody(), pvm_upkmesg().
00138  * (Spanker=kohl)
00139  *
00140  * Revision 1.40  1999/08/19 16:07:14  pvmsrc
00141  * Upped version to 3.4.2.
00142  * (Spanker=kohl)
00143  *
00144  * Revision 1.39  1999/07/08 18:59:47  kohl
00145  * Fixed "Log" keyword placement.
00146  *  - indent with " * " for new CVS.
00147  *
00148  * Revision 1.38  1999/06/07 20:06:53  pvmsrc
00149  * Upped version to 3.4.1.
00150  * (Spanker=kohl)
00151  *
00152  * Revision 1.37  1999/03/03  19:00:36  pvmsrc
00153  * Added new define PVM_PATCH_VERSION.
00154  *  - the "0" in "3.4.0".
00155  *  - to go along with PVM_MAJOR_VERSION & PVM_MINOR_VERSION.
00156  * (Spanker=kohl)
00157  *
00158  * Revision 1.36  1999/01/19  18:02:17  pvmsrc
00159  * Bumped PVM_VER to 3.4.0.
00160  * (Spanker=kohl)
00161  *
00162  * Revision 1.35  1999/01/13  00:03:19  pvmsrc
00163  * Fixed backwards compat.
00164  *  - redefine old pvm_insert/lookup/delete() consts:
00165  *    * PvmNoEntry -> PvmNotFound
00166  *    * PvmDupEntry -> PvmDenied
00167  *  - remove #ifdef PVM33COMPAT...  O.K. in general.
00168  * (Spanker=kohl)
00169  *
00170  * Revision 1.34  1998/08/27  15:17:14  pvmsrc
00171  * Time to bump up to beta 7...
00172  * (Spanker=kohl)
00173  *
00174  * Revision 1.33  1997/12/30  18:15:32  pvmsrc
00175  * Oops...  better skip directly to beta 6 instead of beta 5...
00176  *  - separate WIN32 release is beta 5...
00177  * (Spanker=kohl)
00178  *
00179  * Revision 1.32  1997/12/29  19:53:51  pvmsrc
00180  * Upgraded from beta4 to beta5.
00181  * (Spanker=kohl)
00182  *
00183  * Revision 1.31  1997/09/15  20:54:29  pvmsrc
00184  * Fixed PVM_MAJOR_VERSION and PVM_MINOR_VERSION defines.
00185  *  - VER -> VERSION.
00186  *  - MAJOR = 3, MINOR = 4 (3.4.*).
00187  * (Spanker=kohl)
00188  *
00189  * Revision 1.30  1997/09/02  13:05:37  pvmsrc
00190  * Upgraded PVM_VER to 3.4 beta 4.
00191  * (Spanker=kohl)
00192  *
00193  * Revision 1.29  1997/07/09  13:29:36  pvmsrc
00194  * Fixed Author Header.
00195  *
00196  * Revision 1.28  1997/07/01  17:19:03  pvmsrc
00197  *  The real real beta version number according to Garp.
00198  *
00199  * Revision 1.27  1997/07/01  15:54:35  pvmsrc
00200  * Trying again on the version.
00201  *  - just straight 3.4.0.
00202  *
00203  * Revision 1.26  1997/07/01  14:17:26  pvmsrc
00204  * Set version for beta release to 3.4.1.0.
00205  *
00206  * Revision 1.25  1997/06/26  19:36:22  pvmsrc
00207  *    Added error constant "PvmParentNotSet" so that
00208  *    tc_siblings can get sibling tids even if the spawn flags
00209  *    had parent as PvmNoParent.
00210  *
00211  * Revision 1.24  1997/06/25  19:41:02  pvmsrc
00212  * WIN32 fixes from Markus.
00213  *
00214  * Revision 1.23  1997/06/23  21:08:42  pvmsrc
00215  * Added new error code "PvmHostrNMstr" / -34.
00216  *  - Hoster run on non-master host.
00217  *
00218  * Revision 1.22  1997/06/10  16:38:53  pvmsrc
00219  * Minor text cleanup.
00220  *
00221  * Revision 1.21  1997/05/06  18:58:56  pvmsrc
00222  * Upped version to 3.4.0.16.
00223  *
00224  * Revision 1.20  1997/04/17  12:52:28  pvmsrc
00225  * rename of pvm_mboxinfo() to include word "get"
00226  *
00227  * Revision 1.19  1997/04/10  20:09:57  pvmsrc
00228  * Fixed prototype for pvm_mboxinfo().
00229  *  - pvm_getnames() is history.
00230  *
00231  * Revision 1.18  1997/04/10  19:34:57  pvmsrc
00232  * Added new pvmmboxinfo structure.
00233  *  - for pvm_mboxinfo().
00234  *
00235  * Revision 1.17  1997/04/09  20:21:51  pvmsrc
00236  * Added PvmMboxWaitForInfo/PVMMBOXWAITFORINFO constants.
00237  *
00238  * Revision 1.16  1997/04/07  20:50:48  pvmsrc
00239  * pvm_addmhf() protoglarp set to new parameter interface
00240  *
00241  * Revision 1.15  1997/04/03  18:19:02  pvmsrc
00242  * Added a define for PvmBaseContext - this is 3.3 compatible context.
00243  * codes that don't ever set their context should operate in this context.
00244  *
00245  * Revision 1.14  1997/04/01  16:46:09  pvmsrc
00246  * Fixed protos for pvm_putinfo(), pvm_recvinfo() (formerly pvm_getinfo()).
00247  *
00248  * Revision 1.13  1997/03/31  21:38:05  pvmsrc
00249  * Replaced original mbox constants with new syntax:
00250  *  - gone:  PvmExclusive, PvmFirstAvail, PvmLock, PvmSticky.
00251  *  - new:  PvmMboxDefault, PvmMboxPersistent, PvmMboxMultiInstance,
00252  *    PvmMboxOverWritable, PvmMboxFirstAvail, PvmMboxReadAndDelete.
00253  *  - fortran equivalents.
00254  *  - checked in for sscott.
00255  *
00256  * Revision 1.12  1997/03/26  21:51:55  pvmsrc
00257  * Added "PvmNoSpawnParent" spawn option constant.
00258  *  - PVMNOSPAWNPARENT for Fortran.
00259  *
00260  * Revision 1.11  1997/03/07  14:41:10  pvmsrc
00261  * PVM patches from the base 3.3.10 to 3.3.11 versions where applicable.
00262  * Originals by Bob Manchek. Altered by Graham Fagg where required.
00263  *
00264  * added pvm_export / pvm_unexport to user API.
00265  *
00266  * Revision 1.10  1997/03/04  19:44:11  pvmsrc
00267  * Added system message mailbox class name #defines:
00268  *  - PVMHOSTERCLASS, PVMTASKERCLASS, PVMTRACERCLASS, PVMRMCLASS.
00269  *
00270  * Revision 1.9  1997/02/17  18:47:51  pvmsrc
00271  * Oops...  must pass ptr to tids array for pvm_getnoresets().
00272  *
00273  * Revision 1.8  1997/02/17  16:30:11  pvmsrc
00274  * Added proto for new pvm_getnoresets() routine.
00275  *  - note:  not an official interface routine...
00276  *
00277  * Revision 1.7  1997/02/13  23:12:41  pvmsrc
00278  * Added PVMNORESETCLASS class name for PvmNoReset.
00279  *
00280  * Revision 1.6  1997/02/13  23:05:22  pvmsrc
00281  * Added new PvmNoReset setopt/getopt constant.
00282  *
00283  * Revision 1.5  1997/01/28  19:14:20  pvmsrc
00284  * New Copyright Notice & Authors.
00285  *
00286  * Revision 1.4  1996/10/24  19:33:48  pvmsrc
00287  * Modified for New Tracing Facility:
00288  *  - added user-defined message encoding, PvmDataTrace.
00289  *  - added new option constants:
00290  *    PvmTraceBuffer, PvmTraceOptions,
00291  *    PvmSelfTraceBuffer & PvmSelfTraceOptions,
00292  *  - added PvmTraceFull, PvmTraceTime & PvmTraceCount for trace opts.
00293  *  - added function prototype for new pvm_reg_tracer() routine.
00294  *
00295  * Revision 1.3  1996/10/11  17:01:52  pvmsrc
00296  * Replaced references to pvm_remove() with pvm_delinfo():  renamed.
00297  *
00298  * Revision 1.2  1996/10/08  18:30:30  pvmsrc
00299  * Renamed routines:
00300  *  - pvm_put() -> pvm_putinfo().
00301  *  - pvm_get() -> pvm_getinfo().
00302  *
00303  * Revision 1.1  1996/09/23  21:06:31  pvmsrc
00304  * Initial revision
00305  *
00306  */
00307 
00308 #ifndef _PVM3_H_
00309 
00310 #define _PVM3_H_
00311 
00312 /*
00313 * Release version
00314 */
00315 
00316 #define PVM_VER       "3.4.4"
00317 #define PVM_MAJOR_VERSION 3
00318 #define PVM_MINOR_VERSION 4
00319 #define PVM_PATCH_VERSION 4
00320 
00321 #ifndef WIN32
00322 #  if !defined(__BORLANDC__)
00323 #    include  <sys/time.h>
00324 #  endif
00325 #else
00326 #include "pvmwin.h"
00327 #include <sys/timeb.h>
00328 #include <time.h>
00329 #endif
00330 
00331 /*
00332 * Data packing styles for pvm_initsend()
00333 */
00334 
00335 #define PvmDataDefault  0 /* XDR encoding */
00336 #define PvmDataRaw    1 /* Raw data copy */
00337 #define PvmDataInPlace  2 /* Raw data, left in place */
00338 #define PvmDataFoo    PvmDataDefault  /* Internal use */
00339 #define PvmDataTrace  4 /* User-Defined Trace Encoding */
00340 
00341 /*
00342 * pvm_spawn options
00343 */
00344 
00345 #define PvmTaskDefault  0
00346 #define PvmTaskHost   1 /* specify host */
00347 #define PvmTaskArch   2 /* specify architecture */
00348 #define PvmTaskDebug  4 /* start task in debugger */
00349 #define PvmTaskTrace  8 /* process generates trace data */
00350 /* for MPP ports */
00351 #define PvmMppFront   16  /* spawn task on service node */
00352 #define PvmHostCompl  32  /* complement host set */
00353 /* for parent-less spawning */
00354 #define PvmNoSpawnParent  64
00355 
00356 /*
00357 * pvm_notify kinds
00358 */
00359 
00360 #define PvmTaskExit   1 /* on task exit */
00361 #define PvmHostDelete 2 /* on host fail/delete */
00362 #define PvmHostAdd    3 /* on host startup */
00363 #define PvmRouteAdd   4 /* new task-task route opened */
00364 #define PvmRouteDelete  5 /* task-task route closed */
00365 
00366 /* flags combined with notify kind */
00367 
00368 #define PvmNotifyCancel 256 /* cancel (complete immediately) notifies */
00369 
00370 /*
00371 * for pvm_setopt and pvm_getopt
00372 */
00373 
00374 #define PvmRoute      1 /* routing policy */
00375 #define   PvmDontRoute    1 /* don't allow direct task-task links */
00376 #define   PvmAllowDirect    2 /* allow direct links, but don't request */
00377 #define   PvmRouteDirect    3 /* request direct links */
00378 #define PvmDebugMask    2 /* debugmask */
00379 #define PvmAutoErr      3 /* auto error reporting */
00380 #define PvmOutputTid    4 /* stdout destination for children */
00381 #define PvmOutputCode   5 /* stdout message tag */
00382 #define PvmTraceTid     6 /* trace destination for children */
00383 #define PvmTraceCode    7 /* trace message tag */
00384 #define PvmTraceBuffer    8 /* trace buffering for children */
00385 #define PvmTraceOptions   9 /* trace options for children */
00386 #define   PvmTraceFull    1 /* do full trace events */
00387 #define   PvmTraceTime    2 /* only do PVM routine timings */
00388 #define   PvmTraceCount   3 /* only do PVM routine profiling */
00389 #define PvmFragSize     10  /* message fragment size */
00390 #define PvmResvTids     11  /* allow reserved message tids and codes */
00391 #define PvmSelfOutputTid  12  /* stdout destination for task */
00392 #define PvmSelfOutputCode 13  /* stdout message tag */
00393 #define PvmSelfTraceTid   14  /* trace destination for task */
00394 #define PvmSelfTraceCode  15  /* trace message tag */
00395 #define PvmSelfTraceBuffer  16  /* trace buffering for task */
00396 #define PvmSelfTraceOptions 17  /* trace options for task */
00397 #define PvmShowTids     18  /* pvm_catchout prints task ids with output */
00398 #define PvmPollType     19  /* shared memory wait method */
00399 #define   PvmPollConstant   1
00400 #define   PvmPollSleep    2
00401 #define PvmPollTime     20  /* time before sleep if PvmPollSleep */
00402 #define PvmOutputContext  21  /* stdout message context */
00403 #define PvmTraceContext   22  /* trace message context */
00404 #define PvmSelfOutputContext  23  /* stdout message context */
00405 #define PvmSelfTraceContext 24  /* trace message context */
00406 #define PvmNoReset      25  /* do not kill task on reset */
00407 
00408 /*
00409 * for pvm_[sg]ettmask
00410 */
00411 
00412 #define PvmTaskSelf   0 /* this task */
00413 #define PvmTaskChild  1 /* (future) child tasks */
00414 
00415 /*
00416 * Need to have PvmBaseContext defined
00417 */
00418 
00419 #define PvmBaseContext  0
00420 
00421 /*
00422 * for message mailbox operations: pvm_putinfo and pvm_recvinfo
00423 */
00424 
00425 #define PvmMboxDefault      0 /* put: single locked instance */
00426                   /* recv: 1st entry */
00427                   /* start w/index=0 */
00428 #define PvmMboxPersistent   1 /* entry remains after owner exit */
00429 #define PvmMboxMultiInstance  2 /* multiple entries in class */
00430 #define PvmMboxOverWritable   4 /* can write over this entry */
00431 #define PvmMboxFirstAvail   8 /* select 1st index >= specified */
00432 #define PvmMboxReadAndDelete  16  /* atomic read / delete */
00433                   /* requires read & delete rights */
00434 #define PvmMboxWaitForInfo    32  /* for blocking recvinfo */
00435 #define PvmMboxMaxFlag      512 /* maximum mbox flag bit value */
00436 
00437 #define PvmMboxDirectIndexShift 10  /* log2(PvmMboxMaxFlag) + 1 */
00438 
00439 #define PvmMboxMaxDirectIndex \
00440   ( (unsigned) 1 << ( 31 - PvmMboxDirectIndexShift ) )
00441 
00442 #define PvmMboxDirectIndexOf( _flags ) \
00443   ( ( (_flags) & \
00444     ( ( PvmMboxMaxDirectIndex - 1 ) << PvmMboxDirectIndexShift ) ) \
00445     >> PvmMboxDirectIndexShift )
00446 
00447 #define PvmMboxDirectIndex( _index ) \
00448   ( ( (_index) >= PvmMboxMaxDirectIndex ) ? \
00449     ( fprintf( stderr, "Mbox Direct Index Too Large: %d >= %d\n", \
00450       (_index), PvmMboxMaxDirectIndex ), 0 ) \
00451     : ( (_index) << PvmMboxDirectIndexShift ) )
00452 
00453 /*
00454 * pre-defined system message mailbox classes
00455 */
00456 
00457 #define PVMNORESETCLASS   "###_PVM_NO_RESET_###"
00458 
00459 #define PVMHOSTERCLASS    "###_PVM_HOSTER_###"
00460 
00461 #define PVMTASKERCLASS    "###_PVM_TASKER_###"
00462 
00463 #define PVMTRACERCLASS    "###_PVM_TRACER_###"
00464 
00465 #define PVMRMCLASS      "###_PVM_RM_###"
00466 
00467 /*
00468 * Libpvm error codes
00469 */
00470 
00471 #define PvmOk     0 /* Success */
00472 #define PvmBadParam   -2  /* Bad parameter */
00473 #define PvmMismatch   -3  /* Parameter mismatch */
00474 #define PvmOverflow   -4  /* Value too large */
00475 #define PvmNoData   -5  /* End of buffer */
00476 #define PvmNoHost   -6  /* No such host */
00477 #define PvmNoFile   -7  /* No such file */
00478 #define PvmDenied   -8  /* Permission denied */
00479 #define PvmNoMem    -10 /* Malloc failed */
00480 #define PvmBadMsg   -12 /* Can't decode message */
00481 #define PvmSysErr   -14 /* Can't contact local daemon */
00482 #define PvmNoBuf    -15 /* No current buffer */
00483 #define PvmNoSuchBuf  -16 /* No such buffer */
00484 #define PvmNullGroup  -17 /* Null group name */
00485 #define PvmDupGroup   -18 /* Already in group */
00486 #define PvmNoGroup    -19 /* No such group */
00487 #define PvmNotInGroup -20 /* Not in group */
00488 #define PvmNoInst   -21 /* No such instance */
00489 #define PvmHostFail   -22 /* Host failed */
00490 #define PvmNoParent   -23 /* No parent task */
00491 #define PvmNotImpl    -24 /* Not implemented */
00492 #define PvmDSysErr    -25 /* Pvmd system error */
00493 #define PvmBadVersion -26 /* Version mismatch */
00494 #define PvmOutOfRes   -27 /* Out of resources */
00495 #define PvmDupHost    -28 /* Duplicate host */
00496 #define PvmCantStart  -29 /* Can't start pvmd */
00497 #define PvmAlready    -30 /* Already in progress */
00498 #define PvmNoTask   -31 /* No such task */
00499 #define PvmNotFound   -32 /* Not Found */
00500 #define PvmExists   -33 /* Already exists */
00501 #define PvmHostrNMstr -34 /* Hoster run on non-master host */
00502 #define PvmParentNotSet -35 /* Spawning parent set PvmNoSpawnParent */
00503 #define PvmIPLoopback -36 /* Master Host's IP is Loopback */
00504 
00505 /*
00506 * crusty error constants from 3.3, now redefined...
00507 */
00508 #define PvmNoEntry    PvmNotFound /* No such entry */
00509 #define PvmDupEntry   PvmDenied /* Duplicate entry */
00510 
00511 /*
00512 * Data types for pvm_reduce(), pvm_psend(), pvm_precv()
00513 */
00514 
00515 #define PVM_STR     0 /* string */
00516 #define PVM_BYTE    1 /* byte */
00517 #define PVM_SHORT   2 /* short */
00518 #define PVM_INT     3 /* int */
00519 #define PVM_FLOAT   4 /* real */
00520 #define PVM_CPLX    5 /* complex */
00521 #define PVM_DOUBLE    6 /* double */
00522 #define PVM_DCPLX   7 /* double complex */
00523 #define PVM_LONG    8 /* long integer */
00524 #define PVM_USHORT    9 /* unsigned short int */
00525 #define PVM_UINT    10  /* unsigned int */
00526 #define PVM_ULONG   11  /* unsigned long int */
00527 
00528 /*
00529 * returned by pvm_config()
00530 */
00531 
00532 struct pvmhostinfo {
00533   int hi_tid;     /* pvmd tid */
00534   char *hi_name;    /* host name */
00535   char *hi_arch;    /* host arch */
00536   int hi_speed;   /* cpu relative speed */
00537   int hi_dsig;    /* data signature */
00538 };
00539 
00540 /*
00541 * returned by pvm_tasks()
00542 */
00543 
00544 struct pvmtaskinfo {
00545   int ti_tid;       /* task id */
00546   int ti_ptid;      /* parent tid */
00547   int ti_host;      /* pvmd tid */
00548   int ti_flag;      /* status flags */
00549   char *ti_a_out;     /* a.out name */
00550   int ti_pid;       /* task (O/S dependent) process id */
00551 };
00552 
00553 /*
00554 * for pvm_getminfo(), pvm_setminfo()
00555 */
00556 
00557 struct pvmminfo {
00558   int len;        /* message length */
00559   int ctx;        /* context */
00560   int tag;        /* tag */
00561   int wid;        /* wait id */
00562   int enc;        /* encoding */
00563   int crc;        /* crc checksum */
00564   int src;        /* source tid */
00565   int dst;        /* destination tid */
00566 };
00567 
00568 /*
00569 * returned by pvm_getmboxinfo()
00570 */
00571 
00572 struct pvmmboxinfo {
00573   char *mi_name;      /* class name */
00574   int mi_nentries;    /* # of entries for this class */
00575   int *mi_indices;    /* mbox entry indices */
00576   int *mi_owners;     /* mbox entry owner tids */
00577   int *mi_flags;      /* mbox entry flags */
00578 };
00579 
00580 /*
00581 * temporary file name function / macro
00582 * (since there are so many choices, but so little time,
00583 * and since gcc now complains about tmpnam()... :-Q)
00584 */
00585 
00586 #ifdef  NOTMPNAM
00587 #define PVMTMPNAMFUN(x)   pvmtmpnam(x)
00588 #define PVMTMPNAMLEN    64
00589 #else
00590 #define PVMTMPNAMFUN(x)   tmpnam(x)
00591 #ifdef L_tmpnam
00592 #define PVMTMPNAMLEN    L_tmpnam
00593 #else
00594 #define PVMTMPNAMLEN    64
00595 #endif
00596 #endif
00597 
00598 
00599 /*
00600 * function prototypes
00601 */
00602 
00603 #ifdef __ProtoGlarp__
00604 #undef __ProtoGlarp__
00605 #endif
00606 #if defined(__STDC__) || defined(__cplusplus)
00607 #define __ProtoGlarp__(x) x
00608 #else
00609 #define __ProtoGlarp__(x) ()
00610 #endif
00611 
00612 #ifdef __cplusplus
00613 extern "C" {
00614 #endif
00615 
00616 #ifdef  NOTMPNAM
00617 char *pvmtmpnam   __ProtoGlarp__(( char * ));
00618 #endif
00619 char *pvmgetrsh   __ProtoGlarp__(( void ));
00620 char *pvmgettmp   __ProtoGlarp__(( void ));
00621 
00622 int pvm_addhosts  __ProtoGlarp__(( char **, int, int * ));
00623 int pvm_addmhf    __ProtoGlarp__(( int, int, int, int (*) (int) ));
00624 int pvm_archcode  __ProtoGlarp__(( char * ));
00625 int pvm_barrier   __ProtoGlarp__(( char *, int ));
00626 int pvm_bcast   __ProtoGlarp__(( char *, int ));
00627 int pvm_bufinfo   __ProtoGlarp__(( int, int *, int *, int * ));
00628 #if defined(EOF)
00629 int pvm_catchout  __ProtoGlarp__(( FILE * ));
00630 #endif
00631 int pvm_config    __ProtoGlarp__(( int *, int *,
00632                     struct pvmhostinfo ** ));
00633 int pvm_delhosts  __ProtoGlarp__(( char **, int, int * ));
00634 int pvm_delinfo   __ProtoGlarp__(( char *, int, int ));
00635 int pvm_delmhf    __ProtoGlarp__(( int ));
00636 int pvm_exit    __ProtoGlarp__(( void ));
00637 int pvm_export    __ProtoGlarp__(( char * ));
00638 int pvm_freebuf   __ProtoGlarp__(( int ));
00639 int pvm_freecontext __ProtoGlarp__(( int ));
00640 int pvm_freezegroup __ProtoGlarp__(( char *, int ));
00641 int pvm_gather    __ProtoGlarp__(( void*, void*,
00642                     int, int, int, char*, int));
00643 int pvm_getcontext  __ProtoGlarp__(( void ));
00644 int pvm_getfds    __ProtoGlarp__(( int ** ));
00645 int pvm_getinst   __ProtoGlarp__(( char *, int ));
00646 int pvm_getminfo  __ProtoGlarp__(( int, struct pvmminfo * ));
00647 int pvm_getnoresets __ProtoGlarp__(( int **, int * ));
00648 int pvm_getopt    __ProtoGlarp__(( int ));
00649 int pvm_getrbuf   __ProtoGlarp__(( void ));
00650 int pvm_getsbuf   __ProtoGlarp__(( void ));
00651 int pvm_gettid    __ProtoGlarp__(( char *, int ));
00652 int pvm_gsize   __ProtoGlarp__(( char * ));
00653 int pvm_halt    __ProtoGlarp__(( void ));
00654 int pvm_hostsync  __ProtoGlarp__(( int, struct timeval *,
00655                     struct timeval * ));
00656 int pvm_initsend  __ProtoGlarp__(( int ));
00657 int pvm_joingroup __ProtoGlarp__(( char * ));
00658 int pvm_kill    __ProtoGlarp__(( int ));
00659 int pvm_lvgroup   __ProtoGlarp__(( char * ));
00660 int pvm_getmboxinfo __ProtoGlarp__(( char *, int *,
00661                     struct pvmmboxinfo ** ));
00662 int pvm_mcast   __ProtoGlarp__(( int *, int, int ));
00663 int pvm_mkbuf   __ProtoGlarp__(( int ));
00664 int pvm_mstat   __ProtoGlarp__(( char * ));
00665 int pvm_mytid   __ProtoGlarp__(( void ));
00666 int pvm_newcontext  __ProtoGlarp__(( void ));
00667 int pvm_notify    __ProtoGlarp__(( int, int,
00668                     int, int * ));
00669 int pvm_nrecv   __ProtoGlarp__(( int, int ));
00670 int pvm_packf   __ProtoGlarp__(( const char *, ... ));
00671 int pvm_parent    __ProtoGlarp__(( void ));
00672 int pvm_perror    __ProtoGlarp__(( char * ));
00673 int pvm_pkbyte    __ProtoGlarp__(( char *, int, int ));
00674 int pvm_pkcplx    __ProtoGlarp__(( float *, int, int ));
00675 int pvm_pkdcplx   __ProtoGlarp__(( double *, int, int ));
00676 int pvm_pkdouble  __ProtoGlarp__(( double *, int, int ));
00677 int pvm_pkfloat   __ProtoGlarp__(( float *, int, int ));
00678 int pvm_pkint   __ProtoGlarp__(( int *, int, int ));
00679 int pvm_pklong    __ProtoGlarp__(( long *, int, int ));
00680 int pvm_pkshort   __ProtoGlarp__(( short *, int, int ));
00681 int pvm_pkstr   __ProtoGlarp__(( char * ));
00682 int pvm_pkuint    __ProtoGlarp__(( unsigned int *, int, int ));
00683 int pvm_pkulong   __ProtoGlarp__(( unsigned long *, int, int ));
00684 int pvm_pkushort  __ProtoGlarp__(( unsigned short *, int, int ));
00685 int pvm_pkmesg    __ProtoGlarp__(( int ));
00686 int pvm_pkmesgbody  __ProtoGlarp__(( int ));
00687 int pvm_precv   __ProtoGlarp__(( int, int,
00688                   void *, int, int,
00689                   int *, int *, int * ));
00690 int pvm_probe   __ProtoGlarp__(( int, int ));
00691 int pvm_psend   __ProtoGlarp__(( int, int,
00692                   void *, int, int ));
00693 int pvm_pstat   __ProtoGlarp__(( int ));
00694 int pvm_putinfo   __ProtoGlarp__(( char *, int, int ));
00695 int pvm_recv    __ProtoGlarp__(( int, int ));
00696 int (*pvm_recvf   __ProtoGlarp__(( int (*)(int, int, int) )) )
00697   __ProtoGlarp__(( int (*)(int, int, int) ));
00698 int pvm_recvinfo  __ProtoGlarp__(( char *, int, int ));
00699 int pvm_reduce    __ProtoGlarp__(( void (*)(int*, void*, void*, int*, int*),
00700                   void *, int,
00701                   int, int, char *,
00702                   int ));
00703 
00704 /*
00705 * Predefined pvm_reduce functions
00706 */
00707 void PvmMax     __ProtoGlarp__(( int *, void *, void *,
00708                   int *, int * ));
00709 void PvmMin     __ProtoGlarp__(( int *, void *, void *,
00710                   int *, int * ));
00711 void PvmSum     __ProtoGlarp__(( int *, void *, void *,
00712                   int *, int * ));
00713 void PvmProduct   __ProtoGlarp__(( int *, void *, void *,
00714                   int *, int * ));
00715 
00716 int pvm_reg_hoster  __ProtoGlarp__(( void ));
00717 int pvm_reg_rm    __ProtoGlarp__(( struct pvmhostinfo ** ));
00718 int pvm_reg_tasker  __ProtoGlarp__(( void ));
00719 int pvm_reg_tracer  __ProtoGlarp__(( int, int, int, int, char*,
00720                     int, int ));
00721 int pvm_scatter   __ProtoGlarp__(( void*, void*,
00722                     int, int, int, char*, int));
00723 int pvm_send    __ProtoGlarp__(( int, int ));
00724 int pvm_sendsig   __ProtoGlarp__(( int, int ));
00725 int pvm_setcontext  __ProtoGlarp__(( int ));
00726 int pvm_setminfo  __ProtoGlarp__(( int, struct pvmminfo * ));
00727 int pvm_setopt    __ProtoGlarp__(( int, int ));
00728 int pvm_setrbuf   __ProtoGlarp__(( int ));
00729 int pvm_setsbuf   __ProtoGlarp__(( int ));
00730 int pvm_siblings  __ProtoGlarp__(( int ** ));
00731 int pvm_spawn   __ProtoGlarp__(( char *, char **, int,
00732                     char *, int, int * ));
00733 int pvm_start_pvmd  __ProtoGlarp__(( int, char **, int ));
00734 int pvm_tasks   __ProtoGlarp__(( int, int *,
00735                     struct pvmtaskinfo ** ));
00736 int pvm_tickle    __ProtoGlarp__(( int, int *,
00737                     int *, int * ));
00738 int pvm_tidtohost __ProtoGlarp__(( int ));
00739 int pvm_trecv   __ProtoGlarp__(( int, int, struct timeval * ));
00740 int pvm_unexport  __ProtoGlarp__(( char * ));
00741 int pvm_unpackf   __ProtoGlarp__(( const char *, ... ));
00742 int pvm_upkbyte   __ProtoGlarp__(( char *, int, int ));
00743 int pvm_upkcplx   __ProtoGlarp__(( float *, int, int ));
00744 int pvm_upkdcplx  __ProtoGlarp__(( double *, int, int ));
00745 int pvm_upkdouble __ProtoGlarp__(( double *, int, int ));
00746 int pvm_upkfloat  __ProtoGlarp__(( float *, int, int ));
00747 int pvm_upkint    __ProtoGlarp__(( int *, int, int ));
00748 int pvm_upklong   __ProtoGlarp__(( long *, int, int ));
00749 int pvm_upkshort  __ProtoGlarp__(( short *, int, int ));
00750 int pvm_upkstr    __ProtoGlarp__(( char * ));
00751 int pvm_upkuint   __ProtoGlarp__(( unsigned int *, int, int ));
00752 int pvm_upkulong  __ProtoGlarp__(( unsigned long *, int, int ));
00753 int pvm_upkushort __ProtoGlarp__(( unsigned short *, int, int ));
00754 int pvm_upkmesg   __ProtoGlarp__(( void ));
00755 char *pvm_version __ProtoGlarp__(( void ));
00756 
00757 /*
00758 * these are going away in the next version.
00759 * use the replacements
00760 */
00761 
00762 #ifdef  PVM33COMPAT
00763 int pvm_getmwid   __ProtoGlarp__(( int ));
00764 int pvm_setmwid   __ProtoGlarp__(( int, int ));
00765 #endif
00766 
00767 /* these are now backwards compatible -> they use mbox interface... */
00768 int pvm_delete    __ProtoGlarp__(( char *, int ));
00769 int pvm_insert    __ProtoGlarp__(( char *, int, int ));
00770 int pvm_lookup    __ProtoGlarp__(( char *, int, int * ));
00771 
00772 #ifdef __cplusplus
00773 }
00774 #endif
00775 
00776 #endif  /*_PVM3_H_*/
00777