Changeset 85
- Timestamp:
- 04/28/09 15:08:31 (16 years ago)
- Location:
- issm/trunk/src/c/parallel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/OutputControl.cpp
r46 r85 1 2 1 /* 3 2 OutputControl.c: output model results for control solution. … … 10 9 #include "../io/io.h" 11 10 #include "../objects/objects.h" 12 11 13 12 void OutputControl(Vec u_g,double* p_g, double* J, int nsteps, Vec partition,char* filename,NodeSets* nodesets){ 14 13 … … 20 19 21 20 /* standard output: */ 21 Vec partition_shifted=NULL; 22 22 double* serial_partition=NULL; 23 23 24 double* serial_u _g=NULL;24 double* serial_ug=NULL; 25 25 int one=1; 26 26 int gsize; 27 27 28 28 /*serialize outputs: */ 29 VecShift(partition,1.0); //matlab indexing 30 VecToMPISerial(&serial_partition,partition); 31 32 VecToMPISerial(&serial_u_g,u_g); 29 VecDuplicate(partition,&partition_shifted); 30 VecCopy(partition,partition_shifted); 31 VecShift(partition_shifted,1.0); //matlab indexing starts at 1 32 VecToMPISerial(&serial_partition,partition_shifted); 33 34 VecToMPISerial(&serial_ug,u_g); 33 35 34 36 /* Open output file to write raw binary data: */ … … 46 48 /*Write partition: */ 47 49 WriteDataToDisk(serial_partition,&gsize,&one,"Mat",fid); 48 50 49 51 /*Write solution to disk: */ 50 WriteDataToDisk(serial_u _g,&gsize,&one,"Mat",fid);52 WriteDataToDisk(serial_ug,&gsize,&one,"Mat",fid); 51 53 52 54 /*Write parameter to disk: */ … … 56 58 WriteDataToDisk(&nsteps,NULL,NULL,"Integer",fid); 57 59 WriteDataToDisk(J,&nsteps,&one,"Mat",fid); 58 60 59 61 /*Close file: */ 60 62 if(fclose(fid)!=0)throw ErrorException(__FUNCT__,exprintf("%s%s","could not close file ",filename)); 61 63 } 62 64 65 VecFree(&partition_shifted); 66 xfree((void**)&serial_partition); 67 xfree((void**)&serial_ug); 68 63 69 } -
issm/trunk/src/c/parallel/OutputDiagnostic.cpp
r57 r85 20 20 21 21 /* standard output: */ 22 Vec partition_shifted=NULL; 22 23 double* serial_partition=NULL; 23 24 int analysis_size; 24 25 25 double* serial_u _g=NULL;26 double* serial_ug=NULL; 26 27 int one=1; 27 28 int gsize; 28 29 29 30 /*serialize outputs: */ 30 VecShift(partition,1.0); //matlab indexing 31 VecToMPISerial(&serial_partition,partition); 31 VecDuplicate(partition,&partition_shifted); 32 VecCopy(partition,partition_shifted); 33 VecShift(partition_shifted,1.0); //matlab indexing starts at 1 34 VecToMPISerial(&serial_partition,partition_shifted); 32 35 33 VecToMPISerial(&serial_u _g,u_g);36 VecToMPISerial(&serial_ug,u_g); 34 37 35 38 /* Open output file to write raw binary data: */ … … 49 52 50 53 /*Write solution to disk: */ 51 WriteDataToDisk(serial_u _g,&gsize,&one,"Mat",fid);54 WriteDataToDisk(serial_ug,&gsize,&one,"Mat",fid); 52 55 53 56 /*Close file: */ … … 55 58 } 56 59 60 /*Free ressources: */ 61 VecFree(&partition_shifted); 62 xfree((void**)&serial_partition); 63 xfree((void**)&serial_ug); 57 64 }
Note:
See TracChangeset
for help on using the changeset viewer.