Running Matlab code on a cluster - linux

I have a university account for the university's cluster, but I don't know how can I use it to run my Matlab code. Could anyone help? I connect to the cluster by typing below code in the terminal of my laptop:
ssh myusername#192.168.194.222
Then it asks me to type my password.After that, below text appears:
Welcome to gav 9.1.1 (3.12.60-ql-generic-9.1-74) based on Ubuntu 14.04.5 LTS
Last login: Sun Apr 16 10:45:49 2017 from 192.168.41.213
gav:~ >
How can I run my code after these processes? Could anyone help me?

It looks like you have a Linux shell, so you can run your script (for instance yourScript.m)
> matlab -nojvm -nodisplay -nosplash < yourScript.m
(see also https://uk.mathworks.com/help/matlab/ref/matlablinux.html)

As far as I know, there are two possibilities:
Conventional Matlab is installed on the Cluster
The Matlab Distributed Computing server is installed on the cluster
Conventional Matlab is installed on the Cluster
You execute Matlab on the cluster as you would on your local computer. I guess that you work on Windows on your local computer, given that you quote a simple shell prompt in your question ;) All right, all right, bad psychic skillz ;) see edit below.
What you see is the cluster awaiting a program name to execute. This is called the "Shell". Google "Linux shell tutorial" or start with this tutorial to get information about how to operate a Linux system without a graphical desktop.
Try to start matlab by simply typing matlab after the text you've seen. If it works, you see Matlab's welcome message and the Matlab prompt as you would see it in Matlab's command window on your local PC.
Bonus: you can try to execute Matlab on the cluster but see a graphical interface by replacing your ssh call by ssh -X myusername#192.168.194.222, so add an additional -X.
Upload your Matlab scripts to the cluster, for example by using WinSCP (tutorial)
Execute your Matlab functions like you would locally by navigating into the correct folder and typing the function name.
EDIT: As you use Linux, you may use gio mount ssh://myusername#192.168.194.222 to access your home folder on the cluster via your file manager. If that fails, try gvfs-mount ssh://myusername#192.168.194.222 (the old name of the tool). The packages gvfs-backends and gvfs-fuse (I assume that you use ubuntu, other distributions may have different package names) must be installed for this; use your Package manager to install them if you get an error like "command not found".
Distributed Computing Server
This provides a set of Matlab "Workers" which are sent tasks from your local Computer. You use your local Matlab installation to connect to the Distributed computing server. Start with the Matlab Help Pages for the Distributed Computing Server

Related

I am trying to run hyperledger fabric sample test network on windows 11

when executing "/network.sh up", I got this:
-bash: /network.sh: no such file or directory
how can I fix this?
I need to get the network up
You say you are trying to run /network.sh. This will try to run a network.sh script in the root directory of your filesystem. More likely you meant to type ./network.sh, which will run a network.sh script in your current working directory (. is interpreted by the shell as the current directory).
You give no details of how your environment is set up so make sure you are following the guidance on running in Windows provided by the Fabric documentation:
https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#windows
Essentially the recommendation is to run on Linux within a (Windows Subsystem for Linux) virtual machine. I personally run Docker within the Linux environment too, and don't use Docker Desktop for Windows. Either approach should work.

shebangs for cross-platform scripts

I use Google Drive Desktop for Windows 10 and rclone connected to Google Drive for Linux. I would like to have a folder containing Python scripts to use on whichever system I happen to be on.
On Windows, I can type into cmd.exe "(script) arg1 arg2 ..." and it will run.
On Linux, I am using python virtualenv, so I add a shebang to line 1 pointing to the environment I want to use. Something like #!/home/(username)/venv1/bin/python. Then from bash I type "./(script).py arg1 arg2 ..." and it runs fine.
After adding the shebang, when attempting to run the file on Windows again, it fails with an error "windows Unable to create process using /home/(username)/venv1/bin/python".
Some of my google fu search results say "WiNdOwS dOeSnT sUpPoRt sHeBaNgS" but it clearly is having an effect on running my script (Win 10 x64 Python 3.10). Other search results say something like "use /usr/bin/env (python version) and it will all work out".
Does anyone know the proper way to do this? I think the problem with the second solution for me is that I am using a virtualenv, not a system version of python.

Remote development - Edit on Windows & Build on Linux

