Changeset 19653
- Timestamp:
- 10/19/15 12:54:11 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/main/issm_dakota.cpp
r19634 r19653 21 21 bool parallel=true; 22 22 char* dakota_input_file=NULL; 23 char* dakota_output_file = NULL; 23 24 24 25 /*Define MPI_DEBUG in dakota_global_defs.cpp to cause a hold here*/ 25 26 Dakota::mpi_debug_hold(); 26 27 27 28 /*Initialize MPI: */ 28 29 ISSM_MPI_Init(&argc, &argv); // initialize MPI 29 30 30 31 /*Recover file name for dakota input file:*/ 31 32 dakota_input_file=xNew<char>((strlen(argv[2])+strlen(argv[3])+strlen(".qmu.in")+1)); 32 sprintf(dakota_input_file,"%s%s%s",argv[2],argv[3],".qmu.in"); 33 sprintf(dakota_input_file,"%s/%s%s",argv[2],argv[3],".qmu.in"); 34 35 dakota_output_file=xNew<char>((strlen(argv[2])+strlen(argv[3])+strlen(".qmu.out")+1)); 36 sprintf(dakota_output_file,"%s/%s%s",argv[2],argv[3],".qmu.out"); 33 37 34 Cout << "dakota_input_file: " << dakota_input_file << "\n";35 36 38 /* Parse input and construct Dakota LibraryEnvironment, performing input data checks*/ 37 39 Dakota::ProgramOptions opts; 38 40 opts.input_file(dakota_input_file); 41 opts.output_file(dakota_output_file); 39 42 40 41 43 /* Defaults constructs the MPIManager, which assumes COMM_WORLD*/ 42 44 Dakota::LibraryEnvironment env(opts); 43 45 44 if (env.mpi_manager().world_rank() == 0)45 Cout << "Library mode 1: run_dakota_parse()\n";46 47 46 /* get the list of all models matching the specified model, interface, driver:*/ 48 47 Dakota::ModelList filt_models = env.filtered_model_list("single", "direct", "matlab"); … … 73 72 // don't increment ref count since no other envelope shares this letter 74 73 model_interface.assign_rep(new 75 SIM::IssmParallelDirectApplicInterface(problem_db, analysis_comm, NULL), false);74 SIM::IssmParallelDirectApplicInterface(problem_db, analysis_comm, argc, argv), false); 76 75 } 77 76 problem_db.set_db_model_nodes(model_index); // restore … … 79 78 /* Execute the environment:*/ 80 79 env.execute(); 81 82 /*Finalize MPI:*/83 ISSM_MPI_Finalize();84 80 85 81 /*Return unix success: */
Note:
See TracChangeset
for help on using the changeset viewer.