# YASARA MACRO # TOPIC: 3. Molecular Dynamics # TITLE: Running the DHFR benchmark to measure MD performance # REQUIRES: Dynamics # AUTHOR: Elmar Krieger # LICENSE: GPL # DESCRIPTION: This macro runs the DHFR benchmark for about 10 seconds and displays the results RequireVersion 15.1.1 # Choose between dihydrofolate reductase (dhfr) and satellite tobacco mosaic virus (stmv) system='dhfr' #system='stmv' # See how many threads and GPUs we have _,threadsmax,_,gpus = Processors # Start with all available CPU threads and no GPU (=0), adjust as needed threads=threadsmax gpu=0 #gpus=0 Clear Console off HUD off if !ConsoleMode # Allow use to interactively choose the system # Load Satellite Tobacco Mosaic Virus (STMV) LoadSce (YASARADir)/sce/stmv_water DelRes Water MG CL DelObj SimCell Style Ribbon ShowAtom NucAcid Sidechain SwapObj 1,2 # Load Dihydro Folate Reductase (DHFR) LoadPDB 3qls,Download=Yes DelRes Mol A or HetGroup or Gly 805 and Obj 1,Center=Yes PosObj 1,X=-28, Y=3, Z=108 PosObj 2,X=85, Y=15, Z=390 # Rotate the proteins AutoRotateObj all,Y=0.5 # Show the options LabelAll 'Please choose your benchmark',Height=0.5,Color=Yellow,X=0,Y=4,Z=5 colorlist='Green','Yellow' for i=1 to 2 # Create the atom to mark obj1 = BuildAtom Carbon BallObj (obj1) ColorObj (obj1),(colorlist(i)) # Create the donut around it obj2 = ShowTorus LargeRadius=2,LargeEdges=32,SmallRadius=0.5,SmallEdges=10,Color=(colorlist(i)) NameObj (obj2),'Option(i)' PosObj (join obj),((-1.5+i)*11),-3,12 ShowMessage "Click the green atom to benchmark dihydrofolate reductase, and yellow for satellite tobacco mosaic virus (for fast systems)." UserInput off # Wait until the user chooses an option do Wait 5 opt = MarkAtom while optbestnspday bestnspday=nspday bestgpu=gpu # Add to results results=count resultlist text='Your computer with (threads) of (threadsmax) CPU threads and ' if gpu text=text+'GPU (gpu) of (gpus)' else text=text+'no GPU' # Round as needed if system=='dhfr' resultlist(results+1)=0+nspday else resultlist(results+1)=0.00+nspday resultlist(results+2)=text # Choose next method if gpu # Try next available GPU gpu=gpu+1 else # Try with fewer threads, sometimes this helps if nspday32 threads=threads-4 elif threads>16 or threads>threadsmax threads=threads-2 else threads=threads-1 if threads==0 threads=1 gpu=1 # Set final result Processors CPUThreads=(threads),GPU=(bestgpu) # Show a diagnostic message message='' if threadsoldresults/2)+1)) PosText 72,(posy+barheight+4),Justify=Left Print (resultlist(i*2)) PosText 72,916 print '(system) Benchmark, PME, 8.0 A VdW cutoff,\n' print 'correct atom masses, reproducible trajectory.\n' MoveMesh Chart,Z=(-plotlen) SwitchObj Chart,on if system=='dhfr' Sim On else Print 'DHFR benchmark results:' Print '-----------------------' for i=1 to count resultlist step 2 Print '(resultlist(i)) ns/day: (resultlist(i+1))' # Exit YASARA if this macro was provided as command line argument if runWithMacro Energy all Exit