new force field option
[django_unres.git] / django_simple / todo / jobfiles.py
index 048e030..ce0cf44 100644 (file)
@@ -41,12 +41,21 @@ def write_on_task_save(sender, instance, **kwargs):
 #wrapper = textwrap.TextWrapper(width=70)
 #word_list = wrapper.wrap(text=md.substitute(nstep=str(nstep)))
 
-     w="""WSC=1.00000 WSCP=1.23315 WELEC=0.84476 WBOND=1.00000 WANG=0.62954              &
+     if  instance.unres_ff =='E0LL2Y':
+      w="""WSC=1.00000 WSCP=1.23315 WELEC=0.84476 WBOND=1.00000 WANG=0.62954              &
 WSCLOC=0.10554 WTOR=1.34316 WTORD=1.26571 WCORRH=0.19212 WCORR5=0.00000        &
 WCORR6=0.00000 WEL_LOC=0.37357 WTURN3=1.40323 WTURN4=0.64673 WTURN6=0.00000    &
 WVDWPP=0.23173 WHPB=1.00000 WSCCOR=0.25                                        &
 CUTOFF=7.00000 WCORR4=0.00000
 """
+     else:
+      w="""WSC=0.82686 WSCP=0.96947 WELEC=0.79373 WBOND=1.00000 WANG=0.46542              &
+WSCLOC=0.07969 WTOR=0.81684 WTORD=0.67806 WCORRH=0.00000 WCORR5=0.00000        &
+WCORR6=0.00000 WEL_LOC=0.71100 WTURN3=2.30298 WTURN4=0.86517 WTURN6=0.00000    &
+WSCCOR=0.14577 WVDWPP=0.17781 WHPB=1.00000 WSCP14=0.00000                      &
+CUTOFF=7.00000 WCORR4=0.00000
+"""
+     
 
      with open(instance.jobdirname+'/file.inp','w') as f:
        f.write(instance.name + ' UNRES server job'+ '\n')
@@ -206,12 +215,18 @@ CUTOFF=7.00000 WCORR4=0.00000
         
      if instance.type == 'min':
       os.chdir(instance.jobdirname)
-      shutil.copy('../files/pbs.csh','.')
+      if  instance.unres_ff =='E0LL2Y':
+        shutil.copy('../files/pbs.csh','.')
+      else:
+        shutil.copy('../files/pbs_new.csh','pbs.csh')
       ret_code = subprocess.Popen(' /opt/torque/bin/qsub pbs.csh', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
       os.chdir('..')
      elif instance.type == 'md':
       os.chdir(instance.jobdirname)
-      f1 = open('../files/pbs_md.csh', 'r')
+      if  instance.unres_ff =='E0LL2Y':
+        f1 = open('../files/pbs_md.csh', 'r')
+      else:
+        f1 = open('../files/pbs_md_new.csh', 'r') 
       f2 = open('pbs.csh', 'w')
       for line in f1:
            f2.write(line.replace('$dimen3',str(dimen3) ))
@@ -226,9 +241,9 @@ CUTOFF=7.00000 WCORR4=0.00000
       ret_code = subprocess.Popen(' /opt/torque/bin/qsub pbs.csh', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)      
       os.chdir('..')
      else:
+# instance.type == 'remd'
       tmp1=json.loads(instance.remd_multi_m)
       nreplicas=sum(map(int, tmp1))
-      
 # hardcoded for 4 core nodes with FGPROC=2
       nodes=int(nreplicas*2/4)
       reszta = nreplicas*2-nodes*4
@@ -238,14 +253,17 @@ CUTOFF=7.00000 WCORR4=0.00000
         pbs = '#PBS -l nodes='+str(nodes)+':ppn=4+1:ppn='+str(reszta)
 
       os.chdir(instance.jobdirname)
-      f1 = open('../files/pbs8.csh', 'r')
+      if  instance.unres_ff =='E0LL2Y':
+        f1 = open('../files/pbs8.csh', 'r')
+      else:
+        f1 = open('../files/pbs8_new.csh', 'r')
       f2 = open('pbs8.csh', 'w')
       for line in f1:
           if '#PBS -l nodes=4:ppn=4' in line:
            f2.write(line.replace('#PBS -l nodes=4:ppn=4', pbs))
           else:
            tmp1=json.loads(instance.remd_multi_t)
-           f2.write(line.replace('$temperatures','"'+" ".join(tmp1)+'"'))
+           f2.write(line.replace('$temperatures','"'+" ".join(tmp1)+'" '+str(nreplicas)))
       f1.close()
       f2.close()
       os.chdir('..')