Skip to content

Commit e26e757

Browse files
authored
Merge pull request #799 from DiamondLightSource/nics_tools
citation doc
2 parents 63d02bb + d85314b commit e26e757

File tree

10 files changed

+141
-98
lines changed

10 files changed

+141
-98
lines changed

doc/source/howto/install/savu_hpc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ performance, we recommend a fast network interconnect, such as infiniBand, and
1010
a high performance parallel filesystem, such as GPFS or Lustre.
1111

1212
Requirements:
13-
- A Unix system with an `openMPI <https://www.open-mpi.org/>`_ library installed.
13+
- A Unix system with MPI libraries installed: Savu has been test with `openMPI <https://www.open-mpi.org/>`_ (latest version 4.1.1)
1414

1515

1616
**Installation of Savu HPC outside Diamond Light Source (DLS) systems**

doc/source/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ Table of Contents
6666

6767
reference/plugin_autosummary
6868

69+
.. _citations_content:
70+
71+
.. toctree::
72+
:caption: Citations
73+
:maxdepth: 2
74+
75+
reference/savu_citations
76+
77+
6978
Indices and tables
7079
==================
7180
* :ref:`genindex`
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
How to cite Savu software
3+
=========================
4+
5+
.. start_of_main_text
6+
7+
The relevant citations for your Savu job are contained in the "citations.txt" file in the Savu output folder, in BibTeX and EndNote formats. These include:
8+
9+
* Savu framework citations
10+
* Plugin citations - specific to your process list
11+
12+
All citations are also contained in both the Savu process list and output Savu nexus file and can be extracted into BibTeX and EndNote formats using the savu_citations tool. From the command line run:
13+
14+
>>> savu_citations <your_nxs_file> <out_file_name>
15+
16+
Where the output file is the name of the file you would like to extract this information to.
17+
18+
For example,
19+
20+
>>> savu_citations process_lists.nxs citations.txt
21+
22+
*** Please include all Savu citations in your relevant publications ***
23+

doc/source/tutorials/confluence/savu/savu_notes.rst

Lines changed: 9 additions & 12 deletions
Large diffs are not rendered by default.

doc/source/tutorials/confluence/savu/savu_tutorial.rst

Lines changed: 27 additions & 30 deletions
Large diffs are not rendered by default.

install/installation_notes.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Installation notes (for creating a new release and installing at Diamond)
2+
=========================================================================
3+
4+
- Freeze on pull requests
5+
- Install latest version of Savu from Master into /dls_sw/apps/savu
6+
- Create savu_plugins folder in /dls_sw/apps/savu/$release/
7+
- Create a new module file
8+
- Test new installation
9+
- Update Savu/install/latest_version.py to contain the new version number (and the corresponding file)
10+
- Update installation notes with the latest tested versions of libraries
11+
- Create tar.gz of the new install folder
12+
>>> tar -zcvf savu_installer.tar.gz Savu/install/savu_hpc/savu_installer
13+
- Push all changes to Github (ensure all tests passing) and check download link works correctly
14+
- Collate release notes
15+
Get all Git commits since the last release: git log --oneline v3.0.. HEAD > a.txt
16+
Get all Git files added since the last release: git diff v3.0 HEAD --name-status | grep A
17+
- Create release on Github
18+
- Reinstall Savu into new release Conda environment
19+
- Further testing
20+
- (Make this module default load if during shutdown)
21+
- Email beamlines
22+
-7.39 KB
Binary file not shown.

savu/tomo_recon.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from savu.version import __version__
3131

3232
import savu.core.utils as cu
33+
from scripts.citation_extractor import citation_extractor
3334
from savu.core.basic_plugin_runner import BasicPluginRunner
3435
from savu.core.plugin_runner import PluginRunner
3536

@@ -217,6 +218,9 @@ def main(input_args=None):
217218
try:
218219
plugin_runner = pRunner(options)
219220
plugin_runner._run_plugin_list()
221+
if options['process'] == 0:
222+
in_file = plugin_runner.exp.meta_data['nxs_filename']
223+
citation_extractor.main(in_file=in_file, quiet=True)
220224
except Exception:
221225
# raise the error in the user log
222226
trace = traceback.format_exc()

scripts/citation_extractor/citation_extractor.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
class NXcitation(object):
1010
def __init__(self, description, doi, endnote, bibtex):
11-
self.description = description
12-
self.doi = doi
11+
self.description = description.decode('UTF-8')
12+
self.doi = doi.decode('UTF-8')
1313
self.endnote = endnote.decode('UTF-8')
1414
self.bibtex = bibtex.decode('UTF-8')
1515

@@ -104,14 +104,23 @@ def __option_parser(doc=True):
104104
return parser if doc==True else parser.parse_args()
105105

106106

107-
def main():
108-
args = __option_parser(doc=False)
109-
infile = h5py.File(args.in_file, 'r')
107+
def main(in_file=None, quiet=False):
108+
# when calling directly from tomo_recon.py
109+
if in_file:
110+
out_file = os.path.join(os.path.dirname(in_file), 'citations.txt')
111+
else:
112+
args = __option_parser(doc=False)
113+
in_file = args.in_file
114+
out_file = args.out_file
115+
116+
infile = h5py.File(in_file, 'r')
110117
citation_manager = NXciteVisitor().get_citation_manager(infile, '/')
111118
if citation_manager is not None:
112-
with open(args.out_file, 'w') as outfile:
119+
with open(out_file, 'w') as outfile:
113120
outfile.write(citation_manager.__str__())
114-
print("Extraction complete")
121+
122+
if not quiet:
123+
print("Extraction complete")
115124

116125
if __name__ == '__main__':
117126
main()

