Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sten Delos
Gadget4
Commits
ed4f64a3
Commit
ed4f64a3
authored
Oct 05, 2020
by
Volker Springel
Browse files
some clean-up
parent
dc311347
Changes
11
Hide whitespace changes
Inline
Side-by-side
Template-Config.sh
View file @
ed4f64a3
...
...
@@ -200,7 +200,3 @@ HOST_MEMORY_REPORTING # reports after start-up the available system me
#TREE_NO_SAFETY_BOX # when set, this disables the geometric 'near node' protection
#---------------------------------------- Postprocessing options
#LGALAXIES # Semi-analytic L-Galaxies code
documentation/04_config-options.md
View file @
ed4f64a3
...
...
@@ -1584,13 +1584,3 @@ i.e. for the one-sided tree, one may then be closer to a node's center
than 1.5 times the node size, and for FMM, adjacent nodes may
interact.
Postprocessing options {#postproc}
======================
**LGALAXIES**
This enables a semi-analytic code that can run directly on the trees
output by the code.
-------
src/data/dtypes.h
View file @
ed4f64a3
...
...
@@ -320,8 +320,6 @@ enum restart_options
RST_CALCDESC
,
RST_MAKETREES
,
RST_IOBANDWIDTH
,
RST_LCIMAGE
,
RST_LGALAXIES
,
RST_LCREARRANGE
,
RST_SNPREARRANGE
};
...
...
src/data/simparticles.h
View file @
ed4f64a3
...
...
@@ -84,10 +84,6 @@ class simparticles : public intposconvert, public setcomm
lightcone
*
LightCone
;
#endif
#ifdef LGALAXIES
parttrees_table
PartTreeTable
[
1
];
// need only one entry
#endif
#ifdef FOF
MyIDStorage
*
MinID
;
int
*
Len
;
// this is here enough in 32bit because only the group segments on the local processor are treated
...
...
src/fof/fof.h
View file @
ed4f64a3
...
...
@@ -136,7 +136,7 @@ class fof : public setcomm
};
subhalo_properties
*
Subhalo
;
#if defined(MERGERTREE)
|| defined(LGALAXIES)
#if defined(MERGERTREE)
/* Subhalos as they appear in the merger tree */
struct
treehalo_t
{
...
...
src/io/io.h
View file @
ed4f64a3
...
...
@@ -176,7 +176,7 @@ class IO_Def : public io_streamcount, public setcomm
long
long
*
ntype_in_files
;
char
info
[
100
];
#if defined(MERGERTREE)
|| defined(LGALAXIES)
#if defined(MERGERTREE)
typedef
fof
<
simparticles
>::
treehalo_t
treehalo_type
;
#endif
...
...
src/io/snap_io.cc
View file @
ed4f64a3
...
...
@@ -241,87 +241,6 @@ void snap_io::init_extra(simparticles *Sp_ptr, mergertree *MergerTree_ptr)
}
#endif
#if defined(LGALAXIES)
void
snap_io
::
init_extra_lgalaxies
(
void
)
{
#ifdef REARRANGE_OPTION
init_field
(
"MTRI"
,
"TreeID"
,
MEM_INT64
,
FILE_INT64
,
READ_IF_PRESENT
,
1
,
A_P
,
&
Sp
->
P
[
0
].
TreeID
,
NULL
,
ALL_TYPES
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
#endif
init_field
(
"MTRL"
,
"ParticleCount"
,
MEM_INT
,
FILE_INT
,
READ_IF_PRESENT
,
1
,
A_CT
,
&
Sp
->
PartTreeTable
[
0
].
ParticleCount
,
NULL
,
TREETABLE
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
init_field
(
"MTRS"
,
"ParticleFirst"
,
MEM_INT64
,
FILE_INT64
,
READ_IF_PRESENT
,
1
,
A_CT
,
&
Sp
->
PartTreeTable
[
0
].
ParticleFirst
,
NULL
,
TREETABLE
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
init_field
(
"MTRI"
,
"TreeID"
,
MEM_INT64
,
FILE_INT64
,
READ_IF_PRESENT
,
1
,
A_CT
,
&
Sp
->
PartTreeTable
[
0
].
TreeID
,
NULL
,
TREETABLE
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
}
void
snap_io
::
free_basic_treeinfo
(
void
)
{
Mem
.
myfree
(
ntype_in_files
);
}
int
snap_io
::
acquire_basic_treeinfo
(
int
num
,
mysnaptype
loc_snap_type
)
{
snap_type
=
loc_snap_type
;
if
(
snap_type
!=
MOST_BOUND_PARTICLE_SNAPHOT_REORDERED
)
Terminate
(
"bummmer"
);
char
fname
[
3
*
MAXLEN_PATH
],
fname_multiple
[
3
*
MAXLEN_PATH
];
sprintf
(
fname_multiple
,
"%s/snapdir_%03d/%s-prevmostboundonly-treeorder_%03d"
,
All
.
OutputDir
,
num
,
All
.
SnapshotFileBase
,
num
);
sprintf
(
fname
,
"%s%s-prevmostboundonly-treeorder_%03d"
,
All
.
OutputDir
,
All
.
SnapshotFileBase
,
num
);
int
num_files
=
find_files
(
fname
,
fname_multiple
);
if
(
num_files
>
1
)
strcpy
(
fname
,
fname_multiple
);
alloc_and_read_ntype_in_files
(
fname
,
num_files
);
return
num_files
;
}
long
long
snap_io
::
load_orphans
(
int
num
,
long
long
treenr
,
int
num_files
)
{
char
fname
[
3
*
MAXLEN_PATH
];
if
(
num_files
>
1
)
sprintf
(
fname
,
"%s/snapdir_%03d/%s-prevmostboundonly-treeorder_%03d"
,
All
.
OutputDir
,
num
,
All
.
SnapshotFileBase
,
num
);
else
sprintf
(
fname
,
"%s%s-prevmostboundonly-treeorder_%03d"
,
All
.
OutputDir
,
All
.
SnapshotFileBase
,
num
);
read_segment
(
fname
,
NTYPES
,
treenr
,
1
,
num_files
);
long
long
count
=
Sp
->
PartTreeTable
[
0
].
ParticleCount
;
long
long
first
=
Sp
->
PartTreeTable
[
0
].
ParticleFirst
;
Sp
->
P
=
(
particle_data
*
)
Mem
.
mymalloc_movable
(
&
Sp
->
P
,
"Sp->P"
,
count
*
sizeof
(
particle_data
));
Sp
->
NumPart
=
0
;
#ifndef OUTPUT_COORDINATES_AS_INTEGERS
Ptmp
=
(
ptmp_data
*
)
Mem
.
mymalloc_movable
(
&
Ptmp
,
"Ptmp"
,
count
*
sizeof
(
ptmp_data
));
#endif
read_segment
(
fname
,
1
,
first
,
count
,
num_files
);
#ifndef OUTPUT_COORDINATES_AS_INTEGERS
snap_init_domain_mapping
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
Sp
->
pos_to_intpos
(
Ptmp
[
i
].
Pos
,
Sp
->
P
[
i
].
IntPos
);
/* converts floating point representation to integers */
Mem
.
myfree
(
Ptmp
);
#endif
if
(
count
>
0
&&
Sp
->
NumPart
!=
count
)
Terminate
(
"Sp->NumPart=%d != count=%d"
,
(
int
)
Sp
->
NumPart
,
(
int
)
count
);
return
count
;
}
void
snap_io
::
free_orphans
(
void
)
{
Mem
.
myfree
(
Sp
->
P
);
}
#endif
void
snap_io
::
read_snapshot
(
int
num
,
mysnaptype
loc_snap_type
)
{
snap_type
=
loc_snap_type
;
...
...
@@ -618,10 +537,6 @@ void *snap_io::get_base_address_of_structure(enum arrays array, int index)
#if defined(REARRANGE_OPTION) && defined(MERGERTREE)
case
A_TT
:
return
(
void
*
)(
MergerTree
->
TreeTable
+
index
);
#endif
#if defined(LGALAXIES)
case
A_CT
:
return
(
void
*
)(
Sp
->
PartTreeTable
+
index
);
#endif
default:
Terminate
(
"we don't expect to get here"
);
...
...
src/io/snap_io.h
View file @
ed4f64a3
...
...
@@ -17,13 +17,8 @@
#include
"../data/intposconvert.h"
#include
"../data/simparticles.h"
#include
"../io/io.h"
#include
"../lgalaxies/lgalaxies.h"
#include
"../mergertree/mergertree.h"
#ifdef LGALAXIES
class
lgalaxies
;
#endif
class
snap_io
:
public
IO_Def
{
public:
...
...
@@ -40,15 +35,6 @@ class snap_io : public IO_Def
}
#endif
#if defined(LGALAXIES)
void
init_extra_lgalaxies
(
void
);
snap_io
(
simparticles
*
Sp_ptr
,
MPI_Comm
comm
,
int
format
,
bool
lgalaxies
)
:
IO_Def
(
comm
,
format
)
{
init_basic
(
Sp_ptr
);
init_extra_lgalaxies
();
}
#endif
void
write_snapshot
(
int
num
,
mysnaptype
snap_type
);
void
read_snapshot
(
int
num
,
mysnaptype
snap_type
);
...
...
@@ -140,9 +126,6 @@ class snap_io : public IO_Def
#ifdef MERGERTREE
mergertree
*
MergerTree
;
#endif
#ifdef LGALAXIES
lgalaxies
*
LGalaxies
;
#endif
mysnaptype
snap_type
;
...
...
src/main/begrun.cc
View file @
ed4f64a3
...
...
@@ -174,8 +174,7 @@ void sim::begrun1(const char *parameterFile)
else
All
.
OutputListLength
=
0
;
if
(
All
.
RestartFlag
!=
RST_LGALAXIES
)
All
.
write_used_parameters
(
All
.
OutputDir
,
"parameters-usedvalues"
);
All
.
write_used_parameters
(
All
.
OutputDir
,
"parameters-usedvalues"
);
All
.
some_parameter_checks
();
...
...
src/main/main.cc
View file @
ed4f64a3
...
...
@@ -188,9 +188,6 @@ int main(int argc, char **argv)
printf
(
" %2d Arrange halos in merger trees [using group catalogues up to SnapNum]
\n
"
,
RST_MAKETREES
);
printf
(
" %2d Carry out I/O bandwidth test to determine best setting for number of concurrent reads/writes
\n
"
,
RST_IOBANDWIDTH
);
printf
(
" %2d Make an image of a lightcone particle output [image parameterfile]
\n
"
,
RST_LCIMAGE
);
printf
(
" %2d Produce semi-analytic galaxies by running LGalaxies [lgal-parameterfile <conenr>]
\n
"
,
RST_LGALAXIES
);
printf
(
" %2d Rearrange particle-lightcone data in merger tree order <conenr> <firstnum> <lastnum>
\n
"
,
RST_LCREARRANGE
);
printf
(
" %2d Rearrange most-bound snapshot data in merger tree order <firstnum> <lastnum>
\n
"
,
...
...
@@ -276,26 +273,6 @@ int main(int argc, char **argv)
Sim
.
endrun
();
}
if
(
All
.
RestartFlag
==
RST_LCIMAGE
)
{
#if defined(LIGHTCONE) && defined(LIGHTCONE_PARTICLES)
Sim
.
LightCone
.
makeimage
(
argc
,
argv
);
Sim
.
endrun
();
#else
Terminate
(
"Compile with option LIGHTCONE_PARTICLES for this option"
);
#endif
}
if
(
All
.
RestartFlag
==
RST_LGALAXIES
)
{
#ifdef LGALAXIES
Sim
.
LGalaxies
.
compute_semi_analytic_galaxies
(
argc
,
argv
);
Sim
.
endrun
();
#else
Terminate
(
"Compile with option LGALAXIES for this option"
);
#endif
}
if
(
All
.
RestartFlag
==
RST_LCREARRANGE
)
{
#if defined(LIGHTCONE) && defined(LIGHTCONE_PARTICLES) && defined(REARRANGE_OPTION)
...
...
src/main/simulation.h
View file @
ed4f64a3
...
...
@@ -35,7 +35,6 @@
#include
"../io/parameters.h"
#include
"../io/restart.h"
#include
"../io/test_io_bandwidth.h"
#include
"../lgalaxies/lgalaxies.h"
#include
"../lightcone/lightcone.h"
#include
"../logs/logs.h"
#include
"../mergertree/mergertree.h"
...
...
@@ -103,14 +102,6 @@ class sim : public pinning, public test_io_bandwidth
#endif
#endif // end of LIGHTCONE
#ifdef LGALAXIES
#if defined(LIGHTCONE_PARTICLES)
lgalaxies
LGalaxies
{
Communicator
,
&
LightCone
};
#else
lgalaxies
LGalaxies
{
Communicator
};
#endif
#endif
#ifdef FORCETEST
gravtest
GravTest
{
&
Sp
,
&
GravTree
,
&
Domain
};
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment