Changeset 14330
- Timestamp:
- 02/07/13 16:16:06 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
r13612 r14330 28 28 Observations *observations = NULL; 29 29 30 /*timing*/ 31 double start, finish; 32 double start_core, finish_core; 33 double start_init, finish_init; 34 30 35 /*Get my_rank: */ 31 36 my_rank=IssmComm::GetRank(); … … 33 38 34 39 /*Get some Options*/ 40 MPI_Barrier(MPI_COMM_WORLD); start=MPI_Wtime(); 35 41 options->Get(&radius,"searchradius",0.); 36 42 options->Get(&mindata,"mindata",1); … … 38 44 39 45 /*Process observation dataset*/ 46 MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime(); 40 47 observations=new Observations(obs_list,obs_x,obs_y,obs_length,options); 48 MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime(); 41 49 42 50 /*Allocate output*/ … … 47 55 options->Get(&output,"output",(char*)"prediction"); 48 56 57 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 49 58 if(strcmp(output,"quadtree")==0){ 50 59 observations->QuadtreeColoring(predictions,x_interp,y_interp,n_interp); … … 109 118 _error_("output '" << output << "' not supported yet"); 110 119 } 120 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 111 121 112 122 /*clean-up and Assign output pointer*/ … … 116 126 *ppredictions = predictions; 117 127 *perror = error; 128 129 MPI_Barrier(MPI_COMM_WORLD); finish=MPI_Wtime( ); 130 _printf_(true,"\n %-34s %f seconds \n","Observation fitering elapsed time:",finish_init-start_init); 131 _printf_(true," %-34s %f seconds \n","Kriging prediction elapsed time:",finish_core-start_core); 132 _printf_(true,"\n %s %i hrs %i min %i sec\n\n","Total elapsed time:",int((finish-start)/3600),int(int(finish-start)%3600/60),int(finish-start)%60); 118 133 return 1; 119 134 }/*}}}*/ -
issm/trunk-jpl/src/c/solutions/kriging.cpp
r13798 r14330 8 8 void ProcessArguments2(char** pbinfilename,char** poutbinfilename,char** plockfilename,char** prootpath,int argc,char **argv); 9 9 void ProcessInputfile(IssmDouble **px,IssmDouble **py,IssmDouble **pdata,int *pnobs,IssmDouble **px_interp,IssmDouble **py_interp,int *pninterp,Options **poptions,FILE* fid); 10 11 int my_rank;12 int num_procs;13 10 14 11 int main(int argc,char **argv){ … … 26 23 27 24 MPI_Comm comm; 28 extern int my_rank;29 extern int num_procs;30 25 31 26 /*Input*/ … … 47 42 /*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/ 48 43 comm=EnvironmentInit(argc,argv); 44 IssmComm::SetComm(comm); 49 45 50 MPI_Comm_size(comm,&num_procs);51 MPI_Comm_rank(comm,&my_rank);52 53 /*First process inputs*/54 _pprintLine_("");55 _pprintLine_("Ice Sheet System Model (" << PACKAGE_NAME << ") version " << PACKAGE_VERSION);56 _pprintLine_("(website: " << PACKAGE_URL << " contact: " << PACKAGE_BUGREPORT << ")");57 _pprintLine_("");58 46 ProcessArguments2(&binfilename,&outbinfilename,&lockfilename,&rootpath,argc,argv); 59 47 … … 68 56 _pprintLine_("write results to disk:"); 69 57 Results *results = new Results(); 70 if( my_rank==0){58 if(IssmComm::GetRank()==0){ 71 59 output_fid=pfopen(outbinfilename,"wb"); 72 60 results->AddObject(new GenericExternalResult<double*>(results->Size()+1,0,predictions,ninterp,1,1,0));
Note:
See TracChangeset
for help on using the changeset viewer.