Changeset 2112 for issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp
- Timestamp:
- 09/04/09 16:58:25 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp
r1904 r2112 42 42 /*output from core solutions: */ 43 43 DataSet* results=NULL; 44 DataSet* processed_results=NULL; 44 45 45 46 char** responses_descriptors=NULL; … … 110 111 #endif 111 112 113 /*broadcast response descriptors: */ 114 MPI_Bcast(&numresponses,1,MPI_INT,0,MPI_COMM_WORLD); 115 if(my_rank!=0){ 116 responses_descriptors=(char**)xmalloc(numresponses*sizeof(char*)); 117 } 118 for(i=0;i<numresponses;i++){ 119 if(my_rank==0){ 120 string=responses_descriptors[i]; 121 string_length=(strlen(string)+1)*sizeof(char); 122 } 123 MPI_Bcast(&string_length,1,MPI_INT,0,MPI_COMM_WORLD); 124 if(my_rank!=0)string=(char*)xmalloc(string_length); 125 MPI_Bcast(string,string_length,MPI_CHAR,0,MPI_COMM_WORLD); 126 if(my_rank!=0)responses_descriptors[i]=string; 127 } 128 129 #ifdef _ISSM_DEBUG_ 130 for(i=0;i<numresponses;i++){ 131 PetscSynchronizedPrintf(MPI_COMM_WORLD,"variable descriptor %i: %s value: %g\n",i,responses_descriptors[i],responses[i]); 132 PetscSynchronizedFlush(MPI_COMM_WORLD); 133 } 134 #endif 135 136 112 137 _printf_("qmu iteration: %i\n",counter); 113 138 … … 150 175 /*Now process the outputs, before computing the dakota responses: */ 151 176 if(debug)_printf_("process results:\n"); 152 ProcessResults(&results,model,analysis_type); 153 154 177 ProcessResults(&processed_results,results,model,analysis_type); 178 155 179 /*compute responses on cpu 0: dummy for now! */ 156 180 if(debug)_printf_("compute dakota responses:\n"); 157 DakotaResponses(responses,responses_descriptors,numresponses,model,results, analysis_type,sub_analysis_type);181 DakotaResponses(responses,responses_descriptors,numresponses,model,results,processed_results,analysis_type,sub_analysis_type); 158 182 159 183 /*Free ressources:*/ 160 184 delete results; 185 delete processed_results; 161 186 162 187 //variables only on cpu != 0
Note:
See TracChangeset
for help on using the changeset viewer.