Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121636112
galloc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jul 12, 16:57
Size
3 KB
Mime Type
text/x-python
Expires
Mon, Jul 14, 16:57 (2 d)
Engine
blob
Format
Raw Data
Handle
27363959
Attached To
rGTOOLS Gtools
galloc
View Options
#!/usr/bin/env python
from
optparse
import
OptionParser
def
parse_options
():
usage
=
"usage: %prog [options] file"
parser
=
OptionParser
(
usage
=
usage
)
parser
.
add_option
(
"--TotNumPart"
,
action
=
"store"
,
dest
=
"TotNumPart"
,
type
=
"float"
,
default
=
0
,
help
=
"TotNumPart"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--TotN_gas"
,
action
=
"store"
,
dest
=
"TotN_gas"
,
type
=
"float"
,
default
=
0
,
help
=
"TotN_gas"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--TotN_stars"
,
action
=
"store"
,
dest
=
"TotN_stars"
,
type
=
"float"
,
default
=
0
,
help
=
"TotN_stars"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--NTask"
,
action
=
"store"
,
dest
=
"NTask"
,
type
=
"float"
,
default
=
1
,
help
=
"NTask"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--StarFormationNStarsFromGas"
,
action
=
"store"
,
dest
=
"StarFormationNStarsFromGas"
,
type
=
"float"
,
default
=
4
,
help
=
"StarFormationNStarsFromGas"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--PartAllocFactor"
,
action
=
"store"
,
dest
=
"PartAllocFactor"
,
type
=
"float"
,
default
=
4.0
,
help
=
"PartAllocFactor"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--StarsAllocFactor"
,
action
=
"store"
,
dest
=
"StarsAllocFactor"
,
type
=
"float"
,
default
=
0.25
,
help
=
"StarsAllocFactor"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--sizeof_particle_data"
,
action
=
"store"
,
dest
=
"sizeof_particle_data"
,
type
=
"float"
,
default
=
72
,
help
=
"sizeof_particle_data"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--sizeof_sph_particle_data"
,
action
=
"store"
,
dest
=
"sizeof_sph_particle_data"
,
type
=
"float"
,
default
=
120
,
help
=
"sizeof_sph_particle_data"
,
metavar
=
" FLOAT"
)
parser
.
add_option
(
"--sizeof_st_particle_data"
,
action
=
"store"
,
dest
=
"sizeof_st_particle_data"
,
type
=
"float"
,
default
=
136
,
help
=
"sizeof_st_particle_data"
,
metavar
=
" FLOAT"
)
(
options
,
args
)
=
parser
.
parse_args
()
files
=
args
return
files
,
options
#######################################
# MakePlot
#######################################
files
,
opt
=
parse_options
()
TotNumPart
=
opt
.
TotNumPart
TotN_gas
=
opt
.
TotN_gas
TotN_stars
=
opt
.
TotN_stars
NTask
=
opt
.
NTask
StarFormationNStarsFromGas
=
opt
.
StarFormationNStarsFromGas
PartAllocFactor
=
opt
.
PartAllocFactor
StarsAllocFactor
=
opt
.
StarsAllocFactor
sizeof_particle_data
=
opt
.
sizeof_particle_data
sizeof_sph_particle_data
=
opt
.
sizeof_sph_particle_data
sizeof_st_particle_data
=
opt
.
sizeof_st_particle_data
MaxPart
=
PartAllocFactor
*
(
TotNumPart
/
NTask
);
MaxPartSph
=
PartAllocFactor
*
(
TotN_gas
/
NTask
);
MaxPartStars
=
PartAllocFactor
*
(
TotN_stars
/
NTask
);
MaxPartStars
=
MaxPartStars
+
StarFormationNStarsFromGas
*
MaxPartSph
*
StarsAllocFactor
;
P_memory
=
MaxPart
*
sizeof_particle_data
/
(
1024.0
*
1024.0
)
SphP_memory
=
MaxPartSph
*
sizeof_sph_particle_data
/
(
1024.0
*
1024.0
)
StP_memory
=
MaxPartStars
*
sizeof_st_particle_data
/
(
1024.0
*
1024.0
)
print
"P :
%g
MByte"
%
P_memory
print
"SphP :
%g
MByte"
%
SphP_memory
print
"StP :
%g
MByte"
%
StP_memory
print
"-----------------------------------------------"
print
"Tot :
%g
MByte"
%
(
P_memory
+
SphP_memory
+
StP_memory
)
Event Timeline
Log In to Comment