Ice Sheet System Model
4.18
Code documentation
src
c
shared
io
Disk
WriteLockFile.cpp
Go to the documentation of this file.
1
4
#include <cstdio>
5
#include "../../Exceptions/exceptions.h"
6
#include "../Comm/IssmComm.h"
7
#include "../Print/Print.h"
8
#include <cstdio>
9
10
void
WriteLockFile
(
char
* filename){
11
12
/*recover my_rank:*/
13
int
my_rank=
IssmComm::GetRank
();
14
15
/* output: */
16
FILE* fid=NULL;
17
18
/* Open lock file and write 1 into it: */
19
if
(my_rank==0){
20
fid=fopen(filename,
"w"
);
21
if
(fid==NULL)
_error_
(
"error message: could not open lock file "
<< filename);
22
23
/*Close file: */
24
if
(fclose(fid)!=0)
_error_
(
"could not close lock file "
<< filename);
25
}
26
27
}
IssmComm::GetRank
static int GetRank(void)
Definition:
IssmComm.cpp:34
_error_
#define _error_(StreamArgs)
Definition:
exceptions.h:49
WriteLockFile
void WriteLockFile(char *filename)
Definition:
WriteLockFile.cpp:10
Generated on Thu Jul 2 2020 08:09:22 for Ice Sheet System Model by
1.8.19