Re: [AMBER-Developers] Help with Makefiles for pmemd.cuda

From: Ross Walker <ross.rosswalker.co.uk>
Date: Thu, 4 Feb 2016 17:20:13 -0800

Thanks Jason,

I am going to rename the target to cuda_serial to avoid any of this confusion so hopefully that will fix things. Note Looking at this in more detail I see:

in $AMBERHOME/Makefile
install:
        cd AmberTools/src && $(MAKE) install
        .(if [ -n "$(BUILDAMBER)" ] ; then \
            cd src && $(MAKE) install; \
          else \
                echo "==============================================================" ;\
                echo "$(AMBERHOME)/src/Makefile not found, or -noamber was set." ;\
                echo "This is expected if you do not have Amber14." ;\
                echo "==============================================================" ;\
        fi ;\
        )

Which calls Make install in Ambertools src:


$AMBERHOME/AmberTools/src/Makefile

cuda_serial:
        .echo "$(AMBERTOOLS) has no CUDA-enabled components"

        -(cd ../../src && $(MAKE) cuda )

cuda_parallel:
        .echo "$(AMBERTOOLS) has no CUDA-enabled components"

        -(cd ../../src && $(MAKE) cuda_parallel )

mic: configured_mic
        .echo "$(AMBERTOOLS) has no mic-enabled components"

        -(cd ../../src && $(MAKE) mic )

mic_parallel: configured_mic configured_parallel
        .echo "$(AMBERTOOLS) has no mic-enabled components"

        -(cd ../../src && $(MAKE) mic_parallel )

mic_offload: configured_mic_offload
        .echo "$(AMBERTOOLS) has no mic-enabled components"

        -(cd ../../src && $(MAKE) mic_offload )

Which looks to me like it echoes that no CUDA-enable components are in AmberTools and then goes and calls Make cuda in $AMBERHOME/src/ - this then goes and builds cuda but then the install target then also goes and calls $AMBERHOME/src/ make install after the AMBERTools build completes. So it looks like this is why everything gets built twice - and indeed I think this has been like this and we have been doing it for a while. :-(

So surely those

        -(cd ../../src && $(MAKE) cuda )
etc

lines should not be there in the AmberTools/src/Makefile no?

All the best
Ross

> On Feb 4, 2016, at 4:48 PM, Jason Swails <jason.swails.gmail.com> wrote:
>
> On Thu, Feb 4, 2016 at 7:07 PM, Ross Walker <ross.rosswalker.co.uk> wrote:
>
>> Okay, I tried this whole thing simpler. What I now have is:
>>
>> $AMBERHOME/Makefile - standard install target, calls src/Makefile
>>
>> install:
>> cd AmberTools/src && $(MAKE) install
>> .(if [ -n "$(BUILDAMBER)" ] ; then \
>> cd src && $(MAKE) install; \
>> else \
>> echo
>> "==============================================================" ;\
>> echo "$(AMBERHOME)/src/Makefile not found, or -noamber was
>> set." ;\
>> echo "This is expected if you do not have Amber14." ;\
>> echo
>> "==============================================================" ;\
>> fi ;\
>> )
>>
>> $AMBERHOME/src/Makefile
>>
>> install: $(INSTALLTYPE)
>>
>> cuda: configured_cuda
>> .echo "Starting installation of ${AMBER} (cuda) at `date`".
>> cd pmemd && $(MAKE) cuda
>>
>> #So the install target, calls the cuda target which calls Make cuda under
>> pmemd Makefile
>>
>> $AMBERHOME/src/pmemd/Makefile
>>
>> cuda: configured_cuda
>> $(MAKE) -C src/ cuda
>> .echo "Installation of pmemd.cuda complete"
>>
>>
>> #so this just calls make cuda under pmemd/src - although this is the
>> target that echos Installation of pmemd.cuda complete.
>>
>> $AMBERHOME/src/pmemd/src/Makefile
>>
>> .NOTPARALLEL: configured_cuda cuda_SPFP cuda_DPFP cuda_SPXP cuda_lib_clean
>> pmemd.cuda_SPFP$(SFX) pmemd.cuda_DPFP$(SFX) pmemd.cuda_SPXP$(SFX)
>>
>
> ​configured_cuda does not need to be here.
> ​
>
>
>>
>> cuda: configured_cuda cuda_SPFP cuda_DPFP
>>
>
> T
> ​ry either doing "cuda::" (two :s) or renaming this rule. The second :
> will label the cuda target as phony (you can also do this with a .PHONY
> line just like you used .NOTPARALLEL, I think). Don't forget that cuda is
> a directory, and make will check the directory (possibly recursively?) for
> any changes. I'm not sure what to expect in this case, but since the cuda
> rule is not intended to correspond to the cuda directory in the way make
> thinks it should, you should change cuda to a phony target.
> ​
> ​
> --
> Jason M. Swails
> BioMaPS,
> Rutgers University
> Postdoctoral Researcher
> _______________________________________________
> AMBER-Developers mailing list
> AMBER-Developers.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber-developers


_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Thu Feb 04 2016 - 17:30:04 PST
Custom Search