Replies: 2 comments 2 replies
-
You should provide some code for what you have tried so far and we can help from there. |
Beta Was this translation helpful? Give feedback.
-
thanks for getting back to me: So far this is what I am using. import os def worker(gpu_id):
List of GPUs you want to usegpus = [0, 1] Create a process for each GPUprocesses = [] Wait for all processes to completefor p in processes: print("lets do this") from copy import copy, deepcopy import openmm as omm from openmm.app import * from copy import copy #####now wepy import import mdtraj from geomm.rmsd import calc_rmsd from scipy.spatial.distance import euclidean #################### OUTPUT_FIELDS = ( JUSTPOS = { ALMOST_ALL_TRUE = { ############### Input Filesimport os filestring = cwd prmtop = app.AmberPrmtopFile(filestring+'.prmtop') mdtraj_topology = mdtraj.Topology.from_openmm(prmtop.topology) nonbondedMethod = PME temperature = 300kelvin system = prmtop.createSystem(nonbondedMethod=nonbondedMethod, nonbondedCutoff=nonbondedCutoff, ################# mini simulation just to equilibrate positionspresim = app.Simulation(prmtop.topology, system, integrator, platform=omm.Platform_getPlatformByName("CUDA")) #anneal prestate = presim.context.getState(**ALMOST_ALL_TRUE) init_state = OpenMMState(prestate) runner = OpenMMRunner(system, prmtop.topology, integrator,enforce_box=True, platform='CUDA') ################# resampler = NoResampler() ############################ Initialize the TaskMapper with the desired number of workers (GPUs)num_workers = 2 # Adjust this number based on your available GPUs ############################ now run itn_cycles = 50 n_walkers = 5 init_weight = 1.0/n_walkers h5_reporter = WepyHDF5Reporter( sim_manager = Manager(init_walkers, final_walkers, _ = sim_manager.run_simulation(n_cycles, steps) ################# |
Beta Was this translation helpful? Give feedback.
-
Hi,
I was given some advice to use
the TaskMapper and WorkerMapper to run multiple GPUs but unfortunately I still have not managed to get this to work.
Does any one have a snippet of code using the TaskMapper or WorkerMapper?
thanks
Beta Was this translation helpful? Give feedback.
All reactions