/[escript]/trunk/paso/src/Paso.c
ViewVC logotype

Diff of /trunk/paso/src/Paso.c

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

revision 633 by dhawcroft, Thu Mar 23 05:37:00 2006 UTC revision 730 by bcumming, Mon May 15 04:03:49 2006 UTC
# Line 26  Line 26 
26  #include "Paso.h"  #include "Paso.h"
27  #ifdef _OPENMP  #ifdef _OPENMP
28  #include <omp.h>  #include <omp.h>
29  #else  #else
30    #ifdef PASO_MPI
31    
32    #else
33  #include <time.h>  #include <time.h>
34  #endif  #endif
35    #endif
36    
37  Paso_ErrorCodeType Paso_ErrorCode_=NO_ERROR;  Paso_ErrorCodeType Paso_ErrorCode_=NO_ERROR;
38  char Paso_ErrorMsg_[LenErrorMsg_MAX]={'\0'};  char Paso_ErrorMsg_[LenErrorMsg_MAX]={'\0'};
# Line 69  bool_t Paso_checkPtr(void* ptr) { Line 73  bool_t Paso_checkPtr(void* ptr) {
73  /* This function returns a timer */  /* This function returns a timer */
74  double Paso_timer(void) {  double Paso_timer(void) {
75    double out;    double out;
76    #ifdef _OPENMP  
77    #ifdef PASO_MPI
78      out = MPI_Wtime();
79    #else
80    #ifdef _OPENMP
81    out=omp_get_wtime();    out=omp_get_wtime();
82    #else  #else
83    out=((double) clock())/CLOCKS_PER_SEC;    out=((double) clock())/CLOCKS_PER_SEC;
84    #endif  #endif
85    #endif
86    return out;    return out;
87  }  }
88    
# Line 87  char* Paso_getErrorMessage(void) { Line 96  char* Paso_getErrorMessage(void) {
96     return Paso_ErrorMsg_;     return Paso_ErrorMsg_;
97  }  }
98    
99    #ifdef PASO_MPI
100    /* checks that there is no error accross all processes in a communicator */
101    /* NOTE : does not make guarentee consistency of error string on each process */
102    bool_t Paso_MPI_noError( Paso_MPIInfo *mpi_info )
103    {
104        int errorLocal=0, errorGlobal=0;
105    
106        errorLocal = (int)Paso_noError();
107        MPI_Allreduce( &errorLocal, &errorGlobal, 1, MPI_INT, MPI_LAND, mpi_info->comm  );
108    
109        return errorGlobal;
110    }
111    #endif
112  /**************************************************************/  /**************************************************************/

Legend:
Removed from v.633  
changed lines
  Added in v.730

  ViewVC Help
Powered by ViewVC 1.1.26