Changeset 4201
- Timestamp:
- 06/24/10 15:15:13 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/include/macros.h
r3913 r4201 3 3 */ 4 4 5 /*Header {{{1*/ 5 6 #ifndef _MACROS_H_ 6 7 #define _MACROS_H_ … … 13 14 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 14 15 #endif 16 /*}}}*/ 15 17 16 /*Printing macro: */ 18 /*Printing macro: call MPI_Barrier in debugging mode so that prints are synchronized*/ 19 #ifdef _ISSM_DEBUG_ 17 20 #define _printf_(...) PrintfFunction(__VA_ARGS__) 21 #else 22 #define _printf_(...) MPI_Barrier(MPI_COMM_WORLD); PrintfFunction(__VA_ARGS__) 23 #endif 18 24 19 25 /*Error exception macro*/ -
issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
r4195 r4201 64 64 void DoubleMatExternalResult::DeepEcho(void){ 65 65 66 int i ;66 int i,j; 67 67 68 68 printf("DoubleMatExternalResult:\n"); 69 69 printf(" id: %i\n",this->id); 70 70 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 71 printf(" matrix size: %i-%i\n",this->M,this->N);72 for(i=0;i<this->M;i++){73 printf("%i %g\n",i,this->values[i]);74 }75 71 printf(" step: %i\n",this->step); 76 72 printf(" time: %g\n",this->time); 73 printf(" matrix size: %i-%i\n",this->M,this->N); 74 for (i=0;i<this->M;i++){ 75 printf(" [ "); 76 for (j=0;j<this->N;j++){ 77 printf(" %12.6g ",this->values[i*this->N+j]); 78 } 79 printf(" ]\n"); 80 } 81 printf("\n"); 82 77 83 } 78 84 /*}}}*/ … … 109 115 printf("DoubleMatExternalResult:\n"); 110 116 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 111 printf(" matrix size: %i-%i\n",this->M,this->N);112 117 printf(" step: %i\n",this->step); 113 118 printf(" time: %g\n",this->time); 119 printf(" matrix size: %i-%i\n",this->M,this->N); 114 120 115 121 } … … 178 184 int length; 179 185 int type; 180 int size;186 int rows,cols; 181 187 char *name = NULL; 182 188 extern int my_rank; 183 189 184 190 /*return if now on cpu 0: */ 185 if(my_rank) return;191 if(my_rank) return; 186 192 187 193 /*First write enum: */ … … 197 203 /*writing a double array, type is 3:*/ 198 204 type=3; 199 size=this->M*this->N;200 205 fwrite(&type,sizeof(int),1,fid); 201 fwrite(&size,sizeof(int),1,fid); 202 fwrite(this->values,size*sizeof(double),1,fid); 206 rows=this->M; 207 fwrite(&rows,sizeof(int),1,fid); 208 cols=this->N; 209 fwrite(&cols,sizeof(int),1,fid); 210 fwrite(this->values,cols*rows*sizeof(double),1,fid); 203 211 204 212 } -
issm/trunk/src/c/shared/Elements/elements.h
r3970 r4201 18 18 printf(" [ "); 19 19 for (j=0;j<cols;j++){ 20 printf(" %1 0.10g ",array[i*cols+j]);20 printf(" %12.6g ",array[i*cols+j]); 21 21 } 22 22 printf(" ]\n"); … … 30 30 printf(" [ "); 31 31 for (j=0;j<cols;j++){ 32 printf(" % i",array[i*cols+j]);32 printf(" %6i",array[i*cols+j]); 33 33 } 34 34 printf(" ]\n");
Note:
See TracChangeset
for help on using the changeset viewer.