Skip to content

sync master with dev #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin
Submodule bin updated from 170b07 to 3b8ebb
31 changes: 16 additions & 15 deletions examples/ex-hllhc-fxxxx/ex-hllhc-fxxxx.mad
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ local function get_rdt(lhc, X0, rdt)
collectgarbage() ; collectgarbage()
local t0, m0 = os.clock(), collectgarbage("count")

local mtbl, mflw = twiss {sequence=lhc, X0=X0, trkrdt=rdt, info=2}
local mtbl, mflw = twiss {sequence=lhc, X0=X0, trkrdt=rdt}

collectgarbage() ; collectgarbage()
local t1, m1 = os.clock(), collectgarbage("count")
Expand Down Expand Up @@ -166,20 +166,14 @@ end

-- list of RDTs

local rdts = {
"f40000000",
"f40000010",
"f40000020",
"f40000001",
"f40000002",
"f40000011",
}
--[[
local rdts = {
"f4000",
"f3100",
"f2020",
"f1120",
}
--[[
local rdts = {

"f4000001",
"f3100001",
Expand All @@ -190,6 +184,13 @@ local rdts = {
"f31000001",
"f20200001",
"f11200001",

"f40000000",
"f40000010",
"f40000020",
"f40000001",
"f40000002",
"f40000011",
}
--]]

Expand All @@ -207,15 +208,15 @@ printf("** %s **\n", lhc.name)
local knb = knbs[lhc.name]

-- create phase space damap at 5th order
local X0 = damap{nv=6, mo=6, np=2, po=2, pn=knb}
local X0 = damap{nv=6, mo=4}--, np=2, po=2, pn=knb}

MADX[knb[1]] = MADX[knb[1]] + X0[knb[1]]
MADX[knb[2]] = MADX[knb[2]] + X0[knb[2]]
--MADX[knb[1]] = MADX[knb[1]] + X0[knb[1]]
--MADX[knb[2]] = MADX[knb[2]] + X0[knb[2]]

local mtbl = get_rdt(lhc, X0, rdts)

MADX[knb[1]] = X0[knb[1]]:get0()
MADX[knb[2]] = X0[knb[2]]:get0()
--MADX[knb[1]] = X0[knb[1]]:get0()
--MADX[knb[2]] = X0[knb[2]]:get0()

-- RDTs at the end
io.write("** RDTs@end\n")
Expand Down
2 changes: 1 addition & 1 deletion examples/ex-lhc-f2002/ex-lhc-f2002.mad
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ match {

variables = vars,
equalities = equs,
objective = { bisec=3, rcond=1e-10, jstra=2 },
objective = { bisec=3, rcond=1e-10, jstra=2, method="LD_MMA" },
maxcall=250, info=4, -- debug=4
}

Expand Down
2 changes: 1 addition & 1 deletion examples/ex-lhc-f2002/ex-lhc-f2002_paper.mad
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ local X0
local function get_nf()
local _, mflw = track {sequence=lhc, save=false, X0=X0}
-- mflw[1]:get0():print("Orbit", 'line') -- uncomment to check orbit
return normal(mflw[1]):analyse();
return normal(mflw[1]):analyse('all');
end

-- create phase space damap at 4th order
Expand Down
2 changes: 1 addition & 1 deletion lib/README.lapack
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: lapack 3.11.0
Package: lapack 3.12.1

URL:
http://netlib.org/lapack
Expand Down
16 changes: 8 additions & 8 deletions lib/README.libs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
LUAJIT 2.1, LPEG 1.0, LAPACK 3.8, FFTW 3.3, NFFT 3.5, NLOPT 2.6
LUAJIT 2.1, LPEG 1.0, LAPACK 3.12, FFTW 3.3, NFFT 3.5, NLOPT 2.7

[see also README.libname for details]

LUAJIT 2.1-beta3: lib/luajit
LUAJIT 2.1.Rolling: lib/luajit
http://luajit.org

LFS 1.7: lib/lfs
https://keplerproject.github.io/luafilesystem/
LFS 1.8: lib/lfs
https://github.com/lunarmodules/luafilesystem

LPEG 1.0.2: lib/lpeg
LPEG 1.1.0: lib/lpeg
http://www.inf.puc-rio.br/~roberto/lpeg

LAPACK 3.8.0: lib/lapack
LAPACK 3.12.1: lib/lapack
http://www.netlib.org/lapack/

FFTW 3.3.8: lib/fftw3
http://www.fftw.org

NFFT 3.5.1: lib/nfft3
NFFT 3.5.3: lib/nfft3
http://www.nfft.org

NLOPT 2.6.1: lib/nlopt
NLOPT 2.7.1: lib/nlopt
http://ab-initio.mit.edu/wiki/index.php/NLopt

TODO:
Expand Down
8 changes: 4 additions & 4 deletions lib/README.lpeg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: lpeg-1.0.2
Package: lpeg-1.1

Integrated into MAD github (i.e. git pull).

Expand All @@ -8,10 +8,10 @@ URL:
Retrieve:
cd lib
+ get tarball from http://www.inf.puc-rio.br/~roberto/lpeg
: wget http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz
: wget http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz
+ extract/uncompress tarball
: tar xvzf lpeg-1.0.2.tar.gz
ln -s lpeg-1.0.2 lpeg
: tar xvzf lpeg-1.1.0.tar.gz
ln -s lpeg-1.1.0 lpeg

Build:
cd lpeg
Expand Down
18 changes: 8 additions & 10 deletions lib/README.luajit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: luajit 2.1-beta3
Package: luajit 2.1-beta3 LuaJIT 2.1.1739192907

URL:
http://luajit.org
Expand All @@ -9,30 +9,28 @@ Retrieve:
cd luajit ; git checkout mad-patch ; git pull
(should be Already up-to-date.)

Sync MAD fork:
Sync LuaJIT fork:
GitHub sync v2.1
git checkout v2.1
git pull
git checkout mad-patch
git merge v2.1

Build: retrieve | prepare | update
[macosx] export MACOSX_DEPLOYMENT_TARGET=10.8
[macosx] export MACOSX_DEPLOYMENT_TARGET=11
make clean
make amalg PREFIX=`pwd`
make install PREFIX=`pwd`
[unixes] mv bin/luajit-2.1.0-beta3 bin/luajit
[macosx] cp src/libluajit.a ../../bin/macosx
[linux] cp src/libluajit.a ../../bin/linux
[msys64] mv bin/luajit-2.1.0-beta3.exe bin/luajit.exe
" mkdir -p bin/lua
" cp -a src/lua51.dll bin/
" cp -a share/luajit-2.1.0-beta3/jit bin/lua/
" cd src ; make libluajit.a ; cp libluajit.a ../../../bin/windows
[msys64] mkdir -p bin/lua
" cp -a src/lua51.dll bin/
" cp -a share/luajit-2.1.Rolling/jit bin/lua/
" cd src ; make libluajit.a ; cp libluajit.a ../../../bin/windows

Line for macosx (example):
make clean ; make -j9 amalg PREFIX=`pwd` ; make install PREFIX=`pwd` ; \
mv bin/luajit-2.1.0-beta3 bin/luajit ; cp src/libluajit.a ../../bin/macosx
cp src/libluajit.a ../../bin/macosx

Update of lua modules in MAD src/:
rm diff.out ; \
Expand Down
8 changes: 4 additions & 4 deletions lib/README.nfft3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: nfft 3.5.1
Package: nfft 3.5.3

URL:
http://www.nfft.org
Expand All @@ -8,10 +8,10 @@ Depends: fftw3
Retrieve:
cd lib
+ get tarball from http://www.nfft.org/download.php
: wget http://www.nfft.org/download/nfft-3.5.1.tar.gz
: wget http://www.nfft.org/download/nfft-3.5.3.tar.gz
+ extract/uncompress tarball
: tar xvzf nfft-3.5.1.tar.gz
: ln -s nfft-3.5.1 nfft3
: tar xvzf nfft-3.5.3.tar.gz
: ln -s nfft-3.5.3 nfft3

from git (need libtoolize and autoreconf):
http://github.com/NFFT/nfft
Expand Down
38 changes: 38 additions & 0 deletions src/help/madh_json.mad
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--[=[
o-----------------------------------------------------------------------------o
|
| Json module (help)
|
| Methodical Accelerator Design - Copyright (c) 2016+
| Support: http://cern.ch/mad - mad at cern.ch
| Authors: L. Deniau, laurent.deniau at cern.ch
| Contrib: -
|
o-----------------------------------------------------------------------------o
| You can redistribute this file and/or modify it under the terms of the GNU
| General Public License GPLv3 (or later), as published by the Free Software
| Foundation. This file is distributed in the hope that it will be useful, but
| WITHOUT ANY WARRANTY OF ANY KIND. See http://gnu.org/licenses for details.
o-----------------------------------------------------------------------------o
]=]

local __help = {}

-- help -----------------------------------------------------------------------o

__help.json = [=[
NAME
json -- json encode and decode

SYNOPSIS

DESCRIPTION
see https://github.com/rxi/json.lua

EXAMPLES

SEE ALSO
]=]

-- end ------------------------------------------------------------------------o
return __help
3 changes: 1 addition & 2 deletions src/ljit_bc.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
----------------------------------------------------------------------------
-- LuaJIT bytecode listing module.
--
-- Copyright (C) 2005-2022 Mike Pall. All rights reserved.
-- Copyright (C) 2005-2025 Mike Pall. All rights reserved.
-- Released under the MIT license. See Copyright Notice in luajit.h
----------------------------------------------------------------------------
--
Expand Down Expand Up @@ -41,7 +41,6 @@

-- Cache some library functions and objects.
local jit = require("jit")
assert(jit.version_num == 20100, "LuaJIT core/library version mismatch")
local jutil = require("jit.util")
local vmdef = require("ljit_vmdef")
local bit = require("bit")
Expand Down
Loading