File: Pvmfspawn.c

package info (click to toggle)
pvm 3.4.6-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,284 kB
  • sloc: ansic: 72,074; makefile: 1,198; fortran: 631; sh: 285; csh: 74; asm: 37
file content (57 lines) | stat: -rw-r--r-- 1,391 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

/* $Id: Pvmfspawn.c,v 1.2 1998/09/21 20:27:44 pvmsrc Exp $ */

#ifdef WIN32
#include "..\..\include\pvm3.h"
#include "..\..\src\pvmwin.h"
#else 
#include "pvm3.h"
#endif

#include "pvm_consts.h"

#ifdef IMA_WIN32_WATCOM
  #include "watforstr.h"
void pvmfspawn (WatcomFortranStr *aout_str, int *flag, WatcomFortranStr *where_str, int *count, int *tids, int *info)
{
   char* aout_ptr  = aout_str->strP;
   int   aout_len  = aout_str->len;
   char* where_ptr = where_str->strP;
   int   where_len = where_str->len;
#else
void __stdcall
PVMFSPAWN (char *aout_ptr,int aout_len, int *flag, char *where_ptr,int where_len, int *count, int *tids, int *info)
{
#endif

   char taout[MAX_PROC_NAME + 1];
   char twhere[MAX_HOST_NAME + 1];
   /*
    * Copy the program and where names to make sure there's
    * a NUL at the end.
    */
   
   if (ftocstr(taout, sizeof(taout), aout_ptr, aout_len)) {
      *info = PvmBadParam;
      return;
   }
   
   /*
    * if the where parameter is '*', pass a NULL pointer to
    * initiate which will allow execution on any machine.
    */

   if (*(where_ptr) == '*') {
      *info = pvm_spawn(taout, (char**)0, *flag, "", *count, tids);

   } else {
      if (ftocstr(twhere, sizeof(twhere), where_ptr, where_len)) {
         *info = PvmBadParam;
         return;
      }
   
      *info = pvm_spawn(taout, (char**)0, *flag, twhere, *count, tids);

   }
}