<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://shadow.nd.rl.ac.uk/wiki/idr/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=130.246.49.178</id>
	<title>InelasticDataReduction - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="http://shadow.nd.rl.ac.uk/wiki/idr/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=130.246.49.178"/>
	<link rel="alternate" type="text/html" href="http://shadow.nd.rl.ac.uk/wiki/idr/index.php?title=Special:Contributions/130.246.49.178"/>
	<updated>2026-05-12T18:56:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>http://shadow.nd.rl.ac.uk/wiki/idr/index.php?title=Using_Matlab_and_access_to_sample_Matlab_scripts&amp;diff=182</id>
		<title>Using Matlab and access to sample Matlab scripts</title>
		<link rel="alternate" type="text/html" href="http://shadow.nd.rl.ac.uk/wiki/idr/index.php?title=Using_Matlab_and_access_to_sample_Matlab_scripts&amp;diff=182"/>
		<updated>2016-01-26T09:39:57Z</updated>

		<summary type="html">&lt;p&gt;130.246.49.178: /* Configuring Matlab 2015b to work with gcc8.4.5 for combining using mex code on RHEL7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Matlab packages for Inelastic Scattering data analysis used in ISIS include [http://horace.isis.rl.ac.uk/Main_Page Horace] and [http://mslice.isis.rl.ac.uk/Main_Page Mslice]. The packages have home pages containing extensive description, but most recent and useful sample scripts are provided to users on the file system using  &amp;#039;&amp;#039;&amp;#039;HoraceExampleScripts&amp;#039;&amp;#039;&amp;#039; folder, placed on users desktop at: &lt;br /&gt;
&lt;br /&gt;
  /home/[USER&amp;#039;S_FEDERAL_ID]/Desktop/HoraceExampleScripts &lt;br /&gt;
&lt;br /&gt;
by a script defined in [http://linuxg.net/the-unix-and-linux-skeleton-directory-etcskel/ skel] configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://isiscompute.nd.rl.ac.uk Isiscompute] servers provide users with access to recent version of [http://uk.mathworks.com/products/matlab/ Matlab] and substantial number of floating licenses. Usually number of free licences is sufficient for users doing experiments and data analysis, but if Matlab does not start due to licensing issues, number of available licences can be checked using simple bash script (command):&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # check network licence for Matlab&lt;br /&gt;
 /usr/local/MATLAB/R2014a/etc/glnxa64/lmutil lmstat -c /usr/local/MATLAB/R2014a/licenses/network.lic -a&lt;br /&gt;
&lt;br /&gt;
Horace and Mslice are configured to be accessible from Matlab in two ways: &lt;br /&gt;
&lt;br /&gt;
*Using &amp;#039;&amp;#039;startup.m&amp;#039;&amp;#039; file, which is copied from [http://linuxg.net/the-unix-and-linux-skeleton-directory-etcskel/ &amp;#039;&amp;#039;skel&amp;#039;&amp;#039;]  configuration to each user home folder when user account is created. See the description of &amp;#039;&amp;#039;startup.m&amp;#039;&amp;#039; file at [http://mslice.isis.rl.ac.uk/Download_and_setup_MSlice Mslice] and [http://horace.isis.rl.ac.uk/Download_and_setup#Standard_Installation Horace] configuration pages for the detailed description of this file contents. &lt;br /&gt;
*By adding special [http://horace.isis.rl.ac.uk/Download_and_setup#Installation_with_Horace_not_initialised_by_default_on_starting_Matlab &amp;#039;&amp;#039;horace_on&amp;#039;&amp;#039;] and similar &amp;#039;&amp;#039;mslice_on&amp;#039;&amp;#039; scripts to Matlab default search path. The scripts are doing roughly the same as &amp;#039;&amp;#039;startup.m&amp;#039;&amp;#039; file but allow user to initialize [http://horace.isis.rl.ac.uk/Main_Page Horace] and [http://mslice.isis.rl.ac.uk/Main_Page Mslice] from arbitrary folder user wants to start Matlab from (not only from his or her home folder) and allows user to reinitialize these packages. This may be convenient for dealing with some errors in the analysis packages or when trying to resolve &amp;#039;&amp;#039;out of memory&amp;#039;&amp;#039; situations.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Matlab to access &amp;#039;&amp;#039;horace_on&amp;#039;&amp;#039; and &amp;#039;&amp;#039;mslice_on&amp;#039;&amp;#039; scripts ===&lt;br /&gt;
&lt;br /&gt;
Configuring Matlab to access &amp;#039;&amp;#039;horace_on&amp;#039;&amp;#039; and &amp;#039;&amp;#039;mslice_on&amp;#039;&amp;#039; scripts on [http://isiscompute.nd.rl.ac.uk isiscompute] server requests superuser access and involves the following steps: &lt;br /&gt;
&lt;br /&gt;
One needs to go to matlab installation folder e.g.&lt;br /&gt;
&lt;br /&gt;
  /usr/local/MATLAB/R2015b/toolbox/local/&lt;br /&gt;
&lt;br /&gt;
and edit &amp;#039;&amp;#039;pathdef.m&amp;#039;&amp;#039; file:&lt;br /&gt;
&lt;br /&gt;
  sudo vim pathdef.m&lt;br /&gt;
&lt;br /&gt;
where find the rows:&lt;br /&gt;
&lt;br /&gt;
 p=[...&lt;br /&gt;
 %%% BEGIN ENTRIES %%%&lt;br /&gt;
 matlabroot,&amp;#039;/toolbox/matlab/lang:&amp;#039;,...&lt;br /&gt;
&lt;br /&gt;
and modify them  as follows:&lt;br /&gt;
&lt;br /&gt;
 p=[...&lt;br /&gt;
 %%% BEGIN ENTRIES %%%&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#00ff00&amp;gt;&amp;#039;/usr/local/mprogs/Users:&amp;#039;, ...&amp;lt;/span&amp;gt;&lt;br /&gt;
  matlabroot,&amp;#039;/toolbox/matlab/lang:&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;/usr/local/mprogs/Users&amp;#039;&amp;#039; folder is the folder where appropriately configured &amp;#039;&amp;#039;horace_on&amp;#039;&amp;#039; and &amp;#039;&amp;#039;mslice_on&amp;#039;&amp;#039; packages can be found. See [http://horace.isis.rl.ac.uk/Download_and_setup#Installation_with_Horace_not_initialised_by_default_on_starting_Matlab Configure Horace]  and [http://mslice.isis.rl.ac.uk/Download_and_setup_MSlice Configuring Mslice] for details on how to configure these scripts. Note, that the syntax of the changes has to be exact to avoid problem with Matlab components search path.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuring Matlab 2015b to work with gcc8.4.5 for combining using mex code on RHEL7 === &lt;br /&gt;
&lt;br /&gt;
By default, Maltab 2015b mex code works with GCC4.7 but RHEL 7 default compiler is GCC4.8 and downgrading to gcc 4.7 is not straightforward. &lt;br /&gt;
From other side, the table below shows, that using mex code for combining files on [http://isiscompute.nd.rl.ac.uk isiscompute] cluster is very beneficial:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|+Combining sqw files on isiscompute server&lt;br /&gt;
|-&lt;br /&gt;
! Code and settings&lt;br /&gt;
! Combining speed Mb/s&lt;br /&gt;
! Time to combine 142Gb (min)&lt;br /&gt;
! use_mex_for_combine&amp;lt;sup&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;1)&amp;lt;/span&amp;gt;&amp;lt;/sup&amp;gt;&lt;br /&gt;
! mex_combine_thread_mode &lt;br /&gt;
|-&lt;br /&gt;
| Matlab 2015b, buffer N/A&lt;br /&gt;
| 67&lt;br /&gt;
| 37&lt;br /&gt;
| false&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| combine_sqw.mex. buffer 1024, &lt;br /&gt;
| 598&lt;br /&gt;
| 4&lt;br /&gt;
| true&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| combine_sqw.mex. buffer 1024&lt;br /&gt;
| 517&lt;br /&gt;
| 5&lt;br /&gt;
| true &lt;br /&gt;
| 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
   &amp;lt;sup&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;1)&amp;lt;/span&amp;gt;&amp;lt;/sup&amp;gt;The thread mode is set up by Horace setup command: &lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;set(hor_config,&amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;&amp;#039;use_mex_for_combine&amp;#039;,1,&amp;#039;mex_combine_thread_mode&amp;#039;,1&amp;lt;/span&amp;gt;)&amp;#039;&amp;#039;&amp;#039;; &lt;br /&gt;
    See [http://horace.isis.rl.ac.uk/Download_and_setup#Enabling_multi-sessions_processing Horace setup] for the details of configuring Horace to use mex files.&lt;br /&gt;
&lt;br /&gt;
Apparently, one can use gcc 4.8 compiler, but to use multi-threaded combining, the following changes have to be done for Matlab 2015b, assuming Matlab and gcc4.8 are installed in the system in default locations.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt;&amp;gt;cd /usr/local/MATLAB/R2015b/sys/os/glnxa64&lt;br /&gt;
  &amp;gt;&amp;gt;rm libstdc++.so.6 &lt;br /&gt;
  &amp;gt;&amp;gt;ln -s /usr/lib64/libstdc++.so.6.0.19 libstdc++.so.6&lt;br /&gt;
&lt;br /&gt;
No negative effects on Horace under Maltab2015b were noticed.&lt;/div&gt;</summary>
		<author><name>130.246.49.178</name></author>
	</entry>
</feed>