/[escript]/trunk/escript/src/Utils.cpp
ViewVC logotype

Diff of /trunk/escript/src/Utils.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1757 by gross, Mon Sep 8 02:28:38 2008 UTC revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15    #include <unistd.h>
16    #include <string.h>
17    
18  #include "Utils.h"  #include "Utils.h"
19  #include "DataVector.h"  #include "DataVector.h"
# Line 71  void printParallelThreadCnt() Line 73  void printParallelThreadCnt()
73    
74  #ifdef HAVE_GETHOSTNAME  #ifdef HAVE_GETHOSTNAME
75    gethostname(hname, 64);    gethostname(hname, 64);
76      hname[63] = '\0';
77  #else  #else
78    strcpy(hname, "unknown host");    strcpy(hname, "unknown host");
79  #endif  #endif
# Line 111  int getNumberOfThreads() Line 114  int getNumberOfThreads()
114    
115  }  }
116    
117    int getMPISizeWorld() {
118      int mpi_num = 1;
119      #ifdef PASO_MPI
120      MPI_Comm_size(MPI_COMM_WORLD, &mpi_num);
121      #endif
122      return mpi_num;
123    }
124    
125    int getMPIRankWorld() {
126      int mpi_iam = 0;
127      #ifdef PASO_MPI
128      MPI_Comm_rank(MPI_COMM_WORLD, &mpi_iam);
129      #endif
130      return mpi_iam;
131    }
132    
133  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.1757  
changed lines
  Added in v.1811

  ViewVC Help
Powered by ViewVC 1.1.26