mathematica upgrade - raeker/ARC-Wiki-Test GitHub Wiki
Upgrading Mathematica on any cluster is complicated by the various maneuvers that are required to update the license files on the license server, creating the appropriate links, stopping and starting the daemon in the right sequence, and so on. Make a fresh pot of coffee, get yourself a plate of your favorite cookies, and put on your thinking cap.
The steps that need to be done are as follows.
- Download the new versions of Mathematica and the license daemon
- Update the license daemon, monitorlm, and the man pages for them on the license server
- Make sure the old version still works with the new license server software
- Install the new license file on the license server
- Install the new version of Mathematica
- Test that the new version works
- Push build file and module to BitBucket
You must be an Administrator for the Mathematica license.
If you start a VNC session (using your *sw account if you are doing this for GL), you can download directly to the /sw/src/arc/mathematica directory by running Firefox on the build machine.
Log into the Wolfram user portal: https://user.wolfram.com/portal/mySiteProducts.html
Navigate as follows. We will use 12.1.0 as the example; substitute the current version as needed.
- My Site Programs tab → [Mathematica Unlimited Site]{style="color: rgb(255,0,0);"} link → [Download Center]{style="color: rgb(255,0,0);"}
- Download the Mathematica Linux executable file from the table of available versions*,* e.g., Mathematica 12.1.0_LINUX.sh
- [Download the Mathematica License Manager Multi MathLM_12.1.0_MULT.zip)]{style="color: rgb(51,51,51);"}
[Transfer both files to Great Lakes /sw/src/arc/mathematica source directory.]{style="color: rgb(51,51,51);letter-spacing: 0.0px;"}
[While you are logged into the Wolfram site, you also need to go to https://user.wolfram.com/portal/passwordrequest.html and create the password for the update Mathematica license.]{style="color: rgb(51,51,51);letter-spacing: 0.0px;"}
[The activation
key]{style="color: rgb(51,51,51);letter-spacing: 0.0px;"} is
2377-9483-TGLPRT
The MathID for flux-license1.miserver.it.umich.edu is 6510-56939-61585
Copy the Password that is generated, as you will need to copy and paste
it into the terminal on the license server along with the activation
key.
You will need to run the license server updates as the swinstaller user. You will also need a terminal window open where you are logged in as yourself on one of the clusters to run the current version of Mathematica once the license daemon has been updated.
$ ssh flux-license1.miserver.it.umich.edu
$ sudo /bin/su - swinstaller
$ cd /tmp
Make sure none of the old tmp files have been left behind.
$ rm -rf /tmp/mathlm
$ rm -f /tmp/M-UNIX-LM.sh
$ rm -f /tmp/M-WIN-LM.exe
$ unzip /var/flux/sw/gl/src/arc/mathematica/MathLM_12.1.0_MULT.zip
$ bash M-UNIX-LM.sh --keep --target /tmp/mathlm
You will be prompted for the activation key and the password you generated above, enter those when prompted. You only want to install one activation key.
When prompted for the MathLM directory, enter /tmp/mathlm, also enter
that when prompted to create symlinks.
That should leave you with
$ ls /tmp/mathlm
Macintosh mathlm.1 mathpass monitorlm.1 Unix
mathlm MathLMInstallerErrors.log monitorlm ReadMe.txt
Copy the new mathpass file from /tmp into
/var/flux/license.d/mathematica. Note the format which includes the
version number and the beginning and ending year of the license within.
$ cd /var/flux/license.d/mathematica$ cp /tmp/mathlm/mathpass mathpass-12.1.0-2019-2020
$ cp /tmp/mathlm/monitorlm monitorlm-12.1
$ cp /tmp/mathlm/
Check the current status of the mathematica license daemon and run
monitorlm before making changes
Check the license daemons with
$ ../../scripts/check_license_daemons -d mathematica
It should return something like this
===================================================
Correct number of processes running
swinsta+ 1617 1 0 Mar10 ? 00:00:07 ../mathematica/mathlm -pwfile ../mathematica/mathpass
-localtime -logfile /var/flux/log/mathematica/mathematica.2020-03-10_08:39:41.log
===================================================
Run monitorlm.
$ ./monitorlm
If the output from monitorlm shows many users with licenses checked out,
you may wish to return to this later. If none or only a few show up
(this is usual), then proceed. Note that both mathlm and monitorlm
are symbolic links to versioned binary files.
$ ls -l mathlm monitorlm
lrwxrwxrwx 1 swinstaller swinstaller 11 Apr 13 18:38 mathlm -> mathlm-12.0
lrwxrwxrwx 1 swinstaller swinstaller 14 Apr 13 18:38 monitorlm -> monitorlm-12.0
Stop the mathematica license daemon with
$ ./folder.rc stop
Check to make sure it has stopped
$ ../../scripts/check_license_daemons -d mathematica
===================================================
Wrong process count. There were 0 and should be 1
===================================================
If it still shows mathlm running, you may need to wait a few seconds.
If it still shows, then you should kill it manually. Be sure to change
the version and date of the example files below; do not just copy and
paste.
$ mv mathpass mathpass.old
$ ln -s mathpass-12.1.0-2019-2020 mathpass
$ mv mathlm mathlm.old
$ mv monitorlm monitorlm.old
$ ln -s monitorlm-12.1 monitorlm
$ ln -s mathlm-12.1 mathlm
Restart the license daemon and check it's status
$ ./folder.rc start
$ ../../scripts/check_license_daemons -d mathematica
It should show a running process again, as it did the first time you ran it.
Run ./monitorlm again to make sure that it reports the version and any
users as it should
$ ./monitorlm
Clean-up the /tmp directory by removing the files created by the M-UNIX-LM.sh script
$ rm -rf /tmp/mathlm
$ rm -f /tmp/M-UNIX-LM.sh
$ rm -f /tmp/M-WIN-LM.exe
In the terminal window you have open on one of the clusters, check that the current version of Mathematica can still get a license with the new server and license file (this very seldom fails, but it could).
$ module load mathematica
$ math
Mathematica 12.0.0 Kernel for Linux x86 (64-bit)
Copyright 1988-2019 Wolfram Research, Inc.
In[1]:= Quit
- Create new build script in the arc_glb_build_scripts
repository in the mathematica directory. This may be as simple
as copying old script to new one (for
example:
$ cp 12.0.0 12.1.0) and updating the PKG_VER variable. The script should perform the following steps:- Silent installation that executes the Mathematica script
- Create mathpass file in the Configuration/Licensing directory of the installation that points to license server
- Creates symbolic links in bin directory
- Run build script
- Test the new version by running the
mathexecutable from itsExecutablesdirectory. - Submit pull request to Bitbucket for the new script
-
On Great Lakes, create a module file for the new version in the
Core/mathematicadirectory of thegl_arc_modulesrepository -
Change the default module to newest version (via symbolic link)
-
[Submit a pull request to Bitbucket for the new module file and default]{style="letter-spacing: 0.0px;"}
-
When the PR has been approved, confirm that new module exists on Great Lakes:
$ module spider mathematica -
Test that it works and is the new default:
$ module load mathematica
$ module list
$ math
Mathematica 12.1.0 Kernel for Linux x86 (64-bit)
Copyright 1988-2020 Wolfram Research, Inc.
In[1]:= 5+5
Out[1]= 10
In[2]:= Quit -
Take the rest of the day off, you've earned it!