source: pysmmp/pPySMMP.py

Last change on this file 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 -*-
2import smmp_p as smmp
3import mpi4py
4import mpi4py.MPI
5import time, random
6from universe import *
7from protein import *
8from algorithms import *
9
10smmp.paral.my_mpi_comm = mpi4py.MPI.COMM_WORLD.py2f()
11smmp.paral.myrank = mpi4py.MPI.COMM_WORLD.Get_rank()
12numberOfTasks = mpi4py.MPI.COMM_WORLD.Get_size()
13smmp.paral.no = numberOfTasks
14#smmp.init_energy("SMMP/")
15#smmp.init_molecule(1,'nh3+','coo-',seqfile='EXAMPLES/1bdd.seq',varfile='EXAMPLES/1bdd.var')
16myU = Universe(st=1)
17myP = Protein('EXAMPLES/1bdd.seq', 'EXAMPLES/1bdd.var')
18myU.add(myP)
19smmp.distributeworkload(numberOfTasks,1)
20E = myU.energy()
21if smmp.paral.myrank == 0:
22 print "The starting energy is %s." % E
23
24random.seed(82364)
25#myMC = CanonicalMonteCarlo(myU, 20, 20)
26
27t0 = time.time()
28for i in xrange(1000):
29 myU.energy()
30
31#myMC.run()
32t1 = time.time()
33E = myU.energy()
34if 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
39print random.random()
40
Note: See TracBrowser for help on using the repository browser.