From Francois Schiettekatte - Site Internet

Recherche: Corteo

(:notabs:)

Version 20160816 available, which namely includes 2D/3D pixel targets and cross-section interpolation in tables. See below.

Corteo is a Monte Carlo (MC) simulation program intended to make possible MC simulations of ion beam analysis spectra within a few seconds or minutes. It computes the trajectory of ions in materials, based on binary collision, central potential and random phase approximations. Computations are accelerated by extracting the scattering angle components in lab frame from tables indexed using the binary representation of reduced energy and impact parameter. It also uses the 'main collision' approximation: after computing the trajectory of the incident ion down to a certain depth, Corteo generates a scattered ion or a recoil in a wide cone oriented towards the detector. The trajectory of this ion is computed until it emerges out of the target, and its intersection with the detector is checked. Implemented techniques include RBS, ERD, RBS-TOF, ERD-TOF and coincidence of identical ions. Since version 20130715, Full RBS simulations are possible, that is, RBS simulations without the 'main collision' approximation, just as running SRIM for months or years, but in a few hours. And for that purpose, it is now easier to run corteo on computer clusters. It is also possible to simulate ion implantation, but results are usually not identical to SRIM, so be careful.

Version 20160816 allows to carry out simulation considering a target consisting of 2D pixels or 3D voxels. A bitmap (bmp, gif, png) containing a number of color can be loaded, each color representing a material which composition is defined the same way layer composition was defined. (The image can for example be derived from a micrograph, therefore severely constraining the solution.) A substrate layer can also be defined. This for example allows the definition of a rough interface below a layer since the substrate can have the same composition as one of the colors in the image. In the case of 3D images, they have to be in XRAW format as provided by the free voxel editor MagicaVoxel. The 20160816 version also allows interpolation of the cross-section in a table, and such table can be generated from SigmaCalc using a Python provided below.

See the Update section below where many details about the changes are given, a must-read! The program is available for download form this web site under the conditions of the GNU General Public Licence (GPL).

Documentation

Documentation has been updated as of August 2016: Corteo20160816.pdf (4 Mb). This document describes in some details the theory and approximations behind Corteo, its parameters, input and output files, and its User Interface. You can also read the following papers:

Mailing list

If you want to receive e-mails about Corteo updates, please send an e-mail.

Installation

Corteo itself is programmed in plain C without a user interface. It can therefore run on any platform featuring a C compiler and is callable from any other program, namely its User Interface, CorteoUi, developed using Qt. By downloading and running the program, you understand that most of the files are distributed under the GNU General Public Licence and you agree with it.

Since version 20130715, it is no longer necessary to compute the scattering matrix and stopping tables from SRIM during setup. Instead, when the user runs the program the first time, CorteoUi ask the user to understand that the stopping tables included are generated using SRIM. Hence, the user should specify that when giving the details of its simulations in a paper.

Windows and Mac users can download an executable version of the program. Just download the appropriate zip file below, unzip it, and you are ready to go.

Linux users, see next section.

Compile Corteo

Linux users or those who wish to compile it for any reason:

If you want to deploy the application:

Cross-sections tables

With version 20160816, Corteo allows to interpolate the cross-section or a correction to the cross-section from a table. See the selection box in each element description form in CorteoUi. Since in MC simulations, the cross-section maybe needed at any angle, the table must provide the cross-section correction at any angle and energy. Hence, Corteo Cross-section files (.ccs). The format of a .ccs is relatively straightforward: it containing an header with arbitrary comments but not starting with "Data:". This header usually describes the data and the paper to cite. CorteoUI will simply skip all the lines until it finds the line starting with "Data:". Then, on the next line, Corteo expects a line with 2 numbers: the number M of energies (rows) and the number N of angles (columns). The next line starts with a 0 followed by the list of N angles in degrees. Each of the M following rows then contain the energy in keV and the list of cross-section values (in mb/sr) or ratio-to-Rutherford (RR, no units). For a given collision, CorteoUi will look in the data directory for a specific filename. For alphas scattering of 12C and for a cross-section given as RR, the filename must be C-12-He-4-He-4_scat_RR.ccs. For protons scattering off natural silicon with cross-section given in mb/sr, the filename must be Si-nat-H-1-H-1_scat_CS.ccs, i.e. the _CS or _RR part of the filename reflects the units of the data contained in the file. The setting in the selection box in each element description form in CorteoUi has to be set accordingly.

Note that the cross-section correction/interpolation is applied only after the simulation itself, by the user interface. Power users who directly use the simulation engine (corteo) output have to carry out this computation separately.

Cross-section for p-p coincidence

