File: pvmfspawn.m4

package info (click to toggle)
pvm 3.4beta7-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,256 kB
  • ctags: 5,938
  • sloc: ansic: 66,147; makefile: 1,446; fortran: 631; sh: 424; csh: 70; asm: 37
file content (41 lines) | stat: -rw-r--r-- 978 bytes parent folder | download | duplicates (14)
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

/* $Id: pvmfspawn.m4,v 1.2 1996/10/04 15:27:40 pvmsrc Exp $ */

#include "pvm3.h"
#include "pvm_consts.h"

void
FUNCTION(pvmfspawn) ARGS(`STRING_ARG(aout), flag, STRING_ARG(where), count, tids, info')
STRING_ARG_DECL(aout);
STRING_ARG_DECL(where);
	int *flag, *count, *tids, *info;
{
	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), STRING_PTR(aout), STRING_LEN(aout))) {
		*info = PvmBadParam;
		return;
	}

	/*
	 * if the where parameter is '*', pass a NULL pointer to
	 * initiate which will allow execution on any machine.
	 */
	if (*(STRING_PTR(where)) == '*') {
		*info = pvm_spawn(taout, (char**)0, *flag, "", *count, tids);

	} else {
		if (ftocstr(twhere, sizeof(twhere), STRING_PTR(where), STRING_LEN(where))) {
			*info = PvmBadParam;
			return;
		}

		*info = pvm_spawn(taout, (char**)0, *flag, twhere, *count, tids);
	}
}