File: sf.html

package info (click to toggle)
ga 5.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,472 kB
  • sloc: ansic: 192,963; fortran: 53,761; f90: 11,218; cpp: 5,784; makefile: 2,248; sh: 1,945; python: 1,734; perl: 534; csh: 134; asm: 106
file content (141 lines) | stat: -rw-r--r-- 7,092 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<HTML>
<HEAD>
  <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win">
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <META NAME="Author" CONTENT="Magdalena Nieplocha">
  <TITLE>sf gowno</TITLE>
</HEAD>
<BODY BGCOLOR="#f8f8eb" LINK="#0000ee" VLINK="#990099" TEXT="#000099"
ALINK="#00ffff" BACKGROUND="Image2.gif">

<H2><CENTER><A NAME="overview"></A></CENTER></H2>

<H2><CENTER>Shared Files Library</CENTER></H2>

<P>The Shared Files (SF) library implements logically-shared temporary
files for parallel SPMD (single-program-multiple-data) applications.
Any process can read and write at arbitrary location in a file
independently of other processes. Shared files must be created
and destroyed collectively. To optimize performance of the library,
user can provide hints on:</P>

<UL>
  <LI>soft limit, and
  <LI>hard limit for the file size.
</UL>

<P>The SF <I>read </I>and <I>write</I> operations are asynchronous/nonblocking
and require a <I>wait</I> operation to complete.</P>

<P>Due to the FORTRAN data type limitations, in order to facilitate
access to files &gt;2GB the file size, request size and offset
arguments use double precision data types.</P>

<P>All SF routines return an error code. The &quot;0&quot; value
means success, other values correspond to error codes.</P>

<P><HR ALIGN=LEFT></P>

<H2><A NAME="sf_create"></A></H2>

<H2>sf_create</H2>

<PRE>integer sf_create(fname, size_hard_limit, size_soft_limit, req_size, handle)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- meta-file name
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size_hard_limit&nbsp; -- max file size in bytes not to be exceeded (a hint)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size_soft_limit&nbsp; -- estimated file size (a hint)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; req_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- size of&nbsp; a typical request (a hint)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- returned handle to the created file</PRE>

<P>Creates shared file using name and path specified in <I>fname
</I>as a template. <BR>
<I>req_size</I> specifies size of a typical request (-1. means
&quot;don't know&quot;).</P>

<P>Creates shared file using name and path specified in fname
as a template. <BR>
req_size specifies size of a typical request (-1. means &quot;don't
know&quot;).</P>

<P>It is a collective operation.</P>

<P><HR ALIGN=LEFT></P>

<P><A NAME="sf_write"></A></P>

<H2>sf_write</H2>

<P>&nbsp;</P>

<PRE>integer sf_write(handle, offset, bytes, buffer, request_id)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- file handle returned from sf_create&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- location in file (from the beginning)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where data should be written to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buffer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- local array to put the data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bytes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- number of bytes to read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- id identifying asynchronous operation [out]</PRE>

<P>Asynchronous write operation. Writes number of <I>bytes</I>
to the file identified by <I>handle</I> at location <I>offset</I>.Operation
is guaranteed to be complete when <I>sf_wait</I> called with <I>request_id
</I>argument returns. <BR>
<HR ALIGN=LEFT></P>

<H2><A NAME="sf_read"></A></H2>

<H2>sf_read</H2>

<PRE>integer sf_read(handle, offset, bytes, buffer, request_id)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- file handle returned from sf_create&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- location in file (from the beginning)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where data should be read from&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buffer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- local array to put the data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bytes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- number of bytes to read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- id identifying asynchronous operation [out]</PRE>

<P>Asynchronous read operation. Reads number of <I>bytes</I> to
the file identified by <I>handle</I> at location <I>offset</I>.Operation
is guaranteed to be complete when <I>sf_wait</I> called with <I>request_id
</I>argument returns.</P>

<P><HR ALIGN=LEFT></P>

<H2><A NAME="sf_wait"></A></H2>

<H2>sf_wait</H2>

<PRE>integer sf_wait(request_id)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- id identifying asynchronous operation [in/out]</PRE>

<P>Blocks the calling process until I/O operation associated with
<I>request</I>_<I>id</I> completes. <BR>
Invalidates <I>request_id.</I> <BR>
&nbsp;<BR>
&nbsp;<HR ALIGN=LEFT><BR>
<A NAME="sf_waitall"></A></P>

<H2>sf_waitall</H2>

<PRE>integer sf_waitall(list, num)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; list(num)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- array of ids for asynchronous operations [in/out]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; num&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- number of entries in list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]</PRE>

<P>Blocks the calling process until all of the <I>num</I> I/O
operations associated with <I>ids</I><BR>
specified in <I>list</I> complete. Invalidates (modifies) <I>ids</I>
on the <I>list.</I><BR>
<HR ALIGN=LEFT></P>

<H2><A NAME="sf_destroy"></A></H2>

<H2>sf_destroy</H2>

<PRE>
integer sf_destroy(handle)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- file handle returned from sf_create&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]</PRE>

<P>Destroys the shared file associated with <I>handle</I>. It
is a collective operation.

</BODY>
</HTML>