/[escript]/branches/arrayview_from_1695_trunk/escript/src/Utils.cpp
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/escript/src/Utils.cpp

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

revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1561 by ksteube, Wed May 21 06:58:52 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    
42      #ifdef PASO_MPI
43      MPI_Comm_rank(MPI_COMM_WORLD, &mpi_iam);
44      MPI_Comm_size(MPI_COMM_WORLD, &mpi_num);
45      #endif
46    
47      #ifdef _OPENMP
48      #pragma omp parallel
49      #endif
50      {
51        int omp_iam=0, omp_num=1;
52        #ifdef _OPENMP
53        omp_iam = omp_get_thread_num(); /* Call in a parallel region */
54        omp_num = omp_get_num_threads();
55        #endif
56        printf("printParallelThreadCounts: OpenMP=%d/%d MPI=%d/%d\n", omp_iam, omp_num, mpi_iam, mpi_num);
57      }
58    }
59    
60  void setNumberOfThreads(const int num_threads)  void setNumberOfThreads(const int num_threads)
61  {  {
62    

Legend:
Removed from v.1388  
changed lines
  Added in v.1561

  ViewVC Help
Powered by ViewVC 1.1.26