Ice Sheet System Model  4.18
Code documentation
Functions
WriteLockFile.cpp File Reference
#include <cstdio>
#include "../../Exceptions/exceptions.h"
#include "../Comm/IssmComm.h"
#include "../Print/Print.h"

Go to the source code of this file.

Functions

void WriteLockFile (char *filename)
 

Function Documentation

◆ WriteLockFile()

void WriteLockFile ( char *  filename)

Definition at line 10 of file WriteLockFile.cpp.

10  {
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