FAQ: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
Line 50: Line 50:
  tar cvf mytararchivename.tar files /and/paths directories  
  tar cvf mytararchivename.tar files /and/paths directories  


For more info, please see our [[Tar Tutorial]]
<!--For more info, please see our [[Tar Tutorial]]-->


=How do I install the Python numerical libraries?=
=How do I install the Python numerical libraries?=

Revision as of 15:28, 8 July 2017

How do I get a Hoffman2 Account?

Please see our walk through for this process Getting a Hoffman2 Account

How do I get access to all the FMRI software?

To get access to CCN-supported software (AFNI, FSL, FreeSurfer, etc.) see our modules page.


What are quotas and how do I view them on Hoffman?

Hoffman has two different kinds of quota's. The first quota limits the maximum amount of data. The second is the maximum *number* of files.

Both of these are listed in the output of the quota command, using the group switch if you're in a lab that's purchased space:

quota -g

The output looks something like:

Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
titan:/hoffman2_home9/foo
  1523786368       0       2147483648         6000000*      0  6000000        
titan:/hoffman2_home9/bar
  985470304         0       2147483648          125933       0    2000000   
  • The first column is the maximum amount of data you are allowed to store. (e.g. 1523786368)
  • The third column is the actual amount of data you are storing. (2147483648)
  • The fourth column is the actual number of files you have currently (6000000)
  • The sixth column is the maximum number of files allowed (6000000)

We can see in the above example that the foo group is at the file count maximum. A helpful * has been placed beside the number to accent this.

The size numbers are in kilobytes. If you wish to see what the number is in gigabytes or megabytes, the easiest method is to use the google converter. For example, to convert 1523786368 kilobytes into gigabytes you'd use the search term:

1523786368 kilobytes in gigabytes

The return result is 1 453.19592 gigabytes, or 1.45 Terabytes.


I've exceeded my quota, what do I do?

There are basically three things that can be done aside from purchasing more space:

  • Run the clean_me.py script. It is in your path if you've set up your profile for the fmri group as described in Setting Up Your BASH Profile. By default it runs on the current directory. The full path is: /u/home9/FMRI/apps/usr/bin/clean_me.py
  • For file count quotas, archive any data not currently being worked on or not actively used. Tar Tutorial
  • Remove data from the server completely.

How do I archive my data?

tar cvf mytararchivename.tar files /and/paths directories 


How do I install the Python numerical libraries?

Python provides a suite of utilities that allow for numerical processing including matlab like plotting abilities. Installing couldn't be easier. Just follow five easy steps:

  1. Install MacPorts following their walk through
  2. Install matplotlib
$ sudo port install py26-matplotlib +wxpython
  1. Install ipython with scientific support
$ sudo port install py26-ipython +scientific
  1. Start up the ipthon scientific shell
$ ipython2.6 -pylab

This will automatically load all the libraries you need to get started in a matlab like interactive shell.

You may also want to take a look at our New to the Lab section on Python for some references to get you started.

I forgot my password to miles/hoffman2/lab computers. What do I do?

Depending on which password you've forgotten, a different solution is required.

Lab Password

Please send a support request to [[1]] that provides the following information

  • Full Name
  • Username if you remember
  • State your problem, e.g., I forgot my password)

Hoffman2 Password

  1. Go to the ATS Computational Clusters page
  2. Click the link labeled Request Cluster Password Change
  3. Sign in using your BOL account id/password
  4. Fill out the provided form making sure you include the name of the cluster you wish to reset the password for.

How do I make a soft link?

From wikipedia:

In computing, a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another 
file or directory in the form of an absolute or relative path and that affects pathname resolution.

To make a soft link to file Foo, execute the following:

$ ln -sf /path/too/Foo /path/to/the/link/name

How do I search and replace a string in a file?

This can be done in many different languages. Here's a few.

  • Ruby
$ ruby -p -i.bak -e 'gsub("replace me", "with me")
  • Sed
$ sed -i.bak -e 's/\/Volumes\/local\/bin/\/u\/home9\/mscohen/' design.fsf
  • Perl
$ perl -p -i.bak -e 's/oldstring/newstring/g'

Sun Grid Engine

How do I submit a program to the cluster?

