Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
b7187582
Commit
b7187582
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Read the number of particles in a file using a long long and not an int.
parent
53b04e19
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!310
Star particles and gparts links over MPI
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parallel_io.c
+7
-8
7 additions, 8 deletions
src/parallel_io.c
with
7 additions
and
8 deletions
src/parallel_io.c
+
7
−
8
View file @
b7187582
...
...
@@ -383,8 +383,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
hid_t
h_file
=
0
,
h_grp
=
0
;
/* GADGET has only cubic boxes (in cosmological mode) */
double
boxSize
[
3
]
=
{
0
.
0
,
-
1
.
0
,
-
1
.
0
};
int
numParticles
[
NUM_PARTICLE_TYPES
]
=
{
0
};
int
numParticles_highWord
[
NUM_PARTICLE_TYPES
]
=
{
0
};
long
long
numParticles
[
NUM_PARTICLE_TYPES
]
=
{
0
};
long
long
numParticles_highWord
[
NUM_PARTICLE_TYPES
]
=
{
0
};
size_t
N
[
NUM_PARTICLE_TYPES
]
=
{
0
};
long
long
N_total
[
NUM_PARTICLE_TYPES
]
=
{
0
};
long
long
offset
[
NUM_PARTICLE_TYPES
]
=
{
0
};
...
...
@@ -430,8 +430,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
readAttribute
(
h_grp
,
"Flag_Entropy_ICs"
,
INT
,
flag_entropy_temp
);
*
flag_entropy
=
flag_entropy_temp
[
0
];
readAttribute
(
h_grp
,
"BoxSize"
,
DOUBLE
,
boxSize
);
readAttribute
(
h_grp
,
"NumPart_Total"
,
UINT
,
numParticles
);
readAttribute
(
h_grp
,
"NumPart_Total_HighWord"
,
UINT
,
numParticles_highWord
);
readAttribute
(
h_grp
,
"NumPart_Total"
,
LONGLONG
,
numParticles
);
readAttribute
(
h_grp
,
"NumPart_Total_HighWord"
,
LONGLONG
,
numParticles_highWord
);
for
(
int
ptype
=
0
;
ptype
<
NUM_PARTICLE_TYPES
;
++
ptype
)
N_total
[
ptype
]
=
((
long
long
)
numParticles
[
ptype
])
+
...
...
@@ -441,10 +441,9 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
dim
[
1
]
=
(
boxSize
[
1
]
<
0
)
?
boxSize
[
0
]
:
boxSize
[
1
];
dim
[
2
]
=
(
boxSize
[
2
]
<
0
)
?
boxSize
[
0
]
:
boxSize
[
2
];
/* message("Found %d particles in a %speriodic box of size
* [%f %f %f].", */
/* N_total, (periodic ? "": "non-"), dim[0],
* dim[1], dim[2]); */
/* message("Found %lld particles in a %speriodic box of size [%f %f %f].", */
/* N_total[0], (periodic ? "": "non-"), dim[0], */
/* dim[1], dim[2]); */
/* Divide the particles among the tasks. */
for
(
int
ptype
=
0
;
ptype
<
NUM_PARTICLE_TYPES
;
++
ptype
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment