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

trunk/esys2/paso/src/Paso.c revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC trunk/paso/src/Paso.c revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC
# Line 1  Line 1 
1  /* $Id$ */  /* $Id$ */
2    
3    
4    /*
5    ********************************************************************************
6    *               Copyright   2006 by ACcESS MNRF                                *
7    *                                                                              *
8    *                 http://www.access.edu.au                                     *
9    *           Primary Business: Queensland, Australia                            *
10    *     Licensed under the Open Software License version 3.0             *
11    *        http://www.opensource.org/licenses/osl-3.0.php                        *
12    ********************************************************************************
13    */
14    
15  /**************************************************************/  /**************************************************************/
16    
17  /*    Paso finite element solver */  /*    Paso finite element solver */
# Line 14  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 39  void Paso_setError(Paso_ErrorCodeType er Line 55  void Paso_setError(Paso_ErrorCodeType er
55  /* checks if there is no error */  /* checks if there is no error */
56  bool_t Paso_noError(void) {  bool_t Paso_noError(void) {
57     Paso_ErrorCodeType err=Paso_getErrorType();     Paso_ErrorCodeType err=Paso_getErrorType();
58     return (err==NO_ERROR ||  err==WARNING);     /* return (err==NO_ERROR ||  err==WARNING);*/
59       return (err==NO_ERROR);
60  }  }
61  /* This function checks if the pointer ptr has a target. If not an  /* This function checks if the pointer ptr has a target. If not an
62     error is raised and TRUE is returned. */     error is raised and TRUE is returned. */
# Line 56  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 73  Paso_ErrorCodeType Paso_getErrorType(voi Line 95  Paso_ErrorCodeType Paso_getErrorType(voi
95  char* Paso_getErrorMessage(void) {  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        // take care of the case where the error was on another processor
110        if( errorLocal && !errorGlobal )
111            Paso_setError( PASO_MPI_ERROR, "Paso_MPI_noError() : there was an error on another MPI process" );
112      return errorGlobal;
113    }
114    #endif
115  /**************************************************************/  /**************************************************************/
   
   
 /*  
  * $Log$  
  * Revision 1.2  2005/09/15 03:44:38  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-15  
  *  
  * Revision 1.1.2.3  2005/09/08 08:28:39  gross  
  * some cleanup in savevtk  
  *  
  * Revision 1.1.2.2  2005/09/07 00:59:08  gross  
  * some inconsistent renaming fixed to make the linking work.  
  *  
  * Revision 1.1.2.1  2005/09/05 06:29:47  gross  
  * These files have been extracted from finley to define a stand alone libray for iterative  
  * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but  
  * has not been tested yet.  
  *  
  * Revision 1.2  2005/07/08 04:07:50  jgs  
  * Merge of development branch back to main trunk on 2005-07-08  
  *  
  * Revision 1.1.1.1.2.1  2005/06/29 02:34:50  gross  
  * some changes towards 64 integers in finley  
  *  
  * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
  * initial import of project esys2  
  *  
  * Revision 1.2  2004/07/02 04:21:13  gross  
  * Paso C code has been included  
  *  
  * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
  * Initial version of eys using boost-python.  
  *  
  *  
  */  

Legend:
Removed from v.150  
changed lines
  Added in v.782

  ViewVC Help
Powered by ViewVC 1.1.26