Coincidence practitioners can download a table containing the cross-section for p-p coincidence. Data are obtained from the group at Universitat der Bundeswehr - Munchen. Please cite the following paper if you use these data: M. Moser, P. Reichart, C. Greubel, G. Dollinger, Nucl. Instr. and Meth. B 269 (2011) 2217.

The file must be placed in the data directory.

Script to create a table from SigmaCalc

The main available source of computed/estimated non-Rutherford cross-section data at any angle is the SigmaCalc database developed and maintained by Alexander Gurbich. The website specifically forbids distributing its data, which are computed on-the-fly (i.e. at each download) so Corteo users will find below a script that allows them to download a series of cross-section files at different angles, the script then generating a .ccs table to be used by CorteoUi. The table generated contains the header of one of the files downloaded from SigmaCalc for reference. Please cite that info when you use these data. And please remember that it is forbidden to distribute these tables since they contain the data from SigmaCalc website.

Here is the script. In runs only in Python 2.7 and requires a number of libraries; see the import commands at the beginning of the script.

The .ccs file generated must be placed in the data directory. The user has to check in the file header that the units were indeed "rr" (that is, ratio-to-Rutherford), and append "_RR" to the filename, before the ".ccs" extension.

Generating the scattering and stopping tables

Although the version 20130715 comes with scattering tables already computed, the user may want to generate new tables. One particular reason is that the scattering matrix that is included considers the ZBL (Universal) potential. One could want to try computing with a different screening function. From the command line, run corteosetup without argument; it will show the different options. Choices of screening include: none (i.e. plain Coulomb potential), Lenz-Jensen (on which the Andersen screening is based), and Universal (i.e. ZBL).

Would the user want to generate again the stopping tables:

Running on a cluster

CorteoUi, since version 20130715, includes two new buttons at the top right of the parameters panel. These buttons are intended to make easier running long simulations (such as Full RBS simulations) on a computer cluster and reading back the results in CorteoUi. The 4th button will save the corteo input file corteo.in but will not run corteo. The 5th button will read the file corteo.detect resulting from running corteo for an IBA simulation.

One aspect important to understand when running on a cluster is that corteo (the simulation program itself, not the UI) is multi-threaded but relies a lot on central data shared by the different threads, namely the scattering matrix and the stopping power. This information is read by all thread from the same memory. More specifically, corteo supports threads but not information transfer between nodes such as MPI would provide.

So the way to run corteo on a cluster is to run an array of jobs, each initialized with a different random seed. If the user wants to run on 100 cores of a cluster featuring 4 cores per node, in the CorteoUi/Compute panel, he/she should specify 4 threads (i.e. a number of threads equal to the number of cores in one node) or 8 threads if the core supports hyper-threading, then save the corteo input file corteo.in using the 4th button.

Then, the user has to upload on the cluster the file corteo.in as well as the src/corteo directory. On the cluster, he has to compile corteo with the compiler specific to the cluster. For example, if the Intel C Compiler (icc) is available (which accelerates computations by 5-10% over gcc), one can compile corteo with the following command:

  icc  -o corteo src/corteo/constants.c src/corteo/corteoindex.c src/corteo/corteoutil.c src/corteo/corteo.c src/corteo/corteomatrix.c src/corteo/randomx.c src/corteo/corteodedx.c -lm -lpthread -O2

Then, to run an array of jobs using qsub or the like, prepare a file containing infos similar to this (usually varies a bit between different systems).

#!/bin/csh
#
#PBS -l mem=1000mb
#PBS -l walltime=15:00:00
#PBS -l nodes=1:ppn=8
#PBS -j oe
#PBS -W umask=022
#PBS -r n
#PBS -t 25-49
#PBS -o FilenameForStandardOutputOfThisRun.res
cd /somedirectory/username/directoryWhereCorteoIs
./corteo $PBS_ARRAYID

In order to estimate the walltime, the user can run a single simulation with 1/100th of the number of simulated ions of the simulation he/she actually want to run. (Also check how much data is produced during this test, so the cluster is not overwhelmed with data during the full run.) nodes is set to 1 because each job will run on one node (no MPI). ppn is the number of processor per node; the number of threads in corteo.in should be set to this value. The -t switch specifies the index range of the array of jobs that will be submitted. In this example, the job ID will range from 25 to 49, each running on 8 cores, for a total of 200 cores. In the last line $PBS_ARRAYID is passed as an argument to corteo, which will use this value as a seed to initialize the random number generator of each job.

Keep in mind that running 15h on 200 cores may exhaust your priority for submitting new jobs rather quickly!

Bugs and features

Updates

