Last change
on this file since 225475c was 225475c, checked in by Jan Meinke <j.meinke@…>, 14 years ago |
Move pysmmp in its own subdirectory.
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | # -*- coding: utf-8 -*-
|
---|
2 | import smmp_p as smmp
|
---|
3 | import mpi4py
|
---|
4 | import mpi4py.MPI
|
---|
5 | import time, random
|
---|
6 | from universe import *
|
---|
7 | from protein import *
|
---|
8 | from algorithms import *
|
---|
9 |
|
---|
10 | smmp.paral.my_mpi_comm = mpi4py.MPI.COMM_WORLD.py2f()
|
---|
11 | smmp.paral.myrank = mpi4py.MPI.COMM_WORLD.Get_rank()
|
---|
12 | numberOfTasks = mpi4py.MPI.COMM_WORLD.Get_size()
|
---|
13 | smmp.paral.no = numberOfTasks
|
---|
14 | #smmp.init_energy("SMMP/")
|
---|
15 | #smmp.init_molecule(1,'nh3+','coo-',seqfile='EXAMPLES/1bdd.seq',varfile='EXAMPLES/1bdd.var')
|
---|
16 | myU = Universe(st=1)
|
---|
17 | myP = Protein('EXAMPLES/1bdd.seq', 'EXAMPLES/1bdd.var')
|
---|
18 | myU.add(myP)
|
---|
19 | smmp.distributeworkload(numberOfTasks,1)
|
---|
20 | E = myU.energy()
|
---|
21 | if smmp.paral.myrank == 0:
|
---|
22 | print "The starting energy is %s." % E
|
---|
23 |
|
---|
24 | random.seed(82364)
|
---|
25 | #myMC = CanonicalMonteCarlo(myU, 20, 20)
|
---|
26 |
|
---|
27 | t0 = time.time()
|
---|
28 | for i in xrange(1000):
|
---|
29 | myU.energy()
|
---|
30 |
|
---|
31 | #myMC.run()
|
---|
32 | t1 = time.time()
|
---|
33 | E = myU.energy()
|
---|
34 | if smmp.paral.myrank == 0:
|
---|
35 | # Emin = myMC.minimumEnergy()
|
---|
36 | print "The final energy is: %f. Calculated in %fs" % (E, (t1 -t0))
|
---|
37 | # print "The minimum energy found was %.2f at sweep %s." % Emin
|
---|
38 |
|
---|
39 | print random.random()
|
---|
40 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.