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
61d43697
Commit
61d43697
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Only support GADGET-SPH in the logger for now.
parent
257adafe
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/logger.c
+8
-8
8 additions, 8 deletions
src/logger.c
with
8 additions
and
8 deletions
src/logger.c
+
8
−
8
View file @
61d43697
...
@@ -134,13 +134,11 @@ void logger_log_part(struct part *p, unsigned int mask, size_t *offset,
...
@@ -134,13 +134,11 @@ void logger_log_part(struct part *p, unsigned int mask, size_t *offset,
buff
+=
3
*
sizeof
(
float
);
buff
+=
3
*
sizeof
(
float
);
}
}
#if defined(GADGET2_SPH)
/* Particle internal energy as a single float. */
/* Particle internal energy as a single float. */
if
(
mask
&
logger_mask_u
)
{
if
(
mask
&
logger_mask_u
)
{
#if defined(GADGET2_SPH)
memcpy
(
buff
,
&
p
->
entropy
,
sizeof
(
float
));
memcpy
(
buff
,
&
p
->
entropy
,
sizeof
(
float
));
#else
memcpy
(
buff
,
&
p
->
u
,
sizeof
(
float
));
#endif
buff
+=
sizeof
(
float
);
buff
+=
sizeof
(
float
);
}
}
...
@@ -164,6 +162,8 @@ void logger_log_part(struct part *p, unsigned int mask, size_t *offset,
...
@@ -164,6 +162,8 @@ void logger_log_part(struct part *p, unsigned int mask, size_t *offset,
buff
+=
sizeof
(
long
long
);
buff
+=
sizeof
(
long
long
);
}
}
#endif
/* Update the log message offset. */
/* Update the log message offset. */
*
offset
=
offset_new
;
*
offset
=
offset_new
;
}
}
...
@@ -305,13 +305,11 @@ int logger_read_part(struct part *p, size_t *offset, const char *buff) {
...
@@ -305,13 +305,11 @@ int logger_read_part(struct part *p, size_t *offset, const char *buff) {
buff
+=
3
*
sizeof
(
float
);
buff
+=
3
*
sizeof
(
float
);
}
}
#if defined(GADGET2_SPH)
/* Particle internal energy as a single float. */
/* Particle internal energy as a single float. */
if
(
mask
&
logger_mask_u
)
{
if
(
mask
&
logger_mask_u
)
{
#if defined(GADGET2_SPH)
memcpy
(
&
p
->
entropy
,
buff
,
sizeof
(
float
));
memcpy
(
&
p
->
entropy
,
buff
,
sizeof
(
float
));
#else
memcpy
(
&
p
->
u
,
buff
,
sizeof
(
float
));
#endif
buff
+=
sizeof
(
float
);
buff
+=
sizeof
(
float
);
}
}
...
@@ -335,6 +333,8 @@ int logger_read_part(struct part *p, size_t *offset, const char *buff) {
...
@@ -335,6 +333,8 @@ int logger_read_part(struct part *p, size_t *offset, const char *buff) {
buff
+=
sizeof
(
long
long
);
buff
+=
sizeof
(
long
long
);
}
}
#endif
/* Finally, return the mask of the values we just read. */
/* Finally, return the mask of the values we just read. */
return
mask
;
return
mask
;
}
}
...
...
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