Changeset 13540
- Timestamp:
- 10/04/12 17:58:20 (12 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 1 added
- 1 deleted
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/externalpackages/python/install-2.7.3-macosx-lion.sh
r13370 r13540 8 8 9 9 #Download from ISSM server 10 $ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz10 #$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz 11 11 12 12 #Untar and move python into install directory … … 17 17 #Configure and compile 18 18 cd src 19 ./configure \ 20 --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 19 ./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 21 20 if [ $# -eq 0 ]; then 22 21 make -
issm/trunk-jpl/src/c/Makefile.am
r13539 r13540 327 327 ./modules/RequestedDependentsx/RequestedDependentsx.h\ 328 328 ./modules/RequestedDependentsx/RequestedDependentsx.cpp\ 329 ./modules/AutodiffDriversx/AutodiffDriversx.h\330 ./modules/AutodiffDriversx/AutodiffDriversx.cpp\331 329 ./modules/ResetConstraintsx/ResetConstraintsx.h\ 332 330 ./modules/ResetConstraintsx/ResetConstraintsx.cpp\ … … 350 348 ./solutions/AnalysisConfiguration.cpp\ 351 349 ./solutions/CorePointerFromSolutionEnum.cpp\ 350 ./solutions/PureCorePointerFromSolutionEnum.cpp\ 352 351 ./solutions/EnvironmentInit.cpp\ 353 352 ./solutions/EnvironmentFinalize.cpp\ 353 ./solutions/ad_core.cpp\ 354 354 ./solvers/solver_linear.cpp\ 355 355 ./solvers/solver_nonlinear.cpp\ -
issm/trunk-jpl/src/c/classes/objects/Profiler.cpp
r13539 r13540 17 17 Profiler::Profiler(){ 18 18 this->time=new Parameters(); 19 this->flops=new Parameters(); 20 this->memory=new Parameters(); 19 21 } 20 22 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Profiler.h
r13539 r13540 21 21 StartCore, 22 22 FinishCore, 23 StartAdCore, 24 FinishAdCore, 23 25 Finish 24 26 }; -
issm/trunk-jpl/src/c/modules/modules.h
r13283 r13540 8 8 /*Modules: */ 9 9 #include "./AddExternalResultx/AddExternalResultx.h" 10 #include "./AutodiffDriversx/AutodiffDriversx.h"11 10 #include "./AverageFilterx/AverageFilterx.h" 12 11 #include "./AverageOntoPartitionx/AverageOntoPartitionx.h" -
issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp
r13056 r13540 18 18 #include "../solvers/solvers.h" 19 19 20 void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype ){20 void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype,bool nodakotacore){ 21 21 22 22 /*output: */ 23 23 void (*solutioncore)(FemModel*)=NULL; 24 24 25 switch(solutiontype){ 25 /*parameters: */ 26 bool control_analysis=false; 27 bool tao_analysis=false; 28 bool dakota_analysis=false; 26 29 27 case DiagnosticSolutionEnum: 28 #ifdef _HAVE_DIAGNOSTIC_ 29 solutioncore=&diagnostic_core; 30 #else 31 _error_("ISSM was not compiled with diagnostic capabilities. Exiting"); 32 #endif 33 break; 34 case SteadystateSolutionEnum: 35 #ifdef _HAVE_STEADYSTATE_ 36 solutioncore=&steadystate_core; 37 #else 38 _error_("ISSM was not compiled with steady state capabilities. Exiting"); 39 #endif 40 break; 41 case ThermalSolutionEnum: 42 #ifdef _HAVE_THERMAL_ 43 solutioncore=&thermal_core; 44 #else 45 _error_("ISSM was not compiled with thermal capabilities. Exiting"); 46 #endif 47 break; 48 case EnthalpySolutionEnum: 49 #ifdef _HAVE_THERMAL_ 50 solutioncore=&enthalpy_core; 51 #else 52 _error_("ISSM was not compiled with thermal capabilities. Exiting"); 53 #endif 54 break; 55 case BalancethicknessSolutionEnum: 56 #ifdef _HAVE_BALANCED_ 57 solutioncore=&balancethickness_core; 58 #else 59 _error_("ISSM was not compiled with balanced capabilities. Exiting"); 60 #endif 61 break; 62 case HydrologySolutionEnum: 63 #ifdef _HAVE_HYDROLOGY_ 64 solutioncore=&hydrology_core; 65 #else 66 _error_("ISSM was not compiled with hydrology capabilities. Exiting"); 67 #endif 68 break; 69 case SurfaceSlopeSolutionEnum: 70 #ifdef _HAVE_SLOPE_ 71 solutioncore=&surfaceslope_core; 72 #else 73 _error_("ISSM was not compiled with slope capabilities. Exiting"); 74 #endif 75 break; 76 case BedSlopeSolutionEnum: 77 #ifdef _HAVE_SLOPE_ 78 solutioncore=&bedslope_core; 79 #else 80 _error_("ISSM was not compiled with slope capabilities. Exiting"); 81 #endif 82 break; 83 case TransientSolutionEnum: 84 #ifdef _HAVE_TRANSIENT_ 85 solutioncore=&transient_core; 86 #else 87 _error_("ISSM was not compiled with transient capabilities. Exiting"); 88 #endif 89 break; 90 case PrognosticSolutionEnum: 91 #ifdef _HAVE_PROGNOSTIC_ 92 solutioncore=&prognostic_core; 93 #else 94 _error_("ISSM was not compiled with prognostic capabilities. Exiting"); 95 #endif 96 break; 97 default: 98 _error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!"); 99 break; 30 /* retrieve some parameters that tell us whether wrappers are allowed, or whether we return 31 * a pure core. Wrappers can be dakota_core (which samples many solution_cores) or control_core (which 32 * carries out adjoint based inversion on a certain core: */ 33 parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum); 34 parameters->FindParam(&control_analysis,InversionIscontrolEnum); 35 parameters->FindParam(&tao_analysis,InversionTaoEnum); 36 37 if(nodakotacore)dakota_analysis=false; 38 39 if(dakota_analysis){ 40 #ifdef _HAVE_DAKOTA_ 41 solutioncore=dakota_core; 42 #else 43 _error_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!"); 44 #endif 100 45 } 101 46 else if(control_analysis){ 47 #ifdef _HAVE_CONTROL_ 48 if(tao_analysis) solutioncore=controltao_core; 49 else solutioncore=control_core; 50 #else 51 _error_("ISSM was not compiled with control support, cannot carry out control analysis!"); 52 #endif 53 } 54 else PureCorePointerFromSolutionEnum(&solutioncore,parameters,solutiontype); /*This means we retrieve a core solution that is not a wrapper*/ 55 102 56 /*Assign output pointer:*/ 103 57 _assert_(psolutioncore); -
issm/trunk-jpl/src/c/solutions/DakotaSpawnCore.cpp
r13539 r13540 55 55 void (*solutioncore)(FemModel*) = NULL; 56 56 FemModel* femmodel = NULL; 57 bool nodakotacore = true; 57 58 58 59 … … 81 82 /*Determine solution sequence: */ 82 83 if(VerboseQmu()) _pprintLine_("Starting " << EnumToStringx(solution_type) << " core:"); 83 CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type); 84 #ifdef _HAVE_CONTROL_ 85 if(control_analysis)solutioncore=&control_core; 86 #else 87 _error_("ISSM was not compiled with control capabilities, exiting!"); 88 #endif 84 CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type,nodakotacore); 89 85 90 86 /*Run the core solution sequence: */ … … 97 93 /*Free ressources:*/ 98 94 DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors); 95 96 return 1; //this is critical! do not return 0, otherwise, dakota_core will stop running! 99 97 } 100 98 -
issm/trunk-jpl/src/c/solutions/ad_core.cpp
r13530 r13540 1 /*!\file AutodiffDriversx1 /*!\file ad_core 2 2 * \brief: compute outputs from the AD mode, using our dependents and independents, and drivers available in Adolc. 3 3 */ 4 5 /*Includes: {{{*/ 6 #ifdef HAVE_CONFIG_H 7 #include <config.h> 8 #else 9 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 10 #endif 11 12 4 13 #include <set> 5 #include "../../modules/modules.h" 6 #include "../../shared/shared.h" 7 #include "../../include/include.h" 8 #include "../../toolkits/toolkits.h" 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 11 12 void AutodiffDriversx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,Results* results){ 13 14 14 #include "../toolkits/toolkits.h" 15 #include "../classes/objects/objects.h" 16 #include "../shared/shared.h" 17 #include "../io/io.h" 18 #include "../EnumDefinitions/EnumDefinitions.h" 19 #include "./solutions.h" 20 #include "../modules/modules.h" 21 #include "../include/include.h" 22 #include "../solvers/solvers.h" 23 /*}}}*/ 24 25 void ad_core(FemModel* femmodel){ 26 15 27 /*diverse: */ 16 28 int i; … … 27 39 28 40 /*AD mode on?: */ 29 parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);41 femmodel->parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum); 30 42 31 43 if(isautodiff){ … … 33 45 #ifdef _HAVE_ADOLC_ 34 46 35 if(VerboseAutodiff())_pprintLine_(" start AD driver"); 47 if(VerboseAutodiff())_pprintLine_(" start ad core"); 48 49 /*First, stop tracing: */ 50 trace_off(); 36 51 37 52 /*preliminary checks: */ 38 parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);39 parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);53 femmodel->parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum); 54 femmodel->parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum); 40 55 if(!(num_dependents*num_independents)) return; 41 56 42 57 /*retrieve state variable: */ 43 parameters->FindParam(&axp,&dummy,AutodiffXpEnum);58 femmodel->parameters->FindParam(&axp,&dummy,AutodiffXpEnum); 44 59 45 60 /* driver argument */ … … 50 65 51 66 /*get the EDF pointer:*/ 52 ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >( parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;67 ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(femmodel->parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p; 53 68 54 69 /*Branch according to AD driver: */ 55 parameters->FindParam(&driver,AutodiffDriverEnum);70 femmodel->parameters->FindParam(&driver,AutodiffDriverEnum); 56 71 57 72 /* these are always needed regardless of the interpreter */ … … 67 82 68 83 /*retrieve direction index: */ 69 parameters->FindParam(&anIndepIndex,AutodiffFosForwardIndexEnum);84 femmodel->parameters->FindParam(&anIndepIndex,AutodiffFosForwardIndexEnum); 70 85 71 86 if (anIndepIndex<0 || anIndepIndex>=num_independents) _error_("index value for AutodiffFosForwardIndexEnum should be in [0,num_independents-1]"); … … 80 95 anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx; 81 96 82 97 /*allocate the space for the parameters to invoke the EDF fos_forward:*/ 83 98 anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n); 84 99 anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m); … … 88 103 89 104 /*add to results*/ 90 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,jacTimesTangentDir,num_dependents,1,1,0.0));105 femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,AutodiffJacobianEnum,jacTimesTangentDir,num_dependents,1,1,0.0)); 91 106 92 107 /*free resources :*/ … … 113 128 } 114 129 else{ 115 parameters->FindParam(&indepIndices,&tangentDirNum,&dummy,AutodiffFovForwardIndicesEnum);130 femmodel->parameters->FindParam(&indepIndices,&tangentDirNum,&dummy,AutodiffFovForwardIndicesEnum); 116 131 } 117 132 … … 159 174 160 175 /*add to results: */ 161 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*jacTimesSeed,num_dependents*tangentDirNum,1,1,0.0));176 femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,AutodiffJacobianEnum,*jacTimesSeed,num_dependents*tangentDirNum,1,1,0.0)); 162 177 163 178 /*Free resources: */ … … 172 187 173 188 /*retrieve direction index: */ 174 parameters->FindParam(&aDepIndex,AutodiffFosReverseIndexEnum);189 femmodel->parameters->FindParam(&aDepIndex,AutodiffFosReverseIndexEnum); 175 190 176 191 if (aDepIndex<0 || aDepIndex>=num_dependents) _error_("index value for AutodiffFosReverseIndexEnum should be in [0,num_dependents-1]"); … … 192 207 193 208 /*add to results*/ 194 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,weightVectorTimesJac,num_independents,1,1,0.0));209 femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,AutodiffJacobianEnum,weightVectorTimesJac,num_independents,1,1,0.0)); 195 210 196 211 /*free resources :*/ … … 215 230 } 216 231 else{ 217 parameters->FindParam(&depIndices,&weightNum,&dummy,AutodiffFovForwardIndicesEnum);232 femmodel->parameters->FindParam(&depIndices,&weightNum,&dummy,AutodiffFovForwardIndicesEnum); 218 233 } 219 234 … … 253 268 254 269 /*add to results: */ 255 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*weightsTimesJac,weightNum*num_independents,1,1,0.0));270 femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,AutodiffJacobianEnum,*weightsTimesJac,weightNum*num_independents,1,1,0.0)); 256 271 257 272 /*Free resources: */ … … 278 293 xDelete(axp); 279 294 280 if(VerboseAutodiff())_pprintLine_(" end AD driver");295 if(VerboseAutodiff())_pprintLine_(" end AD core"); 281 296 282 297 #else -
issm/trunk-jpl/src/c/solutions/control_core.cpp
r13325 r13540 62 62 63 63 /*out of solution_type, figure out solution core and adjoint function pointer*/ 64 CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);64 PureCorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type); 65 65 AdjointCorePointerFromSolutionEnum(&adjointcore,solution_type); 66 66 -
issm/trunk-jpl/src/c/solutions/controltao_core.cpp
r13325 r13540 94 94 femmodel->parameters->SetParam(true,SaveResultsEnum); 95 95 void (*solutioncore)(FemModel*)=NULL; 96 CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);96 PureCorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type); 97 97 solutioncore(femmodel); 98 98 -
issm/trunk-jpl/src/c/solutions/dakota_core.cpp
r13539 r13540 65 65 Parameters* parameters = NULL; 66 66 67 /*Retrieve parameters: */68 parameters=femmodel->parameters;69 70 67 /*Recover dakota_input_file, dakota_output_file and dakota_error_file, in the parameters dataset in parallel */ 71 parameters->FindParam(&dakota_input_file,QmuInNameEnum);72 parameters->FindParam(&dakota_output_file,QmuOutNameEnum);73 parameters->FindParam(&dakota_error_file,QmuErrNameEnum);68 femmodel->parameters->FindParam(&dakota_input_file,QmuInNameEnum); 69 femmodel->parameters->FindParam(&dakota_output_file,QmuOutNameEnum); 70 femmodel->parameters->FindParam(&dakota_error_file,QmuErrNameEnum); 74 71 75 72 if(my_rank==0){ -
issm/trunk-jpl/src/c/solutions/issm.cpp
r13539 r13540 15 15 FILE *petscoptionsfid = NULL; 16 16 bool waitonlock = false; 17 bool dakota_analysis,control_analysis,tao_analysis;18 17 19 18 /*AD: */ … … 79 78 /*get parameters: */ 80 79 femmodel->parameters->FindParam(&waitonlock,SettingsWaitonlockEnum); 81 femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);82 femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);83 femmodel->parameters->FindParam(&tao_analysis,InversionTaoEnum);84 80 femmodel->parameters->FindParam(&autodiff,AutodiffIsautodiffEnum); 85 81 … … 104 100 105 101 _pprintLine_("call computational core:"); 106 107 108 profiler->Tag(StartCore); 109 if(dakota_analysis){ 110 #ifdef _HAVE_DAKOTA_ 111 dakota_core(femmodel); 112 #else 113 _error_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!"); 114 #endif 115 } 116 else if(control_analysis){ 117 #ifdef _HAVE_CONTROL_ 118 if(tao_analysis) controltao_core(femmodel); 119 else control_core(femmodel); 120 #else 121 _error_("ISSM was not compiled with control support, cannot carry out control analysis!"); 122 #endif 123 } 124 else{ 125 solutioncore(femmodel); 126 } 127 128 #ifdef _HAVE_ADOLC_ 129 if(autodiff){ 130 trace_off(); 131 AutodiffDriversx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results); 132 } 133 #endif 134 profiler->Tag(FinishCore); 135 102 profiler->Tag(StartCore); solutioncore(femmodel); profiler->Tag(FinishCore); 103 profiler->Tag(StartAdCore); ad_core(femmodel); profiler->Tag(FinishAdCore); 104 136 105 ProfilerEnd(profiler,femmodel->results,femmodel->parameters); 137 106 … … 220 189 221 190 /*Add to results: */ 222 results->AddObject(new GenericExternalResult< double>(results->Size()+1, ProfilingSolutionTimeEnum, solution_time, 1, 0));223 results->AddObject(new GenericExternalResult< double>(results->Size()+1, ProfilingCurrentMemEnum, solution_memory, 1, 0));224 results->AddObject(new GenericExternalResult< double>(results->Size()+1, ProfilingCurrentFlopsEnum, solution_flops, 1, 0));191 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum, solution_time, 1, 0)); 192 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentMemEnum, solution_memory, 1, 0)); 193 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentFlopsEnum, solution_flops, 1, 0)); 225 194 } 226 195 -
issm/trunk-jpl/src/c/solutions/solutions.h
r13539 r13540 31 31 void transient_core(FemModel* femmodel); 32 32 void dakota_core(FemModel* femmodel); 33 void ad_core(FemModel* femmodel); 33 34 IssmDouble objectivefunction(IssmDouble search_scalar,OptArgs* optargs); 34 35 … … 52 53 //solution configuration 53 54 void AnalysisConfiguration(int** panalyses,int* pnumanalyses, int solutiontype); 54 void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype); 55 void PureCorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype); 56 void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype,bool nodakotacore=false); 55 57 void AdjointCorePointerFromSolutionEnum(void (**padjointcore)(FemModel*),int solutiontype); 56 58
Note:
See TracChangeset
for help on using the changeset viewer.