I am looking for a solution for a remote development environment as follows:
Editor - Windows Source Insight / Visual Studio
Source control - Clearcase
Build server - Linux
The above can't be modified.
In my current setup, I can view and edit the sources on Windows using a Windows Cleacase client.
My problem is mainly the build (and the later on, the debug) process.
I need to invoke 'make' from Windows on a specific Clearcase view on the Linux Server.
I can login in a separate process using SSH to the Linux server and run 'make', but it is a cumbersome procedure.
I am also unable to view the 'make' results and double-lick them to go to the specific warning/errors.
Is there any way to remotely bind a Windows command/batch to a Linux environment?
Perhaps through SSH?
Thank you for any suggestion you might have.
The usual solution is rather a pull strategy (where your build server fetches information on Linux, rather than trying to pilot everything from Windows.
If you follow the SSH path, be aware of technote swg21351507:
Linux SSH connection hangs when attempting to exit after starting ClearCase.
This can affect the use of scripts to start/stop ClearCase remotely using SSH.
Cause
This is a due to a OpenSSH server design, which will not close the console until all process/jobs executed by the user are completed.
Refer to this SSH FAQ for further details, regarding background jobs.
Resolving the problem
Redirect the ClearCase start script to either /dev/null or to a log file.
Example:
/usr/atria/etc/clearcase start < /dev/null >& /dev/null
/usr/atria/etc/clearcase start < /tmp/ccstart >& /tmp/ccstart
Try sshfs. I don't if there is a sshfs client for windows. If not, you can try NFS, or even SAMBA. Those definately work in Windows and Linux.
I just came across this and wanted to answer, even if the original poster has surely resolved their issue. This could be quite easily resolved by installing a jenkins instance on the build machine. You could kick off the build from the web interface and have it pull the files from clearcase and tell you the results.

Starting a process when Linux starts (Ubuntu)

I have a process (Spark chat client) which needs to be run when my Ubuntu boots up. For this I have done followings.
I created a run.sh file which will fire up my application (and I check it's working)
I created a symbolic link from both /etc/rc5.d/ and /etc/rc3.d/ to my run.sh file. (A symbolic link is also working fine)
But my processes don't start up when my machine boots. (Is this the way to do it or am I doing the wrong thing here?)
I'm running on Ubuntu 10.04 LTS (Lucid Lynx).
Your solution would've worked in most Linux distributions. However, Ubuntu never goes past runlevel 2.
Just in case, this means the contents of rc?.d with ? > 2 are not used unless you manually raise the runlevel as root. Use rc2.d :)
The symlinks you created in /etc/rc5.d/ and /etc/rc3.d/ should be named S##name. S is for start, and the number ## gives an order in which the scripts are run.
Note also that the symlinks in these directories usually points to the actual script located in /etc/init.d/.
It looks like you want to run an X program when a user logs in, not a service on startup. Remember, in Linux there is no GUI; X is a program that runs to display graphics on the screen.
You likely want to set up a program to start on KDE/Gnome login. Each has their own way to do it, but is generally boils down to pointing at a script and saying "Run this."
Put the command to run that script in the /etc/rc.local file. I think it will run each time you log in to the system.

How to set up MIT Scheme for 6.001 in Ubuntu 8.10

I play to self-study 6.001 with the video lectures and lecture handouts. However, I have some problems setting up MIT Scheme in Ubuntu (intrepid).
I used package management and installed MIT-Scheme, but it's obviously the wrong version to use. It should be 7.5.1 instead of 7.7.90
I followed the instructions from this website (http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/Tools/detail/linuxinstall.htm)
So far, I've downloaded the tar file, and extracted to /usr/local. I have no idea what step 3 means.
Then I entered command
scheme -large -band 6001.com -edit
and the error is
Not enough memory for this configuration.
I tried to run under sudo mode, and this time the error is different
Unable to allocate process table.
Inconsistency detected
I have close to 1GB of free memory, with ample HDD space. What should I do to successfully set this up?
Step 3 means that you should type export MITSCHEME_6001_DIRECTORY=${your_problems_path}. If you don't want to type it every time you launch Scheme, you should put it as a string in your ~/.bash_profile file(in case you use bash)
About the problem itself, Google instantly suggests a solution:
sudo sysctl -w vm.mmap_min_addr=0(taken from http://ubuntuforums.org/showthread.php?p=4868292)
Instead of the package manager, you may also want to compile the portable C sources for Unix. I am using it happily.

Resources