source: ThirdParty/mpqc_open/src/lib/util/group/prttest.cc@ 866dec

AutomationFragmentation_failures Candidate_v1.6.1 ChemicalSpaceEvaluator Enhanced_StructuralOptimization_continued Exclude_Hydrogens_annealWithBondGraph ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_contraction-expansion Gui_displays_atomic_force_velocity PythonUI_with_named_parameters StoppableMakroAction TremoloParser_IncreasedPrecision
Last change on this file since 866dec was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 1.3 KB
Line 
1
2#include <scconfig.h>
3#include <util/group/pregtime.h>
4#include <util/misc/exenv.h>
5#if defined(HAVE_MPI)
6# include <util/group/messmpi.h>
7#endif
8
9
10void
11dotest(const sc::Ref<sc::MessageGrp> &grp,
12 bool node_independent)
13{
14 sc::Ref<sc::RegionTimer> rt
15 = new sc::ParallelRegionTimer(grp->clone(),"prttest",1,1);
16
17 sc::Timer t1(rt,"t1_a");
18
19 if (node_independent || grp->me() == 0) {
20 sc::Timer t2(rt,"t2_a");
21 sc::Timer t3(rt,"t3_a");
22 t3.reset("t3_b");
23 t3.reset("t3_c");
24 t3.reset("t3_d");
25 t3.reset();
26 t2.reset("t2_b");
27 if (node_independent || grp->me() == 0) {
28 sc::Timer t4(rt,"t4_a");
29 t4.reset("t4_b");
30 t4.reset();
31 }
32 t2.reset("t2_c");
33 t2.reset();
34 }
35
36 t1.reset();
37
38 rt->print(sc::ExEnv::outn());
39}
40
41int
42main(int argc, char**argv)
43{
44 sc::Ref<sc::MessageGrp> grp;
45#if defined(HAVE_MPI) && defined(ALWAYS_USE_MPI)
46 grp = new sc::MPIMessageGrp(&argc, &argv);
47#endif
48 if (grp.null()) grp = sc::MessageGrp::initial_messagegrp(argc, argv);
49 if (grp.nonnull())
50 sc::MessageGrp::set_default_messagegrp(grp);
51 else
52 grp = sc::MessageGrp::get_default_messagegrp();
53
54 std::cout << grp->me() << ": using " << grp->class_name() << std::endl;
55
56 dotest(grp, true);
57 dotest(grp, false);
58
59 grp = 0;
60 sc::MessageGrp::set_default_messagegrp(grp);
61
62 return 0;
63}
Note: See TracBrowser for help on using the repository browser.