Changeset 19634
- Timestamp:
- 10/14/15 12:20:38 (9 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/m4/issm_options.m4
r19633 r19634 452 452 if test x$DAKOTA_VERSION = x4.2 || test x$DAKOTA_VERSION = x4.2+; then 453 453 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 454 AM_CONDITIONAL([ISSM_DAKOTA],0) 454 455 else if test x$DAKOTA_VERSION = x5.1 || test x$DAKOTA_VERSION = x5.2; then 455 456 DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota -lteuchos -lpecos -llhs -lsparsegrid -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -loptpp -lpsuade -lncsuopt -lcolin -linterfaces -lmomh -lscolib -lpebbl -ltinyxml -lutilib -l3po -lhopspack -lnidr -lamplsolver -lboost_signals -lboost_regex -lboost_filesystem" 457 AM_CONDITIONAL([ISSM_DAKOTA],0) 456 458 else if test x$DAKOTA_VERSION = x6.1 || test x$DAKOTA_VERSION = x6.2; then 457 459 DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL" … … 459 461 AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H]) 460 462 AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI]) 463 AM_CONDITIONAL([ISSM_DAKOTA],1) 461 464 else 462 465 AC_MSG_ERROR([Dakota version not found or version ($DAKOTA_VERSION) not supported!]); … … 468 471 if test x$DAKOTA_VERSION = x4.2 || test x$DAKOTA_VERSION = x4.2+; then 469 472 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 473 AM_CONDITIONAL([ISSM_DAKOTA],0) 470 474 else if test x$DAKOTA_VERSION = x5.1 || test x$DAKOTA_VERSION = x5.2; then 471 475 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -llhs -lsparsegrid -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -loptpp -lpsuade -lncsuopt -lcolin -linterfaces -lmomh -lscolib -lpebbl -ltinyxml -lutilib -l3po -lhopspack -lnidr -lamplsolver -lboost_signals -lboost_regex -lboost_filesystem -lboost_system -ldl" 476 AM_CONDITIONAL([ISSM_DAKOTA],0) 472 477 else if test x$DAKOTA_VERSION = x5.3 || test x$DAKOTA_VERSION = x5.3.1; then 473 478 DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL" 474 479 DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -lpecos_src -lscolib -ljega_fe -llhs -lpebbl -lcolin -linterfaces -lmods -lmoga -loptpp -lsampling -lsoga -lsurfpack -lutilib -lconmin -ldakota_src_fortran -lmod -lncsuopt -lsurfpack_fortran -lteuchos -l3po -lamplsolver -lanalyzer -lbose -lcport -ldace -ldfftpack -leutils -lfsudace -lhopspack -ljega -lnidr -lpecos -lpsuade -lrandom -ltinyxml -lutilities -lsparsegrid -lboost_signals -lboost_regex -lboost_filesystem -lboost_system" 480 AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H]) 481 AM_CONDITIONAL([ISSM_DAKOTA],0) 475 482 else if test x$DAKOTA_VERSION = x6.1 || test x$DAKOTA_VERSION = x6.2; then 476 483 DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL" … … 478 485 AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H]) 479 486 AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI]) 487 AM_CONDITIONAL([ISSM_DAKOTA],1) 480 488 else 481 489 AC_MSG_ERROR([Dakota version not found or version ($DAKOTA_VERSION) not supported!]); … … 488 496 if test x$DAKOTA_VERSION = x4.2 || test x$DAKOTA_VERSION = x4.2+; then 489 497 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 498 AM_CONDITIONAL([ISSM_DAKOTA],0) 490 499 dnl DAKOTALIB+= "-lgslcblas -L/usr/lib -lblas -llapack" 491 500 else if test x$DAKOTA_VERSION = x5.1 || test x$DAKOTA_VERSION = x5.2; then 492 501 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -llhs -lsparsegrid -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -loptpp -lpsuade -lncsuopt -lcolin -linterfaces -lmomh -lscolib -lpebbl -ltinyxml -lutilib -l3po -lhopspack -lnidr -lamplsolver -lboost_signals -lboost_regex -lboost_filesystem -lboost_system" 502 AM_CONDITIONAL([ISSM_DAKOTA],0) 493 503 dnl DAKOTALIB+= "-lgslcblas -L/usr/lib -lblas -llapack" 494 504 else if test x$DAKOTA_VERSION = x5.3 || test x$DAKOTA_VERSION = x5.3.1; then 495 505 DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL" 496 506 DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -lpecos_src -lscolib -ljega_fe -llhs -lpebbl -lcolin -linterfaces -lmods -lmoga -loptpp -lsampling -lsoga -lsurfpack -lutilib -lconmin -ldakota_src_fortran -lmod -lncsuopt -lsurfpack_fortran -lteuchos -l3po -lamplsolver -lanalyzer -lbose -lcport -ldace -ldfftpack -leutils -lfsudace -lhopspack -ljega -lnidr -lpecos -lpsuade -lrandom -ltinyxml -lutilities -lsparsegrid -lboost_signals -lboost_regex -lboost_filesystem -lboost_system" 507 AM_CONDITIONAL([ISSM_DAKOTA],0) 508 AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H]) 509 AM_CONDITIONAL([ISSM_DAKOTA],0) 497 510 else if test x$DAKOTA_VERSION = x6.1 || test x$DAKOTA_VERSION = x6.2; then 498 511 DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL -Wno-deprecated-register -Wno-return-type" … … 500 513 AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H]) 501 514 AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI]) 515 AM_CONDITIONAL([ISSM_DAKOTA],1) 502 516 else 503 517 AC_MSG_ERROR([Dakota version not found or version ($DAKOTA_VERSION) not supported!]); -
issm/trunk-jpl/src/c/Makefile.am
r19632 r19634 661 661 endif 662 662 663 if DAKOTA663 if ISSM_DAKOTA 664 664 bin_PROGRAMS += issm_dakota 665 665 issm_dakota_SOURCES = main/issm_dakota.cpp -
issm/trunk-jpl/src/c/classes/Dakota/IssmDirectApplicInterface.h
r19632 r19634 38 38 /*}}}*/ 39 39 40 #if defined(_HAVE_DAKOTA_) && (_DAKOTA_MAJOR_ < 5 || (_DAKOTA_MAJOR_ == 5 && _DAKOTA_MINOR_ < 3))40 #if !defined(_WRAPPERS_) && defined(_HAVE_DAKOTA_) && (_DAKOTA_MAJOR_ <= 5) //this only works for Dakota <=5, which had no effective parallel capabilities yet. 41 41 42 42 /*Dakota include files:{{{*/ 43 #include <DakotaInterface.H> 44 #include <DakotaStrategy.H> 45 #include <DakotaModel.H> 43 #if (_DAKOTA_MAJOR_ < 5 || (_DAKOTA_MAJOR_ == 5 && _DAKOTA_MINOR_ < 3)) 46 44 #include <DirectApplicInterface.H> 47 45 #include <DakotaResponse.H> … … 50 48 #include <ProblemDescDB.H> 51 49 #include <ParallelLibrary.H> 50 #else 51 #include <DirectApplicInterface.hpp> 52 #include <DakotaResponse.hpp> 53 #include <ParamResponsePair.hpp> 54 #include <ProblemDescDB.hpp> 55 #include <ParallelLibrary.hpp> 56 #endif 52 57 /*}}}*/ 58 59 int DakotaSpawnCore(double* d_responses, int d_numresponses, double* d_variables, char** d_variables_descriptors,int d_numvariables, void* void_femmodel,int counter); 53 60 54 61 /*IssmDirectApplicInterface class */ -
issm/trunk-jpl/src/c/cores/dakota_core.cpp
r19632 r19634 59 59 #include "../shared/shared.h" 60 60 #include "../classes/classes.h" 61 62 #if defined(_HAVE_DAKOTA_) && (_DAKOTA_MAJOR_ < 5 || (_DAKOTA_MAJOR_ == 5 && _DAKOTA_MINOR_ < 3)) 63 64 /*include dakota files: */ 61 #include "../modules/modules.h" 62 63 #if defined(_HAVE_DAKOTA_) && (_DAKOTA_MAJOR_ <= 5) //this only works for Dakota <=5, which had no effective parallel capabilities yet. 64 /*Dakota include files:{{{*/ 65 #if (_DAKOTA_MAJOR_ < 5 || (_DAKOTA_MAJOR_ == 5 && _DAKOTA_MINOR_ < 3)) 65 66 #include <ParallelLibrary.H> 66 67 #include <ProblemDescDB.H> … … 68 69 #include <DakotaModel.H> 69 70 #include <DakotaInterface.H> 70 int DakotaSpawnCore(double* d_responses, int d_numresponses, double* d_variables, char** d_variables_descriptors,int d_numvariables, void* void_femmodel,int counter){ /*{{{*/ 71 72 /*Notice the d_, which prefixes anything that is being provided to us by the Dakota pluggin. Careful. some things are ours, some are dakotas!: */ 73 74 char **responses_descriptors = NULL; //these are our! there are only numresponsedescriptors of them, not d_numresponses!!! 75 int numresponsedescriptors; 76 int solution_type; 77 bool control_analysis = false; 78 void (*solutioncore)(FemModel*) = NULL; 79 FemModel *femmodel = NULL; 80 bool nodakotacore = true; 81 82 /*If counter==-1 on cpu0, it means that the dakota runs are done. In which case, bail out and return 0: */ 83 ISSM_MPI_Bcast(&counter,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 84 if(counter==-1)return 0; 85 86 /*cast void_femmodel to FemModel, and at the same time, make a copy, so we start this new core run for this specific sample 87 *with a brand new copy of the model, which has not been tempered with by previous dakota runs: */ 88 femmodel=(reinterpret_cast<FemModel*>(void_femmodel))->copy(); 89 90 /*retrieve parameters: */ 91 femmodel->parameters->FindParam(&responses_descriptors,&numresponsedescriptors,QmuResponsedescriptorsEnum); 92 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 93 femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum); 94 95 if(VerboseQmu()) _printf0_("qmu iteration: " << counter << "\n"); 96 97 /* only cpu 0, running dakota is providing us with variables and variables_descriptors and numresponses: broadcast onto other cpus: */ 98 DakotaMPI_Bcast(&d_variables,&d_variables_descriptors,&d_numvariables,&d_numresponses); 99 100 /*Modify core inputs in objects contained in femmodel, to reflect the dakota variables inputs: */ 101 InputUpdateFromDakotax(femmodel,d_variables,d_variables_descriptors,d_numvariables); 102 103 /*Determine solution sequence: */ 104 if(VerboseQmu()) _printf0_("Starting " << EnumToStringx(solution_type) << " core:\n"); 105 WrapperCorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type,nodakotacore); 106 107 /*Run the core solution sequence: */ 108 solutioncore(femmodel); 109 110 /*compute responses: */ 111 if(VerboseQmu()) _printf0_("compute dakota responses:\n"); 112 femmodel->DakotaResponsesx(d_responses,responses_descriptors,numresponsedescriptors,d_numresponses); 113 114 /*Free ressources:*/ 115 DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors); 116 117 /*Avoid leaks here: */ 118 delete femmodel; 119 120 return 1; //this is critical! do not return 0, otherwise, dakota_core will stop running! 121 } 71 #else 72 #include <ParallelLibrary.hpp> 73 #include <ProblemDescDB.hpp> 74 #include <DakotaStrategy.hpp> 75 #include <DakotaModel.hpp> 76 #include <DakotaInterface.hpp> 77 #endif 122 78 /*}}}*/ 79 80 void DakotaFree(double** pvariables,char*** pvariables_descriptors,char*** presponses_descriptors,int numvariables,int numresponses){ /*{{{*/ 81 82 /*\brief DakotaFree: free allocations on other cpus, not done by Dakota.*/ 83 84 int i; 85 int my_rank; 86 87 double *variables = NULL; 88 char **variables_descriptors = NULL; 89 char **responses_descriptors = NULL; 90 char *string = NULL; 91 92 /*recover pointers: */ 93 variables=*pvariables; 94 variables_descriptors=*pvariables_descriptors; 95 responses_descriptors=*presponses_descriptors; 96 97 /*recover my_rank:*/ 98 my_rank=IssmComm::GetRank(); 99 100 /*Free variables and variables_descriptors only on cpu !=0*/ 101 if(my_rank!=0){ 102 xDelete<double>(variables); 103 for(i=0;i<numvariables;i++){ 104 string=variables_descriptors[i]; 105 xDelete<char>(string); 106 } 107 xDelete<char*>(variables_descriptors); 108 } 109 110 //responses descriptors on every cpu 111 for(i=0;i<numresponses;i++){ 112 string=responses_descriptors[i]; 113 xDelete<char>(string); 114 } 115 //rest of dynamic allocations. 116 xDelete<char*>(responses_descriptors); 117 118 /*Assign output pointers:*/ 119 *pvariables=variables; 120 *pvariables_descriptors=variables_descriptors; 121 *presponses_descriptors=responses_descriptors; 122 } /*}}}*/ 123 123 void DakotaMPI_Bcast(double** pvariables, char*** pvariables_descriptors,int* pnumvariables, int* pnumresponses){ /*{{{*/ 124 124 … … 180 180 *pnumresponses=numresponses; 181 181 } /*}}}*/ 182 void DakotaFree(double** pvariables,char*** pvariables_descriptors,char*** presponses_descriptors,int numvariables,int numresponses){ /*{{{*/ 183 184 /*\brief DakotaFree: free allocations on other cpus, not done by Dakota.*/ 185 186 int i; 187 int my_rank; 188 189 double *variables = NULL; 190 char **variables_descriptors = NULL; 191 char **responses_descriptors = NULL; 192 char *string = NULL; 193 194 /*recover pointers: */ 195 variables=*pvariables; 196 variables_descriptors=*pvariables_descriptors; 197 responses_descriptors=*presponses_descriptors; 198 199 /*recover my_rank:*/ 200 my_rank=IssmComm::GetRank(); 201 202 /*Free variables and variables_descriptors only on cpu !=0*/ 203 if(my_rank!=0){ 204 xDelete<double>(variables); 205 for(i=0;i<numvariables;i++){ 206 string=variables_descriptors[i]; 207 xDelete<char>(string); 208 } 209 xDelete<char*>(variables_descriptors); 210 } 211 212 //responses descriptors on every cpu 213 for(i=0;i<numresponses;i++){ 214 string=responses_descriptors[i]; 215 xDelete<char>(string); 216 } 217 //rest of dynamic allocations. 218 xDelete<char*>(responses_descriptors); 219 220 /*Assign output pointers:*/ 221 *pvariables=variables; 222 *pvariables_descriptors=variables_descriptors; 223 *presponses_descriptors=responses_descriptors; 224 } /*}}}*/ 182 int DakotaSpawnCore(double* d_responses, int d_numresponses, double* d_variables, char** d_variables_descriptors,int d_numvariables, void* void_femmodel,int counter){ /*{{{*/ 183 184 /*Notice the d_, which prefixes anything that is being provided to us by the Dakota pluggin. Careful. some things are ours, some are dakotas!: */ 185 186 char **responses_descriptors = NULL; //these are our! there are only numresponsedescriptors of them, not d_numresponses!!! 187 int numresponsedescriptors; 188 int solution_type; 189 bool control_analysis = false; 190 void (*solutioncore)(FemModel*) = NULL; 191 FemModel *femmodel = NULL; 192 bool nodakotacore = true; 193 194 /*If counter==-1 on cpu0, it means that the dakota runs are done. In which case, bail out and return 0: */ 195 ISSM_MPI_Bcast(&counter,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 196 if(counter==-1)return 0; 197 198 /*cast void_femmodel to FemModel, and at the same time, make a copy, so we start this new core run for this specific sample 199 *with a brand new copy of the model, which has not been tempered with by previous dakota runs: */ 200 femmodel=(reinterpret_cast<FemModel*>(void_femmodel))->copy(); 201 202 /*retrieve parameters: */ 203 femmodel->parameters->FindParam(&responses_descriptors,&numresponsedescriptors,QmuResponsedescriptorsEnum); 204 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 205 femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum); 206 207 if(VerboseQmu()) _printf0_("qmu iteration: " << counter << "\n"); 208 209 /* only cpu 0, running dakota is providing us with variables and variables_descriptors and numresponses: broadcast onto other cpus: */ 210 DakotaMPI_Bcast(&d_variables,&d_variables_descriptors,&d_numvariables,&d_numresponses); 211 212 /*Modify core inputs in objects contained in femmodel, to reflect the dakota variables inputs: */ 213 InputUpdateFromDakotax(femmodel,d_variables,d_variables_descriptors,d_numvariables); 214 215 /*Determine solution sequence: */ 216 if(VerboseQmu()) _printf0_("Starting " << EnumToStringx(solution_type) << " core:\n"); 217 WrapperCorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type,nodakotacore); 218 219 /*Run the core solution sequence: */ 220 solutioncore(femmodel); 221 222 /*compute responses: */ 223 if(VerboseQmu()) _printf0_("compute dakota responses:\n"); 224 femmodel->DakotaResponsesx(d_responses,responses_descriptors,numresponsedescriptors,d_numresponses); 225 226 /*Free ressources:*/ 227 DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors); 228 229 /*Avoid leaks here: */ 230 delete femmodel; 231 232 return 1; //this is critical! do not return 0, otherwise, dakota_core will stop running! 233 } 234 /*}}}*/ 225 235 void dakota_core(FemModel* femmodel){ /*{{{*/ 226 236 … … 273 283 274 284 // Serial case: plug in derived Interface object without an analysisComm 275 interface.assign_rep(new SIM:: DakotaPlugin(problem_db,(void*)femmodel), false);285 interface.assign_rep(new SIM::IssmDirectApplicInterface(problem_db,(void*)femmodel), false); 276 286 } 277 287 … … 299 309 #else 300 310 void dakota_core(FemModel* femmodel){ 301 /*do nothing*/311 _error_("dakota_core for versions of Dakota >=6 should not be used anymore! Use instead the issm_dakota executable!"); 302 312 } 303 313 #endif -
issm/trunk-jpl/src/c/main/issm_dakota.cpp
r19632 r19634 6 6 7 7 /*Dakota includes: */ 8 #if defined(_HAVE_DAKOTA_) && _DAKOTA_MAJOR_ >= 6 8 9 #include "ParallelLibrary.hpp" 9 10 #include "ProblemDescDB.hpp" … … 11 12 #include "DakotaModel.hpp" 12 13 #include "DakotaInterface.hpp" 14 #endif 13 15 14 16 int main(int argc,char **argv){ 17 18 19 #if defined(_HAVE_DAKOTA_) && _DAKOTA_MAJOR_ >= 6 15 20 16 21 bool parallel=true; … … 80 85 /*Return unix success: */ 81 86 return 0; 87 #else 88 Cout << "ISSM Dakota executable was compiled without support of Dakota! Will just return now!" << "\n"; 89 return 1; 90 #endif 82 91 }
Note:
See TracChangeset
for help on using the changeset viewer.