system_files/dls/modulefile/3.0 renamed to system_files/dls/modulefile/4.0

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,29 @@ proc ModulesHelp { } {
1313

1414
module load global/directories
1515

16+
1617
if { [info exists env(SAVUHOME)] } {
1718
set gitrepo $env(SAVUHOME)
1819
}
1920

20-
# Set RHEL 6 or 7
21-
# set redhatrelease [eval exec "cat /etc/redhat-release"]
22-
# if { [regexp -nocase {release 6} $redhatrelease] } {
23-
# set OS rhel6
24-
# } elseif { [regexp -nocase {release 7} $redhatrelease] } {
25-
# set OS rhel7
26-
# } else {
27-
# puts stderr "Incompatible operating system."
28-
# }
29-
30-
# # switch OS
31-
# if { [info exists env(SWITCH_SAVU_OS)] } {
32-
# if { [string equal $OS rhel7] } {
33-
# set OS rhel6
34-
# } else {
35-
# set OS rhel7
36-
# }
37-
# }
38-
39-
#============================================================================
40-
# When creating a new module, update these variables.
41-
set savu_version 3.0
42-
43-
set mpi_version 3.1.4
44-
# if { [string equal $OS rhel6] } {
45-
# set PYTHON_HOME $env(softwaredir)/savu/2.4_RHEL6/miniconda
46-
# setenv SAVU_PLUGINS_PATH /dls_sw/apps/savu/2.4_RHEL6/savu_plugins
47-
# #puts stderr "\tLoading Savu for RHEL 6"
48-
# } else {
49-
set PYTHON_HOME $env(softwaredir)/savu/3.0_RHEL7/savu
50-
# set PYTHON_HOME $env(softwaredir)/savu/3.0_RHEL7/miniconda
51-
setenv SAVU_PLUGINS_PATH /dls_sw/apps/savu/3.0_RHEL7/savu_plugins
52-
#puts stderr "\tLoading Savu for RHEL 7"
53-
# }
54-
55-
#============================================================================
21+
22+
set hostname [eval exec "cat /proc/sys/kernel/hostname"]
23+
if { [regexp -nocase {cs03r-sc-serv-39} $hostname] } {
24+
puts stderr "\t Unfortunately Savu won't work on this node, please start a new nx session."
25+
exit
26+
} elseif { [regexp -nocase {cs03r-sc-serv-40} $hostname] } {
27+
puts stderr "\t Unfortunately Savu won't work on this node, please start a new nx session."
28+
exit
29+
} else {
30+
#============================================================================
31+
# When creating a new module, update these variables.
32+
set savu_version 4.0
33+
set mpi_version 4.1.1
34+
set PYTHON_HOME /dls_sw/apps/savu/4.0/miniconda
35+
set hebi /dls_sw/apps/savu/hebi
36+
#============================================================================
37+
}
38+
5639

5740
set mach $tcl_platform(machine)
5841
module-whatis "loads Savu version $savu_version"
@@ -74,6 +57,7 @@ if { [module-info mode load] } {
7457
module load openmpi/$mpi_version
7558
}
7659

60+
7761
if { ! [info exists env(SAVU_PRERELEASE)] } {
7862
puts stderr "\n\t\t ********************************************"
7963
puts stderr "\t\t * Loading Savu version $savu_version *"
@@ -91,37 +75,35 @@ if { [module-info mode load] } {
9175
module unload openmpi/$mpi_version
9276
}
9377

94-
# TODO is this necessary? SAVUHOME seems like a user-set environment
95-
# so we shouldn't automatically delete it
96-
# if { [info exists env(SAVUHOME)] } {
97-
# unsetenv SAVUHOME
98-
# puts stderr "Cleaning up SAVUHOME"
99-
# }
100-
101-
# if { [info exists env(SWITCH_SAVU_OS)] } {
102-
# unsetenv SWITCH_SAVU_OS
103-
# puts stderr "Cleaning up SWITCH_SAVU_OS"
104-
# }
78+
if { [info exists env(SAVUHOME)] } {
79+
unsetenv SAVUHOME
80+
puts stderr "Cleaning up SAVUHOME"
81+
}
82+
10583
}
10684

10785
setenv PYTHONNOUSERSITE True
10886
prepend-path PATH $PYTHON_HOME/bin
87+
prepend-path PATH $hebi
10988

11089
module add fastxrf
11190

11291
set-alias "savu_mpi" "savu_launcher.sh -s $savu_version"
11392
set-alias "savu_mpi_auto" "savu_launcher.sh -s $savu_version -t AUTO"
11493
set-alias "savu_mpi_preview" "savu_launcher.sh -s $savu_version -t PREVIEW"
94+
set-alias "savu_mpi_com14" "savu_launcher.sh -s $savu_version -t BIG"
11595

11696
if { [info exists gitrepo] } {
11797
prepend-path PATH $gitrepo
11898
prepend-path PYTHONPATH $gitrepo
99+
prepend-path PYTHONPATH $gitrepo/scripts # required for the configurators
119100
set-alias "savu_mpi_dev" "$gitrepo/system_files/dls/mpi/savu_launcher.sh -s $savu_version -i"
120101
set-alias "savu_mpi_local" "$gitrepo/system_files/dls/mpi/savu_mpijob_local.sh"
121-
set-alias "savu_config" "python $gitrepo/scripts/config_generator/savu_config.py"
102+
set-alias "savu_config" "python -m config_generator.savu_config"
122103
set-alias "savu" "python $gitrepo/savu/tomo_recon.py"
123104
set-alias "savu_citations" "python $gitrepo/scripts/citation_extractor/citation_extractor.py"
124105
} else {
125106
set-alias "savu" "savu -s cs04r-sc-serv-14"
126107
set-alias "savu_mpi_local" "savu_mpijob_local.sh"
127108
}
109+

0 commit comments

Comments
 (0)