You submit jobs to the SGE cluster using the qsub command. It's typical to write a small wrapper script for this purpose so you can customize a few options. That's what we'll do here. The first thing of note is that qsub has a special comment for parsing options from a job script, any line that starts with '#$' is seen as a qsub option. This'll be clearer through example. Let's say we want to make a job script that submits this command to the cluster:

sienax MPRage.nii.gz

Open a file called "my_job.sh" or whatever you'd like to name it, enter the following, then save it.

#!/bin/bash
#$ -V
#$ -cwd
#$ -j y
#$ -N my_log
sienax MPRage.nii.gz

Here's a run down of the options:

  • -V  : export all the current environment variables to the grid engine (this is almost always the right thing to do)
  • -cwd  : cd into the current working directory, e.g., the directory you executed the script from
  • -j y  : combine the error and standard out into one log file. this is a personal preference of mine, I find it tidier
  • -N my_log  : name the output log "my_log" this can, of course, be anything you want

After that you just put the command you want and execute the follwing command:

$ qsub my_job.sh

This works great as a "one shot" solution. But what if I want make a general script for doing this?

Ne'er fear, open a file called 'submit_sienax.sh', enter the following, and save it:

#!/bin/bash
qsub <<CMD
#!/bin/bash
#$ -V
#$ -cwd
#$ -j y
#$ -N my_log
sienax $1
CMD

To use this script to submit a file named mprage.nii.gz to the cluster do

$ ./submit_sienax.sh mprage.nii.gz

All done!

For a complete reference on all the options available to qsub (there are so many! oh my!), please see the qsub man page.

$ man qsub 

Or the Sun Grid Engine Online Man Pages.

If man pages are scary, see the Man Pages section of the New to the Lab page.

How do I delete a job that's hung or in an Error state?

To delete all the jobs submitted by user 'foo', execute the following command.

$ qdel -u foo

If you list all jobs for a specific user, the far left column of the output is for the Job-ID. To kill that specific job,

$ qdel $jobid

Where $jobid is a number. Below is an example of the qstat output for clarification

job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID 
------------------------------------------------------------------------
 66180 0.56000 feat5_reg  foo       r     03/12/2009 14:54:54 all.q@fmri03                 1        
 66178 0.56000 feat3_film foo       r     03/12/2009 14:54:54 all.q@fmri04                 1        
 66174 0.56000 feat5_reg  foo       r     03/12/2009 14:55:39 all.q@fmri06                 1        
 66172 0.56000 feat3_film foo       r     03/12/2009 14:55:39 all.q@fmri09                 1        
 66173 0.00000 feat4_post foo       hqw   03/12/2009 14:43:02                                    1        
 66175 0.00000 feat4_post foo       hqw   03/12/2009 14:43:03                                    1        
 66176 0.00000 feat5_stop foo       hqw   03/12/2009 14:43:03                                    1        
 66179 0.00000 feat4_post foo       hqw   03/12/2009 14:43:53                                    1        
 66181 0.00000 feat4_post foo       hqw   03/12/2009 14:43:53                                    1        
 66182 0.00000 feat5_stop foo       hqw   03/12/2009 14:43:54                                    1   

In this case, the $jobid is 66172 - 66182

To check all jobs submitted by users in your group, you may wish to use the

$ mygroupjobs

command

fMRI & FSL

How do I switch between versions of FSL?

We've built a system for switching easily between FSL versions using the switch_fsl utility. Please see the associated help for details, including examples:

$ switch_fsl --help

Why won't my images work in FSL??

