Ignore:
Timestamp:
09/04/09 16:58:25 (16 years ago)
Author:
Eric.Larour
Message:

Heavy debugging of Mass flux capability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp

    r1904 r2112  
    4242        /*output from core solutions: */
    4343        DataSet* results=NULL;
     44        DataSet* processed_results=NULL;
    4445
    4546        char** responses_descriptors=NULL;
     
    110111        #endif
    111112
     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
    112137        _printf_("qmu iteration: %i\n",counter);
    113138
     
    150175        /*Now process the outputs, before computing the dakota responses: */
    151176        if(debug)_printf_("process results:\n");
    152         ProcessResults(&results,model,analysis_type);
    153        
    154 
     177        ProcessResults(&processed_results,results,model,analysis_type);
     178       
    155179        /*compute responses on cpu 0: dummy for now! */
    156180        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);
    158182
    159183        /*Free ressources:*/
    160184        delete results;
     185        delete processed_results;
    161186
    162187        //variables only on cpu != 0
Note: See TracChangeset for help on using the changeset viewer.