Dr. Jason,
Thank you for your advice.
I checked the code again, and found that I did not download coordinates from GPU, that is needed in the judgement of the border of the container. I think this is the reason. After I changing the code into the following framework, it works now in the cuda version.
#ifdef CUDA
call gpu_download_crd(crd)
call gpu_download_vel(vel)
#endif
call velocity_modify(vel)
#ifdef CUDA
call gpu_upload_vel(vel)
#endif
Changjun
________________________________________
From: Jason Swails [jason.swails.gmail.com]
Sent: Wednesday, September 07, 2011 1:34 AM
To: AMBER Mailing List
Subject: Re: [AMBER] velocity modification in PMEMD, CUDA version
A specific thing to look out for is that you want to make sure that the area
of the pmemd code that you're adding your velocity modifications to does NOT
occur in a section of the code cut out of pmemd.cuda by preprocessor flags.
That is, make sure it's not hiding somewhere inside a
#ifndef CUDA
#endif
structure or something like a
#ifdef CUDA
...do stuff
#else
call myvelocity(vel)
#endif
HTH,
Jason
On Tue, Sep 6, 2011 at 11:15 PM, Chen, Changjun <cjchen.math.msu.edu> wrote:
> Dear Ross,
> Thank you so much! You advice is very helpful for me.
>
> Sincerely,
> Changjun
> ________________________________________
> From: Ross Walker [ross.rosswalker.co.uk]
> Sent: Tuesday, September 06, 2011 11:10 PM
> To: 'AMBER Mailing List'
> Subject: Re: [AMBER] velocity modification in PMEMD, CUDA version
>
> Hi Changjun,
>
> This 'should' work although I'd need to look carefully at the code to make
> sure it being done in the correct location. The best place to look is
> probably around the location where the ntt=1 / 2 thermostats are triggered.
> I assume you are referring to just the serial pmemd.cuda code here and not
> the MPI version.
>
> I would suggest downloading the velocities and then writing them to disk
> immediately after the download and then comparing what you get with the cpu
> version or from a write somewhere else in the GPU code. This will give you
> an idea of what is contained.
>
> Note, this approach as written will be 'very' slow on the GPU. Probably
> slower than just running on the CPU since you are resynching on every
> single
> step. Until you write a cuda kernel for your subroutine to avoid the sync
> you will likely not see any performance benefits.
>
> All the best
> Ross
>
>
> > -----Original Message-----
> > From: Chen, Changjun [mailto:cjchen.math.msu.edu]
> > Sent: Monday, September 05, 2011 7:29 PM
> > To: amber.ambermd.org
> > Subject: [AMBER] velocity modification in PMEMD, CUDA version
> >
> > Dear all,
> > Hi, I am Changjun, recently, I am trying to add some code in
> > runmd.fpp, which is part of PMEMD. It is used to modify the velocity of
> > atoms to restrict them in one cylinder. The framework of the code is as
> > following:
> >
> > #ifdef CUDA
> > call gpu_download_vel(vel)
> > #endif
> >
> > call velocity_modify(vel)
> >
> > #ifdef CUDA
> > call gpu_upload_vel(vel)
> > #endif
> >
> > All the work that modify the atom velocities are done in my
> > subroutine " velocity_modify(vel) ". here vel(3,atm_cnt) saves the
> > velocities. I insert the code just after the line " end if !
> > (reset_velocities)" . The compiling process is successful.
> > In the actual simulation, this code work perfectly in pmemd.MPI,
> > but not work in pmemd.cuda. Could you please give me some instructions
> > on it? Is there something I missing during the communication of
> > velocities between CPU and GPU?
> >
> > Thanks you!
> >
> > Sincerely,
> > Changjun
> >
> >
> > _______________________________________________
> > AMBER mailing list
> > AMBER.ambermd.org
> > http://lists.ambermd.org/mailman/listinfo/amber
>
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
--
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Sep 09 2011 - 03:30:02 PDT