There are many reasons that this could occur, but this FAQ tries to cover the most common and their fixes.

  • Multiple image files
    • This is by far one of the most common reasons for problems with fsl and images. FSL uses the root name to determine which file to load. The root name is the name of the file without the extension. For example, both subj_series.nii.gz and subj_series.img/subj_series.hdr have "root names" of subj_series. A gotcha with this is that if you have multiple files of different formats, but with the same root name in the same folder FSL won't be able to tell which one to load.
    • FIX: Either provide a unique name for different file formats (e.g. subj_series_nifti.nii.gz or sub_series_ana.img/hdr) or keep different file formats in different directories (e.g. my_study/my_subj/raw_data/nifti/{nii images} and my_study/my_subj/raw_data/analyze/{analyze images}

How do I properly transfer my data between two machines on the network?

The special Case

-Some versions of fsl contain recursive linking. The result is a continuous loop of copying data when using scp -r to move fsl projects to remote machines.

This behavior is verified for versions of FSL prior to 4.x. It appears that analysis ran using version 4.0 or greater does not seem to have this issue.

There are two solutions.

  • Tar archive the project before scp'ing
    • This method is only available if there's enough room on the drive to do so. In cases where limited space is available, the second method is required
    • Please see the very thorough Tar_Tutorial for details on how to tar just about any way imaginable.
  • Pipe the tar command over ssh.
    • This is ideal if there isn't much space available as it does the archiving and un-archiving "on the fly".

First, if you're copying from an OSX machine you need to disable extended attributes. Don't worry about what they are, just trust me and disable them.

  • For Tiger machines
$ export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
  • For Leoapard machines (this includes miles)
$ export COPYFILE_DISABLE=true

Now for the actual command. To copy a directory Projects from miles to a directory on hoffman called data_transfer_test the following command is needed.

$ tar -cvf - Projects | ssh hoff_user@hofman2.idre.ucla.edu tar -c /u/home9/groupdir/hoff_user/data_transfer_test -xf -

The end result of this command is a directory called "Projects" located on hoffman in the /u/home9/groupdir/hoff_user/data_transfer_test/ directory that is an exact copy of the one located on miles.

The General Case

If you're certain your data set does not have these problems, for example if you're transferring only you can do a simple scp transfer. Here's an example of an scp transfer of a directory without all the tar magic.

$ scp -r /path/to/my_directory hoff_user@hoffman.edu:/u/home6/hoff_user

Matlab

How do I modify my matlab path?

Users can modify their individual matlab paths via the ~/matlab/startup.m file. For example, if one wished to add /u/home9/local/apps/spm/5 to their path they would open ~/matlab/startup.m in their favorite text editor and add the following:

addpath(genpath('/u/home9/local/apps/spm/5'))

If the ~/matlab directory or the startup.m file does not exist, simply create the file and/or directory.

For further information please see the built in matlab help for addpath and genpath.

> help addpath
> help genpath

Shared Resources

What shared resources are available to lab members?

'Important Notes

Managed vs. NonManaged Computers (e.g. lab vs. personal computers)

Users who are not on managed computers will need to either point their DNS 
server to 10.44.186.11 and 10.44.186.12 or replace npih-miles.lab.ccn.ucla.ed with 
10.44.186.12 in all the below afp urls. If assistance is needed, please send a request 
to support at ccn dot ucla dot edu.
You must apply for a lab account  
to receive access to any of the below services whether you are on a personal or lab computer.

Apple Remote Desktop Support

This allows support to:

  • monitor application versions
  • remotely install software and upgrades when needed (just like I do and at the same time for managed clients)
  • updates when needed
  • assist users in any day to day concerns via interactive chat and remote desktop abilities
  • Configure the clients for backups on request (using mike's script)

Shared Applications and Storage

All members of the Cohen & Bookheimer lab groups have equal access to all shared resources on the lab network. They are automatically mounted on managed computers, non-managed users can connect manually. These include:

  • Group folders for sharing data and documents between lab members
    • afp://npih-miles.lab.ccn.ucla.edu/Groups
  • Shared Resources folders for fast intranet downloads of resources. Remote Desktop Client & current stable fsl version are available. Other applications uploaded per request.
    • afp://npih-miles.lab.ccn.ucla.edu/Shared Resources
  • Office Staff group folder for all administrative members
    • afp://npih-miles.lab.ccn.ucla.edu/Office Staff
  • Technical group folder for all software and development projects
    • afp://npih-miles.lab.ccn.ucla.edu/Technical


Shared UNIX resources

All members of the Cohen & Bookheimer lab groups have access to a managed, shared unix utilities for both PPC and Intel platforms.

  • Address: afp://npih-miles.lab.ccn.ucla.edu/macports

Managed computers have paths properly configured, but non-managed users will need to configure their clients manually.

  • Once mounted, PPC binaries are found at:
    • /Volumes/macports/ppc
  • Intel binaries are found at:
    • /Volumes/macports/x86

Software Assistance

All users may also request specific support for any software issue, installation, or configuration via support at ccn dot ucla dot edu.

Text File Line Return