source: proiecte/hpl/openmpi_compiled/include/vampirtrace/OTF_FileManager.h @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

File size: 2.5 KB
Line 
1/*
2 This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
3 Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
4*/
5
6/**
7 *  @file OTF_FileManager.h
8 *
9 *  @brief Manages file handles.
10 *
11 *  i.e. Opens, closes and suspends files, if there are not enough
12 *  filehandles available.
13 *
14 *  \ingroup fm
15 */
16
17/**
18 * \defgroup fm File Manager Interface
19 *
20 * The file manager schedules an unlimited number OTF_Files to a limited
21 * number of actual open OS files. Therefore all open are registered with
22 * this manager. When a file is requested while no more OS files are
23 * available any of the other files are suspended, i.i. the OS file is
24 * closed.
25 */
26
27
28#ifndef OTF_FILEMANAGER_H
29#define OTF_FILEMANAGER_H
30
31
32#include "OTF_inttypes.h"
33
34
35#ifdef __cplusplus
36extern "C" {
37#endif /* __cplusplus */
38
39struct struct_OTF_File;
40typedef struct struct_OTF_File OTF_File;
41
42
43struct struct_OTF_FileManager;
44/** file manager object \ingroup fm */
45typedef struct struct_OTF_FileManager OTF_FileManager;
46
47
48/** Generates a new file manager with a maximum number of files that are allowed
49to be open simultaneously. \ingroup fm */
50OTF_FileManager* OTF_FileManager_open( uint32_t number );
51
52/** Closes the file manager \ingroup fm */
53void OTF_FileManager_close( OTF_FileManager* m );
54
55/** Returns the number of files currently open. */
56uint32_t OTF_FileManager_getCount( OTF_FileManager* m );
57
58/** Returns the numbner of files allowed to be open simultaneously. */
59uint32_t OTF_FileManager_getNumber( OTF_FileManager* m );
60
61/** Sets the number of files allowed to be open simultaneously. */
62uint32_t OTF_FileManager_setNumber( OTF_FileManager* m, uint32_t number );
63
64/** Ensure there is a free file handle available after this call.
65return 1 on success, 0 otherwise (which is not supposed to happen) */
66int OTF_FileManager_guaranteeFile( OTF_FileManager* m );
67
68/** Registers the 'file' as open. Return 1 on success, 0 otherwise. */
69int OTF_FileManager_registerFile( OTF_FileManager* m, OTF_File* file );
70
71/** Marks currently opened 'file' as used which is important for the
72scheduling strategy, i.e. the internal decision which file to suspend next.
73return 1 on success or 0 for an suspended file. */
74int OTF_FileManager_touchFile( OTF_FileManager* m, OTF_File* file );
75
76/** Suspend an open file explicitly. this may be called externaly or
77internally. Return 1 on success, 0 otherwise. */
78int OTF_FileManager_suspendFile( OTF_FileManager* m, OTF_File* file );
79
80#ifdef __cplusplus
81}
82#endif /* __cplusplus */
83
84#endif /* OTF_FILEMANAGER_H */
85
Note: See TracBrowser for help on using the repository browser.