File: pvm-2.html

package info (click to toggle)
slpvm 0.1.5-17
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,184 kB
  • sloc: sh: 2,624; ansic: 1,012; makefile: 161
file content (64 lines) | stat: -rw-r--r-- 1,717 bytes parent folder | download | duplicates (6)
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
58
59
60
61
62
63
64
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
 <TITLE> S-Lang PVM Module Reference: Using the PVM Module</TITLE>
 <LINK HREF="pvm-3.html" REL=next>
 <LINK HREF="pvm-1.html" REL=previous>
 <LINK HREF="pvm.html#toc2" REL=contents>
</HEAD>
<BODY>
<A HREF="pvm-3.html">Next</A>
<A HREF="pvm-1.html">Previous</A>
<A HREF="pvm.html#toc2">Contents</A>
<HR>
<H2><A NAME="s2">2.</A> <A HREF="pvm.html#toc2">Using the PVM Module</A></H2>


<P>To use the <CODE>PVM</CODE> module in a <B>S-lang</B> script, it is first
necessary to make the functions in the package known to the
interpreter via
<BLOCKQUOTE><CODE>
<PRE>
    () = evalfile ("pvm");
</PRE>
</CODE></BLOCKQUOTE>

or, if the application embedding the interpreter supports the
<CODE>require</CODE> function,
<BLOCKQUOTE><CODE>
<PRE>
    require ("pvm");
</PRE>
</CODE></BLOCKQUOTE>

may be used.  If there is a namespace conflict between symbols in the
script and those defined in the module, it may be necessary to load
the PVM package into a namespace, e.g.,
<BLOCKQUOTE><CODE>
<PRE>
   () = evalfile ("pvm", "p");
</PRE>
</CODE></BLOCKQUOTE>

will place the PVM symbols into a namespace called <CODE>p</CODE>.</P>
<P>Once the PVM module has been loaded, the functions it defines
may be used in the usual way, e.g.,
<BLOCKQUOTE><CODE>
<PRE>
    require ("pvm");
        .
        .
    variable master_tid = pvm_mytid ();
</PRE>
</CODE></BLOCKQUOTE>

where <CODE>pvm_mytid</CODE> is the PVM function which returns the
task identifier of the calling process.</P>

<HR>
<A HREF="pvm-3.html">Next</A>
<A HREF="pvm-1.html">Previous</A>
<A HREF="pvm.html#toc2">Contents</A>
</BODY>
</HTML>