source: src/controller.cpp@ ee61ce

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 Candidate_v1.7.0 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since ee61ce was ee61ce, checked in by Frederik Heber <heber@…>, 13 years ago

Extracted ControllerCommand and ControllerCommandRegistry from controller and placed into own modules.

  • ControllerCommand encapsulates a controller command name and its deque of bound functions.
  • ..Registry stores these instances.
  • Property mode set to 100644
File size: 17.1 KB
RevLine 
[7ca772e]1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2011 University of Bonn. All rights reserved.
5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
8/*
9 * \file controller.cpp
10 *
11 * This file strongly follows the Serialization example from the boost::asio
12 * library (see client.cpp)
13 *
14 * Created on: Nov 27, 2011
15 * Author: heber
16 */
17
18
19// include config.h
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24// boost asio needs specific operator new
25#include <boost/asio.hpp>
26
27#include "CodePatterns/MemDebug.hpp"
28
[685e28]29#include <boost/assign.hpp>
[af9b9ff]30#include <boost/program_options.hpp>
[685e28]31#include <deque>
[ff60cfa]32#include <fstream>
[7ca772e]33#include <iostream>
34#include <map>
[ff60cfa]35#include <sstream>
36#include <streambuf>
37#include <vector>
[7ca772e]38
[cc5db5]39#include "Fragmentation/Automation/atexit.hpp"
[7ca772e]40#include "CodePatterns/Info.hpp"
41#include "CodePatterns/Log.hpp"
[d7bb9b1]42#include "Fragmentation/EnergyMatrix.hpp"
43#include "Fragmentation/ForceMatrix.hpp"
44#include "Fragmentation/KeySetsContainer.hpp"
[d4885d]45#include "FragmentController.hpp"
[5a8512]46#include "Helpers/defs.hpp"
[ff60cfa]47#include "Jobs/MPQCCommandJob.hpp"
[d7bb9b1]48#include "Jobs/MPQCCommandJob_MPQCData.hpp"
[cc5db5]49#include "Fragmentation/Automation/Jobs/SystemCommandJob.hpp"
50#include "Fragmentation/Automation/Results/FragmentResult.hpp"
[5fa1f0d]51#include "ControllerOptions_MPQCCommandJob.hpp"
[ee61ce]52#include "ControllerOptions_SystemCommandJob.hpp"
53#include "ControllerCommandRegistry.hpp"
[7ca772e]54
[685e28]55/** Print the status of scheduled and done jobs.
56 *
57 * @param status pair of number of schedule and done jobs
58 */
59void printJobStatus(const std::pair<size_t, size_t> &JobStatus)
60{
61 LOG(1, "INFO: #" << JobStatus.first << " are waiting in the queue and #"
62 << JobStatus.second << " jobs are calculated so far.");
63}
[ff60cfa]64
[d1dbfc]65/** Creates a MPQCCommandJob with argument \a filename.
66 *
67 * @param jobs created job is added to this vector
[917be8]68 * @param command mpqc command to execute
[d1dbfc]69 * @param filename filename being argument to job
70 * @param nextid id for this job
71 */
72void parsejob(
73 std::vector<FragmentJob::ptr> &jobs,
[917be8]74 const std::string &command,
[d1dbfc]75 const std::string &filename,
76 const JobId_t nextid)
[ff60cfa]77{
78 std::ifstream file;
79 file.open(filename.c_str());
80 ASSERT( file.good(), "parsejob() - file "+filename+" does not exist.");
81 std::string output((std::istreambuf_iterator<char>(file)),
82 std::istreambuf_iterator<char>());
[917be8]83 FragmentJob::ptr testJob( new MPQCCommandJob(output, nextid, command) );
[ff60cfa]84 jobs.push_back(testJob);
85 file.close();
86 LOG(1, "INFO: Added MPQCCommandJob from file "+filename+".");
87}
88
[d1dbfc]89/** Print received results.
90 *
[4dd16e]91 * @param results received results to print
[d1dbfc]92 */
[685e28]93void printReceivedResults(const std::vector<FragmentResult::ptr> &results)
[7ca772e]94{
[35f587]95 for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
[7ca772e]96 iter != results.end(); ++iter)
[35f587]97 LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result));
[7ca772e]98}
99
[d7bb9b1]100/** Print MPQCData from received results.
[986885]101 *
[5a8512]102 * @param results received results to extract MPQCData from
103 * @param KeySetFilename filename with keysets to associate forces correctly
104 * @param NoAtoms total number of atoms
[986885]105 */
[d7bb9b1]106bool printReceivedMPQCResults(
[5a8512]107 const std::vector<FragmentResult::ptr> &results,
108 const std::string &KeySetFilename,
109 size_t NoAtoms)
[986885]110{
[d7bb9b1]111 EnergyMatrix Energy;
112 EnergyMatrix EnergyFragments;
113 ForceMatrix Force;
114 ForceMatrix ForceFragments;
115 KeySetsContainer KeySet;
116
[5a8512]117 // align fragments
118 std::map< JobId_t, size_t > MatrixNrLookup;
119 size_t FragmentCounter = 0;
120 {
121 // bring ids in order ...
122 typedef std::map< JobId_t, FragmentResult::ptr> IdResultMap_t;
123 IdResultMap_t IdResultMap;
124 for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
125 iter != results.end(); ++iter) {
126 #ifndef NDEBUG
127 std::pair< IdResultMap_t::iterator, bool> inserter =
128 #endif
129 IdResultMap.insert( make_pair((*iter)->getId(), *iter) );
130 ASSERT( inserter.second,
131 "printReceivedMPQCResults() - two results have same id "
132 +toString((*iter)->getId())+".");
133 }
134 // ... and fill lookup
135 for(IdResultMap_t::const_iterator iter = IdResultMap.begin();
136 iter != IdResultMap.end(); ++iter)
137 MatrixNrLookup.insert( make_pair(iter->first, FragmentCounter++) );
138 }
139 LOG(1, "INFO: There are " << FragmentCounter << " fragments.");
140
141 // extract results
[986885]142 std::vector<MPQCData> fragmentData(results.size());
143 MPQCData combinedData;
144
145 LOG(2, "DEBUG: Parsing now through " << results.size() << " results.");
146 for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
147 iter != results.end(); ++iter) {
148 LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result));
149 MPQCData extractedData;
150 std::stringstream inputstream((*iter)->result);
[5a8512]151 LOG(2, "DEBUG: First 50 characters FragmentResult's string: "+(*iter)->result.substr(0, 50));
[986885]152 boost::archive::text_iarchive ia(inputstream);
153 ia >> extractedData;
154 LOG(1, "INFO: extracted data is " << extractedData << ".");
[5a8512]155
156 // place results into EnergyMatrix ...
157 {
158 MatrixContainer::MatrixArray matrix;
159 matrix.resize(1);
160 matrix[0].resize(1, extractedData.energy);
161 if (!Energy.AddMatrix(
162 std::string("MPQCJob ")+toString((*iter)->getId()),
163 matrix,
164 MatrixNrLookup[(*iter)->getId()])) {
165 ELOG(1, "Adding energy matrix failed.");
166 return false;
167 }
168 }
169 // ... and ForceMatrix (with two empty columns in front)
170 {
171 MatrixContainer::MatrixArray matrix;
172 const size_t rows = extractedData.forces.size();
173 matrix.resize(rows);
174 for (size_t i=0;i<rows;++i) {
175 const size_t columns = 2+extractedData.forces[i].size();
176 matrix[i].resize(columns, 0.);
177 // for (size_t j=0;j<2;++j)
178 // matrix[i][j] = 0.;
179 for (size_t j=2;j<columns;++j)
180 matrix[i][j] = extractedData.forces[i][j-2];
181 }
182 if (!Force.AddMatrix(
183 std::string("MPQCJob ")+toString((*iter)->getId()),
184 matrix,
185 MatrixNrLookup[(*iter)->getId()])) {
186 ELOG(1, "Adding force matrix failed.");
187 return false;
188 }
189 }
[986885]190 }
[5a8512]191 // add one more matrix (not required for energy)
192 MatrixContainer::MatrixArray matrix;
193 matrix.resize(1);
194 matrix[0].resize(1, 0.);
195 if (!Energy.AddMatrix(std::string("MPQCJob total"), matrix, FragmentCounter))
196 return false;
197 // but for energy because we need to know total number of atoms
198 matrix.resize(NoAtoms);
199 for (size_t i = 0; i< NoAtoms; ++i)
200 matrix[i].resize(2+NDIM, 0.);
201 if (!Force.AddMatrix(std::string("MPQCJob total"), matrix, FragmentCounter))
202 return false;
[d7bb9b1]203
[5a8512]204
205 // combine all found data
[d7bb9b1]206 if (!Energy.InitialiseIndices()) return false;
207
208 if (!Force.ParseIndices(KeySetFilename.c_str())) return false;
209
210 if (!KeySet.ParseKeySets(KeySetFilename.c_str(), Force.RowCounter, Force.MatrixCounter)) return false;
211
212 if (!KeySet.ParseManyBodyTerms()) return false;
213
214 if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return false;
215 if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return false;
216
217 if(!Energy.SetLastMatrix(0., 0)) return false;
218 if(!Force.SetLastMatrix(0., 2)) return false;
219
220 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
221 // --------- sum up energy --------------------
222 LOG(1, "INFO: Summing energy of order " << BondOrder+1 << " ...");
223 if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return false;
224 if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return false;
225
226 // --------- sum up Forces --------------------
227 LOG(1, "INFO: Summing forces of order " << BondOrder+1 << " ...");
228 if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return false;
229 if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return false;
230 }
231
[5a8512]232 // for debugging print resulting energy and forces
233 LOG(1, "INFO: Resulting energy is " << Energy.Matrix[ FragmentCounter ][0][0]);
234 std::stringstream output;
235 for (int i=0; i< Force.RowCounter[FragmentCounter]; ++i) {
236 for (int j=0; j< Force.ColumnCounter[FragmentCounter]; ++j)
237 output << Force.Matrix[ FragmentCounter ][i][j] << " ";
238 output << "\n";
239 }
240 LOG(1, "INFO: Resulting forces are " << std::endl << output.str());
241
[d7bb9b1]242 return true;
[986885]243}
244
[5a8512]245/** Helper function to get number of atoms somehow.
246 *
247 * Here, we just parse the number of lines in the adjacency file as
248 * it should correspond to the number of atoms, except when some atoms
249 * are not bonded, but then fragmentation makes no sense.
250 *
251 * @param path path to the adjacency file
252 */
253size_t getNoAtomsFromAdjacencyFile(const std::string &path)
254{
255 size_t NoAtoms = 0;
256
257 // parse in special file to get atom count (from line count)
258 std::string filename(path);
259 filename += FRAGMENTPREFIX;
260 filename += ADJACENCYFILE;
261 std::ifstream adjacency(filename.c_str());
262 if (adjacency.fail()) {
263 LOG(0, endl << "getNoAtomsFromAdjacencyFile() - Unable to open " << filename << ", is the directory correct?");
264 return false;
265 }
266 std::string buffer;
267 while (getline(adjacency, buffer))
268 NoAtoms++;
269 LOG(1, "INFO: There are " << NoAtoms << " atoms.");
270
271 return NoAtoms;
272}
273
[865a218]274/** Creates a SystemCommandJob out of give \a command with \a argument.
275 *
276 * @param controller reference to controller to add jobs
277 * @param ControllerInfo information on the job
278 */
279void createJobs(FragmentController &controller, const ControllerOptions_SystemCommandJob &ControllerInfo)
[685e28]280{
281 const JobId_t next_id = controller.getAvailableId();
[865a218]282 FragmentJob::ptr testJob(
283 new SystemCommandJob(ControllerInfo.executable, ControllerInfo.jobcommand, next_id) );
[685e28]284 std::vector<FragmentJob::ptr> jobs;
[865a218]285 jobs.push_back(testJob);
[685e28]286 controller.addJobs(jobs);
287 controller.sendJobs(ControllerInfo.server, ControllerInfo.serverport);
[865a218]288 LOG(1, "INFO: Added one SystemCommandJob.");
[685e28]289}
290
291/** Creates a MPQCCommandJob out of give \a command with \a argument.
292 *
293 * @param controller reference to controller to add jobs
294 * @param ControllerInfo information on the job
295 */
296void AddJobs(FragmentController &controller, const ControllerOptions_MPQCCommandJob &ControllerInfo)
297{
298 std::vector<FragmentJob::ptr> jobs;
299 for (std::vector< std::string >::const_iterator iter = ControllerInfo.jobfiles.begin();
300 iter != ControllerInfo.jobfiles.end(); ++iter) {
301 const JobId_t next_id = controller.getAvailableId();
302 const std::string &filename = *iter;
303 LOG(1, "INFO: Creating MPQCCommandJob with filename '"
304 +filename+"', and id "+toString(next_id)+".");
305 parsejob(jobs, ControllerInfo.executable, filename, next_id);
306 }
307 controller.addJobs(jobs);
308 controller.sendJobs(ControllerInfo.server, ControllerInfo.serverport);
309}
310
[7ca772e]311int main(int argc, char* argv[])
312{
313 // from this moment on, we need to be sure to deeinitialize in the correct order
314 // this is handled by the cleanup function
315 atexit(cleanUp);
316
317 size_t Exitflag = 0;
[685e28]318
319 ControllerOptions_MPQCCommandJob ControllerInfo;
320 boost::asio::io_service io_service;
321 FragmentController controller(io_service);
322 boost::program_options::variables_map vm;
323
[ee61ce]324 // prepare ControllerCommand
325 // note: we need "< ControllerCommand::commands_t >" because parseExecutable(),... return int
[685e28]326 // in contrast to other functions that return void
[ee61ce]327 ControllerCommandRegistry ControllerCommands;
328 ControllerCommands.registerInstance(new ControllerCommand("addjobs",
329 boost::assign::list_of< ControllerCommand::commands_t >
[685e28]330 (boost::bind(&FragmentController::requestIds,
331 boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport),
332 boost::bind(&std::vector<std::string>::size, boost::cref(ControllerInfo.jobfiles))))
333 (boost::bind(&AddJobs, boost::ref(controller), boost::cref(ControllerInfo)))
[ee61ce]334 ));
335 ControllerCommands.registerInstance(new ControllerCommand("createjobs",
336 boost::assign::list_of< ControllerCommand::commands_t >
337 (boost::bind(&FragmentController::requestIds,
338 boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport), 1))
339 (boost::bind(&createJobs, boost::ref(controller), boost::cref(ControllerInfo)))
340 ));
341 ControllerCommands.registerInstance(new ControllerCommand("checkresults",
342 boost::assign::list_of< ControllerCommand::commands_t >
343 (boost::bind(&FragmentController::checkResults,
344 boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
345 (boost::bind(&printJobStatus,
346 boost::bind(&FragmentController::getJobStatus, boost::ref(controller))))
347 ));
348 ControllerCommands.registerInstance(new ControllerCommand("receiveresults",
349 boost::assign::list_of< ControllerCommand::commands_t >
350 (boost::bind(&FragmentController::receiveResults,
351 boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
352 (boost::bind(&printReceivedResults,
353 boost::bind(&FragmentController::getReceivedResults, boost::ref(controller))))
354 ));
355 ControllerCommands.registerInstance(new ControllerCommand("receivempqc",
356 boost::assign::list_of< ControllerCommand::commands_t >
357 (boost::bind(&FragmentController::receiveResults,
358 boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
359 (boost::bind(&printReceivedMPQCResults,
360 boost::bind(&FragmentController::getReceivedResults, boost::ref(controller)),
361 boost::cref(ControllerInfo.fragmentpath),
362 boost::bind(&getNoAtomsFromAdjacencyFile, boost::cref(ControllerInfo.fragmentpath))))
363 ));
364 ControllerCommands.registerInstance(new ControllerCommand("removeall",
365 boost::assign::list_of< ControllerCommand::commands_t >
366 (boost::bind(&FragmentController::removeall,
367 boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
368 ));
369 ControllerCommands.registerInstance(new ControllerCommand("shutdown",
370 boost::assign::list_of< ControllerCommand::commands_t >
371 (boost::bind(&FragmentController::shutdown,
372 boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
373 ));
[af9b9ff]374 std::vector<std::string> Commands;
[ee61ce]375 for (ControllerCommandRegistry::const_iterator iter = ControllerCommands.getBeginIter();
376 iter != ControllerCommands.getEndIter(); ++iter)
[af9b9ff]377 Commands.push_back(iter->first);
378
379 // Declare the supported options.
380 boost::program_options::options_description desc("Allowed options");
381 desc.add_options()
382 ("help,h", "produce help message")
383 ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level")
384 ("server", boost::program_options::value< std::string >(), "connect to server at this address (host:port)")
385 ("command", boost::program_options::value< std::string >(), (std::string("command to send to server: ")+toString(Commands)).c_str())
386 ("executable", boost::program_options::value< std::string >(), "executable for commands 'addjobs' and 'createjobs'")
[685e28]387 ("fragment-path", boost::program_options::value< std::string >(), "path to fragment files for 'receivempqc'")
[af9b9ff]388 ("jobcommand", boost::program_options::value< std::string >(), "command argument for executable for 'createjobs'")
389 ("jobfiles", boost::program_options::value< std::vector< std::string > >()->multitoken(), "list of files as single argument to executable for 'addjobs'")
390 ;
391
[685e28]392 // parse command line
[af9b9ff]393 boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
394 boost::program_options::notify(vm);
395
[685e28]396 // set controller information
[5fa1f0d]397 int status = 0;
398 status = ControllerInfo.parseHelp(vm, desc);
399 if (status) return status;
400 status = ControllerInfo.parseVerbosity(vm);
401 if (status) return status;
402 status = ControllerInfo.parseServerPort(vm);
403 if (status) return status;
404 status = ControllerInfo.parseCommand(vm, Commands);
405 if (status) return status;
[9dcce3]406
[685e28]407 // all later parse functions depend on parsed command
[5fa1f0d]408 status = ControllerInfo.parseExecutable(vm);
409 if (status) return status;
410 status = ControllerInfo.parseJobCommand(vm);
411 if (status) return status;
412 status = ControllerInfo.parseFragmentpath(vm);
413 if (status) return status;
414 status = ControllerInfo.parseJobfiles(vm);
415 if (status) return status;
[685e28]416
417 // parse given ControllerCommand
[ee61ce]418 if(!ControllerCommands.isPresentByName(ControllerInfo.command)) {
[685e28]419 ELOG(1, "Unrecognized command '"+toString(ControllerInfo.command)+"'.");
420 return 255;
421 }
[ee61ce]422 const ControllerCommand *commands = ControllerCommands.getByName(ControllerInfo.command);
[7ca772e]423 try
424 {
[685e28]425 // execute each command in the queue synchronously
426 size_t phase = 1;
[ee61ce]427 for (ControllerCommand::const_iterator iter = commands->begin();
428 iter != commands->end(); ++iter, ++phase) {
429 (*iter)();
[7ca772e]430 {
[685e28]431 io_service.reset();
432 Info info((std::string("io_service: ")+toString(phase)).c_str());
433 io_service.run();
[7ca772e]434 }
435 }
436 Exitflag = controller.getExitflag();
437 }
438 catch (std::exception& e)
439 {
440 std::cerr << e.what() << std::endl;
441 }
442
443 return Exitflag;
444}
[4dd16e]445
Note: See TracBrowser for help on using the repository browser.