Changeset 4233


Ignore:
Timestamp:
06/25/10 12:15:02 (15 years ago)
Author:
Eric.Larour
Message:

Simplification of SpawnCoreParallel

Location:
issm/trunk/src/c
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Makefile.am

    r4218 r4233  
    10431043                                        ./modules/Qmux/DakotaResponses.cpp\
    10441044                                        ./modules/Qmux/DakotaMPI_Bcast.cpp\
     1045                                        ./modules/Qmux/DakotaFree.cpp\
    10451046                                        ./modules/Qmux/SpawnCore.cpp\
    10461047                                        ./modules/Qmux/SpawnCoreParallel.cpp\
  • issm/trunk/src/c/modules/Qmux/Qmux.h

    r4193 r4233  
    2020void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,FemModel* femmodel);
    2121void DakotaMPI_Bcast(double** pvariables, char*** pvariables_descriptors,int* pnumvariables, int* pnumresponses);
     22void DakotaFree(double** pvariables,char*** pvariables_descriptors,char*** presponses_descriptors,int numvariables,int numresponses);
    2223#endif
    2324
  • issm/trunk/src/c/modules/Qmux/SpawnCoreParallel.cpp

    r4200 r4233  
    4343        char    *string                    = NULL;
    4444        int      string_length;
    45         double  *qmu_part                  = NULL;
    46         int      qmu_npart;
    4745        int      verbose                   = 0;
    4846        int      dummy;
     
    5755        femmodel->parameters->FindParam(&responses_descriptors,&dummy,ResponseDescriptorsEnum);
    5856
    59         /* only cpu 0, running dakota is providing us with variables, variables_descriptors and responses.
    60          * broadcast onto other cpus: */
     57        /* only cpu 0, running dakota is providing us with variables and variables_descriptors and numresponses: broadcast onto other cpus: */
    6158        DakotaMPI_Bcast(&variables,&variables_descriptors,&numvariables,&numresponses);
    6259
     
    9188        DakotaResponses(responses,responses_descriptors,numresponses,femmodel);
    9289
    93         /*Free ressources:{{{1*/
    94         //variables only on cpu != 0
    95         if(my_rank!=0){
    96                 xfree((void**)&variables);
    97                 for(i=0;i<numvariables;i++){
    98                         string=variables_descriptors[i];
    99                         xfree((void**)&string);
    100                 }
    101                 xfree((void**)&variables_descriptors);
    102         }
    103         //responses descriptors
    104         for(i=0;i<numresponses;i++){
    105                 string=responses_descriptors[i];
    106                 xfree((void**)&string);
    107         }
    108         //rest of dynamic allocations.
    109         xfree((void**)&responses_descriptors);
    110         xfree((void**)&qmu_part);
    111         /*}}}*/
     90        /*Free ressources:*/
     91        DakotaFree(&variables,&variables_descriptors,&responses_descriptors, numvariables, numresponses);
    11292}
    11393
Note: See TracChangeset for help on using the changeset viewer.