printout as on etoh
authorCezary Czaplewski <czarek@chem.univ.gda.pl>
Sat, 26 Aug 2017 11:02:56 +0000 (13:02 +0200)
committerCezary Czaplewski <czarek@chem.univ.gda.pl>
Sat, 26 Aug 2017 11:02:56 +0000 (13:02 +0200)
django_simple/todo/templates/base.html
django_simple/todo/templates/index.html
django_simple/todo/views.py
files/pbs.csh
files/pbs8.csh
files/pbs_md.csh

index 9509dae..b84f074 100644 (file)
        <div class="page-header">
          <h1><a href="/">UNRES server</a> <small> (beta version)</small></h1>
 
+              Lab. of Simul. of Polym. & Lab. of Mol. Model, Faculty of Chemistry, University of Gdansk, 2017
+              <br><span class="fa fa-envelope-o"></span> 
+              cezary.czaplewski<span class="fa fa-at"></span>ug.edu.pl
+
                <div class="user-name">
                        {% if not user.is_anonymous %}
                                <strong>Logged as:&nbsp;</strong> {{user}} &nbsp;
index 2af565b..22a4db2 100644 (file)
@@ -65,5 +65,7 @@
 {% csrf_token %}
 <input type="submit" class="btn" value="Refresh" name="refreshbtn">
 </form>
+<h6 style="text-align:right;float:right;">
+{{ variable }} </h6>
 
 {% endblock %}
\ No newline at end of file
index 62a5034..f1fb202 100644 (file)
@@ -5,6 +5,7 @@ from .forms import *
 from .models import Task
 import datetime
 import os
+import subprocess
 
 res_codes = [
                 # 20 canonical amino acids
@@ -14,6 +15,8 @@ res_codes = [
                 ('LEU', 'L'), ('ARG', 'R'), ('TRP', 'W'), ('ALA', 'A'),
                 ('VAL', 'V'), ('GLU', 'E'), ('TYR', 'Y'), ('MET', 'M'),
                 ('HSD', 'H'),('HSE', 'H'),('HSP', 'H'),
+                ('HIE', 'H'), ('HID', 'H'),('HIP', 'H'),
+                ('CYX', 'C'),
                ]
 
 three_to_one = dict(res_codes)
@@ -45,7 +48,7 @@ def from_pdb(file):
                                                                                     
             if line[0:3] == 'END':
               break
-    if sequence[-1] == 'XX':
+    while sequence[-1] == 'XX':
             del sequence[-1]
     if sequence[0] != 'G':
             sequence.insert(0,'X')
@@ -60,6 +63,7 @@ def from_pdb(file):
 def index(request):
     user = request.user
     tasks = Task.objects.filter(owner=user)
+    variable = ''
     return render(request, "index.html", {
             'tasks': tasks
         })
@@ -432,8 +436,25 @@ def refresh_done(request):
                 last = line.split()[0]
               else:
                 last = 0
-           task.running=1+int(last)*100.0/task.md_nstep
+           task.running=int(1+int(last)*100.0/task.md_nstep)
            if task.running>100:
              task.running=100
          task.save()
-    return redirect('/')        
+
+    proc = subprocess.Popen('/opt/torque/bin/qstat', stdout=subprocess.PIPE)
+    njob=0
+    nq=0
+    for line in proc.stdout:
+      if 'piasek4' in line:
+        if line.split()[1]=='test_server':
+          njob+=1
+          if line.split()[-2]=='Q':
+            nq+=1
+    variable='Idle jobs='+str(nq)+' Total jobs='+str(njob)
+
+    return render(request, "index.html", {
+                'tasks': tasks ,
+                'variable' : variable
+                        })
+    
+#   return redirect('/')        
index b23e8a7..fc5e1e2 100755 (executable)
@@ -1,4 +1,4 @@
-#PBS -N test
+#PBS -N test_server
 #PBS -q express
 #PBS -l nodes=1:ppn=4
 
index b672bb1..32055ca 100755 (executable)
@@ -1,4 +1,4 @@
-#PBS -N test
+#PBS -N test_server
 #PBS -q nowy
 #PBS -l nodes=4:ppn=4
 
index 19b6780..00e3840 100755 (executable)
@@ -1,4 +1,4 @@
-#PBS -N test
+#PBS -N test_server
 #PBS -q express
 #PBS -l nodes=1:ppn=4