Update 16 August 2016: With this version of Corteo, it is now possible to consider 2D (pixels) and 3D (voxels) targets. An image containing a (limited) number of color can be loaded, each color representing a material which composition is defined the same way a layer composition is defined. (The image can for example be derived from a micrograph, therefore severely constraining the solution of the fit.) A substrate layer can also be defined. This for example allows the definition of a rough interface below a layer since the substrate can have the same composition as one of the colors in the image. 2D images can be in .bmp, .gif, .png format. 3D voxel images loaded in CorteoUi must be in XRAW format as produced with MagicaVoxel (free, Mac and Windows versions available). The image format used by the simulation engine corteo is a much simpler text file. See the manual for a description.

The 20160816 version also allows interpolation of the cross-section in a table, and such table can be generated from SigmaCalc using a Python script (see above).

Update 15 July 2013: This version of Corteo brings no fundamental chances to the physics. It is rather an internal rework of how things are processed. In the previous versions, corteo could run the simulation of one isotope of one element in one layer at the time, and CorteoUi was controlling the process to obtain a complete spectrum by starting several simulations. In the new version, this is rather achieved by corteo itself. The purpose is that the complete simulation can be carried out in one run on a separate machine, e.g., a computer cluster. The other important aspect that has changed is that rather the producing spectra, corteo now produces an event list. If the parameter 'writedetails' is set to '0' in corteo.in (as CorteoUi always does), it gives the detection energy and a few other values such as the cross-section and angle at collision, depending on the technique selected. For details, see the first line of corteo.detect, the file produced by corteo. The power-users may want much more details, such as the locus of the main collision, the impact position on the detector, or the depth and angle of the 5 most largest scattering events in Full RBS. This is obtained by setting 'writedetails' to something else than '0' in corteo.in. Again, see the first line of corteo.detect for details. (The column titles in the first line are usually the name of the variable that are printed and are hopefully self explanatory, but in doubt, see the corteo.c sourcecode which will tell you precisely what is the meaning of a variable.)

Be careful however, it spits a lot! The demonstration simulation when you start CorteoUi the first time generates a 50 Mb file. You can easily reach Gb of data if many, many events are detected, especially on a cluster.

Because corteo generates a list of events, the spectra are computed when reading the corteo.detect file. Hence, the user can change the detector calibration or resolution and simply reload the results of the simulation by clicking the 5th button. Spectra can also be generated in another software by generating a histogram where each event increment a bin by the cross-section. The spectrum then has to be convoluted for the detector resolution.

Last but not least: this version features the possibility of carrying 'Full RBS' simulations, that is, following the trajectory of billions of ions and detecting them, therefore avoiding the 'main collision' approximation: each detected event bears an equal weight. It is especially useful to simulate the contribution of many low-angle scattering to the spectrum background. More details to come, hopefully in the proceedings of IBA 2013.

Update 27 May 2009: Corteo20090527 repairs two important bugs, but contains several new developments. It should now be quite reliable as it has gone through most of the intercomparison exercises and gives results virtually identical to SimNRA/NDF when deflections are "turned off" during atoms slowdown. (A detailed intercomparison will be presented at IBA 2009.)

Update 20 February 2009: Documentation now available (see above).

Update 4 December 2008: This version of Corteo Corteo20081204 contains important bug repairs and new functions implementation:

As usual, Windows users that already installed a previous version can only replace the executables.

Update 18 September 2008: Correction of a glitch : on relatively slow computers, the simulation takes too long to start and the user interface displays a (meaningless) message: "Can't find number of threads".

Update 17 September 2008: Previous version contained a bug that made simulation endless when a foil was specified (thanks Zdravko). A bad choice in random list lengths is also corrected, and the lists should now cycle only every 7.5x1015 collisions. For those who have seen my poster at the IBMM in Dresden, this was responsible for some features in implantation profiles. That version was also not compilable neither runable under Linux due to several mistakes. The new version should work properly under both Linux and Windows, although not tested under Mac. It includes the necessary modifications to run SRIM's SRModule using Wine under Linux. The steps below have been updated for Linux users. Windows users that have already installed the previous version may only copy the executables (*.exe) of the new version to the existing Corteo directory, instead of going through the setup process.''

Over versions prior to 17 September 2008, Corteo features:

Feedback/problems

Feedback is strongly appreciated. If you run into problems, please send an e-mail giving the best description possible, indicate what version you are using (name of the zip file), close the Corteo user interface, and attach the Corteo.cml file to your message.

Good luck,

François

Retrieved from http://www.lps.umontreal.ca/~schiette/index.php?n=Recherche.Corteo
Page last modified on 2016-08-18, 12:59