Ice Sheet System Model  4.18
Code documentation
Functions
PrintfFunction.cpp File Reference
#include <stdarg.h>
#include <cstdio>
#include <string>
#include <iostream>
#include <iomanip>
#include "./Print.h"
#include "../Comm/IssmComm.h"
#include "../../String/sharedstring.h"
#include "../../MemOps/MemOps.h"

Go to the source code of this file.

Functions

int PrintfFunctionOnCpu0 (const string &message)
 
int PrintfFunctionOnAllCpus (const string &message)
 

Function Documentation

◆ PrintfFunctionOnCpu0()

int PrintfFunctionOnCpu0 ( const string &  message)

Definition at line 26 of file PrintfFunction.cpp.

26  {
27 
28  /*recover my_rank:*/
29  int my_rank=IssmComm::GetRank();
30 
31  if(my_rank==0){
32  #ifdef _HAVE_ANDROID_JNI_
33  __android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
34  #else
35  ApiPrintf(message.c_str());
36  #endif
37  }
38  return 1;
39 }

◆ PrintfFunctionOnAllCpus()

int PrintfFunctionOnAllCpus ( const string &  message)

Definition at line 40 of file PrintfFunction.cpp.

40  {
41 
42  #ifdef _HAVE_ANDROID_JNI_
43  __android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
44  #else
45  ApiPrintf(message.c_str());
46  #endif
47 
48  return 1;
49 }
ApiPrintf
void ApiPrintf(const char *string)
Definition: ApiPrintf.cpp:13
IssmComm::GetRank
static int GetRank(void)
Definition: IssmComm.cpp:34