Dynamo module for CentOS 7

 Dynamo is a software environment for subtomogram averaging of cryo-EM data. That is quoted from its wiki.  The standard dynamo installation procedure you can find here. Actually, it is working out of the box: you download the tarball, untar it on a specific folder, source the right script, and it works! Supposing I install it on /usr/local/, something like

source /path/dynamo_activate_linux_shipped_MCR.sh

will allow you to get the dynamo GUI if you type dynamo X afterwards. Note that as quoted, starting the Dynamo console can take some time. This is the standard output you see if everything is right:

dynamo X
Initializing MATLAB Runtime version 9.1
"MCR libraries starting dynamo.
Starting the Dynamo console can take some time. 
A good choice of MCR_CACHE_ROOT might speed this up."
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Warning: MCR_CACHE_ROOT is empty.
 Initialize this variable in your shell for a quicker startup.
 To know more, type:
 dwiki MCR_CACHE_ROOT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Warning: MCR_CACHE_ROOT points to non-existing location: 
 Correct this variable in your shell for a quicker startup.
 To know more, type:
 dwiki MCR_CACHE_ROOT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Launching a Dynamo graphics terminal in a separate window....
.... done

So how do we “modulate” this thing? First, as suggested, I recompile the graphical libraries. Here you find how to do it for Dynamo. Our output looks like this:

 ## > source config.sh 
----------------------------------------------------------------
 
 Configuring makefile for the CUDA installation in your system
 
Looking for a CUDA installation in this environment:
 Found CUDA nvcc compiler at /usr/local/cuda-7.5/bin/nvcc
 CUDA installation assumed to be in /usr/local/cuda-7.5
we will use /lib64 (standard procedure)
 
Substituting the CUDA location assignment:
 CUDA_ROOT=/usr/local/cuda-7.5
with the actual value:
 CUDA_ROOT=/usr/local/cuda-7.5
 
 [ok] 
 
 you can now compile the CUDA utilities by :
 make all 
 or :
 make motors
 if "make all" produces an error when 
trying to compile the Nvidia utility infoGPU
 
--------------------------------------------------
## > make clean
rm bin/* || echo "No previous CUDA 
executables found in /cuda/bin" 
## > make all
/usr/local/cuda-7.5/bin/nvcc -o 
bin/dynamo_compute_iteration_spp src/
dynamo_compute_iteration_spp.cu 
-lcudart -lcufft -lcublas 
-L/usr/local/cuda-7.5/lib64 
-I/usr/local/cuda-7.5/include -Isrc -w
echo 'Compilation of Dynamo completed. 
Use make extended to include Nvidia GPU'
Compilation of Dynamo completed. 
Use make extended to include Nvidia GPU

I will skip the “make extended” on this installation. It’s time to write the module. My first idea is to source the script on the module definition. Unfortunately, this has mixed effects: some variables seem to be correct, but others not. I blame the mix of languages of the issue, and I try to set up all the variables we have when we source the script “dynamo activate” for the TCL module. The result looks like:

#%Module1.0###################################
##
## modules dynamo/dynamo-1.1.226
##
## modulefiles/dynamor/dynamo-1.1.226 dynamo 1.1.226 module
##
proc ModulesHelp { } {
 global version modroot
puts stderr "dynamor/dynamo-1.1.226 
- sets the Environment for using dynamo 1.1.226"
}

module-whatis "Sets the environment for using dynamo 1.1.226 "

# for Tcl script use only
set topdir /usr/local/dynamo-1.1.226
set version 1.1.22
set sys linux86

prepend-path PATH $topdir/

# additional env variables 
setenv DYNAMO_FOLDER /usr/local/dynamo-1.1.226
setenv DYNAMO_ROOT /usr/local/dynamo-1.1.226
# Location in the distribution expected to have an MCR
setenv MCR_ROOT $topdir/MCRLinux

prepend-path PATH /usr/lib64/qt-3.3/bin:/usr/local/bin:
/usr/bin:/usr/local/
sbin:/usr/sbin:$topdir/matlab/bin/:
$topdir/matlab/src:$topdir/cuda/bin:
$topdir/mpi:$topdir/examples:$topdir/doc

prepend-path LD_LIBRARY_PATH $topdir/MCRLinux/runtime/glnxa64/:
$topdir/MCRLinux/bin/glnxa64:$topdir/
MCRLinux/sys/os/glnxa64:

I decided not to display any message when loading the module. It took me some time to tune the libraries, but after doing so, everything looks fine. This is what I get when I run a test project:

./testproject.exe 
Initializing MATLAB Runtime version 9.1
"MCR libraries starting dynamo_execute_project. 
Opening MCR to launch project."
-----------------------------------------------------
 
Project: testproject
 contains 3 rounds, totalling 3 iterations 
 will run on destination "standalone_gpu" on 1 cores
 
------------------------------------------------------
 
Your project invokes multicore operations (2 cores required).
Dynamo will now test your hardware to check that 
it can run the project.
Alignment step: 1 cores, Averaging step: 2 cores
Starting parallel pool (parpool) using the 'local' profile 
... connected to 6 workers.
[mbparse.multicore.checkPool] Closing previous pool. 
You asked for 2, pool contains MORE (6)
Parallel pool using the 'local' profile is shutting down.
[mbparse.multicore.checkPool] 
... previous pool of 6 workers closed.
Starting parallel pool (parpool) using the 'local' profile 
... connected to 2 workers.
[mbparse.multicore.checkPool] Opened pool for 2 workers
 
- - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - 
[gpu check] Checking the GPUs
[gpu check] Requested devices: [0]
- - - - - - - - - - - - - - - - 
-------------------------------------------------------
Iteration 1 corresponding to round 1
Starting iteration at 15-Dec-2016 12:58:57
[setup] Parameter set is in 
./testproject/cards/ite_0001/card_ite_ite_0001.card
************************************************
********** NEW ITERATION ***************
********** iteration: 1 
************************************************

... bla bla bla...
[Check]: dynamo_iteration_check
('./testproject/cards/ite_0003/card_ite_ite_0003.card')
 Starting time: 15-Dec-2016 12:59:20
iteration 3 ok

So it runs. Time to distribute the module, and hear the complains from the users 😉

Advertisements

About bitsanddragons

A traveller, an IT professional and a casual writer
This entry was posted in bits, centos. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s