Getting the agnjet model to run/fit data on the LISA cluster

At present the latest versions of ISIS, Slirp, agnjet etc. are installed on my workarea in LISA. Given that

(a) a very small cross section of their users will use these codes/software, and also
(b) we may want to update them frequently,

the LISA admin may not want to install these globally. I think it may be better overall if one of the group members take the responsibility of hosting/maintaining the latest versions of the software/model on LISA, and then makes them accessible to others. Since DM will leave in a few months, we will have to find someone else soon …

Anyway, for now others can try the following recipe to get the agnjet model to run/fit data on the LISA cluster.

1 Setting up

1.1 Get my .bashrc to access the latest versions of ISIS, Slirp, agnjet etc.

Login to LISA. Then

cd
cp -v .bashrc bashrc.orig
wget http://astrokubuntu.wikidot.com/local--files/agnjet-on-lisa/lisa.bashrc
cp -v lisa.bashrc .bashrc

At this stage it might be best to log out of LISA and login again. If there are problems in accessing the directories/files in my workarea, you will see them at login time. If everything goes fine, then we are ready for the next step.

1.1.1 Test to see if you can start up ISIS

isis

should get you into isis prompt. The version number is 1.4.9-38.

1.2 Get the latest .isisrc file (MNowak 20090121)

cd
cp -v .isisrc isisrc.orig
wget http://astrokubuntu.wikidot.com/local--files/agnjet-on-lisa/lisa.isisrc
cp -v lisa.isisrc .isisrc

1.2.1 Test to see if you can start up ISIS with all the required accessories.

E.g. doing and "isis -v" outputs all this stuff for me

dmaitra@login-ng1:~$ isis -v
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/setup.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/require.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/init.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/physconst.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/_isis.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/mathmisc.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/cmds.sl
Loading /home/dmaitra/installed/slang-2.1.4/share/slsh/slshhelp.sl
Loading /home/dmaitra/installed/slang-2.1.4/share/slsh/glob.sl
Loading /home/dmaitra/installed/slang-2.1.4/share/slsh/print.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/plot-cmds.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/plot-extra.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/pgplot_interface.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/pgplot.sl
Loading /home/dmaitra/installed/slang-2.1.4/share/slsh/structfuns.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/hist-cmds.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/atom-cmds.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/emis-cmds.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/fit-cmds.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/model-cmds.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/aped_fun.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/fits.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/etc/local.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/etc/isis.rc
Loading /home/dmaitra/.isisrc
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/xspec.sl
Loading /home/dmaitra/installed/isis-1.4.9-38/isis/1.4.9-38/share/parse_model_dat.sl
Loading /home/dmaitra/installed/slang-2.1.4/share/slsh/local-packages/pvm.sl
Loading /home/dmaitra/ISISRC_files/isisrc_20090121/.isisrc_conf
Loading /home/dmaitra/ISISRC_files/isisrc_20090121/.isisrc_group
Loading /home/dmaitra/ISISRC_files/isisrc_20090121/.isisrc_data
Loading /home/dmaitra/ISISRC_files/isisrc_20090121/.isisrc_plots_new
Loading /home/dmaitra/ISISRC_files/isisrc_20090121/.isisrc_flux
Loading /home/dmaitra/ISISRC_files/isisrc_20090121/.isisrc_fitfun
Loading /home/dmaitra/ISISRC_files/isisrc_20090121//bin/cache_model.sl

Welcome to ISIS Version 1.4.9-38
Copyright (C) 1998-2008 Massachusetts Institute of Technology

isis>

1.2.2 Check if you can load the agnjet model

isis> require("agnjet");
Loading /home/dmaitra/irrad_jet/agnjet.sl [ns:isis]
This module interfaces to 15 Fortran common blocks.
You may need to invoke the Fortran routine(s) which
define(s) them prior to using their values in S-Lang.
You may use struct.field notation to access or modify
the values of individual common block variables.
Type "help commblock" for more information.

isis>

1.2.3 Check if you can load a sample data set, model parameters and generate nice plots

wget http://astrokubuntu.wikidot.com/local--files/agnjet-on-lisa/sample_isis_data_pars.tar.gz
tar -zxf sample_isis_data_pars.tar.gz
cd sample_isis_data_pars
isis plot.sl

If everything goes properly then two postscript files plot_all.ps and plot_xray.ps will be produced, which should be same as the files
plot_all.orig.ps and plot_xray.orig.ps (supplied with the gzipped tar archive).

—-

2 Submitting a new fitting job

2.1 Load the data, model, and initial starting parameters

Use the ISIS script called init.sl. It is important (at least at this time) that the loading script be called init.sl because the parallelizing workhorse (cl_master) looks for a script called init.sl. A sample init.sl, also included in sample_isis_data_pars.tar.gz looks like this

%
% A sample init.sl
%
% Load the PCA data, group to a minimum signal to noise of 4.5,
% and only notice stuff in the 3-22 keV range. 
variable pid = load_all("pca.pha");
set_systematics(pid,[0],[127],[0.005]);
grppha_sn(pid,4.5,3.);
kev_note(pid,3.,22.);

% Ditto for HEXTE, but only keep 20-200 keV
variable hid = load_all("hxt.pha");
grppha_sn(hid,4.5,20.);
kev_note(hid,20.,200.);

% Load the radio data, with no errors
% on frequencies, no blank lines, no comments.
variable rid_struct = read_radio("radio-oir_53393_sys.dat",1000);
variable rid = load_radio(rid_struct);

usr_grid([rid,pid],-8,3,0.001,1);
usr_grid([hid],0,3,0.001);

require("agnjet");
cache_mod ("agnjet",-9,3,0.005);
load_par("fit1_cache.par");
() = eval_counts();

2.2 Submit the job

Since LISA uses the MAUI scheduler to schedule jobs, Mike Noble has written another script called pvm_conf (also included in the sample tar archive). Note that the free parameters in the initial model parameter file (fit1_cache.par) are [6, 7, 8, 9, 14]. To quote Mike Noble, "A parallel job … running on LISA that should compute the moral equivalent of Mike Nowak's error_loop() for the jet model … [is ] invoked as"

./pvm_conf -toler=0.1 6 7 8 9 14

The script requests one processor and 6 hours of time per free parameter; that's 5 CPUs and 30 hours in this case.

The status & results of the job can be checked in various ways:

showq -u dmaitra

This will show stats like the jobid, run/idle state, and how much time (of the original requested CPU allocation) remains.
cat limits.<pvm_master_process_id>
cat best.<pvm_master_process_id>

This outputs the best-fit parameters, when the entire job is completed. Some description about LISA's batch usage and the commands can be found here. Remember, it often takes (quite a) few hours before your job actually starts on LISA.

—-

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License