/[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

temp_trunk_copy/escript/src/Utils.cpp revision 1384 by phornby, Fri Jan 11 02:29:38 2008 UTC trunk/escript/src/Utils.cpp revision 1567 by ksteube, Thu May 22 22:52:41 2008 UTC
# Line 20  Line 20 
20  #include <omp.h>  #include <omp.h>
21  #endif  #endif
22    
23    #ifdef PASO_MPI
24    #include <mpi.h>
25    #endif
26    
27  namespace escript {  namespace escript {
28    
29  int getSvnVersion()  int getSvnVersion()
# Line 31  int getSvnVersion() Line 35  int getSvnVersion()
35  #endif  #endif
36  }  }
37    
38    void printParallelThreadCnt()
39    {
40      int mpi_iam=0, mpi_num=1;
41      char hname[HOST_NAME_MAX];
42    
43      gethostname(hname, HOST_NAME_MAX);
44    
45      #ifdef PASO_MPI
46      MPI_Comm_rank(MPI_COMM_WORLD, &mpi_iam);
47      MPI_Comm_size(MPI_COMM_WORLD, &mpi_num);
48      #endif
49    
50      #ifdef _OPENMP
51      #pragma omp parallel
52      #endif
53      {
54        int omp_iam=0, omp_num=1;
55        #ifdef _OPENMP
56        omp_iam = omp_get_thread_num(); /* Call in a parallel region */
57        omp_num = omp_get_num_threads();
58        #endif
59        printf("printParallelThreadCounts: OpenMP=%d/%d MPI=%d/%d running on %s\n", omp_iam, omp_num, mpi_iam, mpi_num, hname);
60      }
61    }
62    
63  void setNumberOfThreads(const int num_threads)  void setNumberOfThreads(const int num_threads)
64  {  {
65    

Legend:
Removed from v.1384  
changed lines
  Added in v.1567

  ViewVC Help
Powered by ViewVC 1.1.26