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
757d2502
Commit
757d2502
authored
7 years ago
by
lhausamm
Committed by
Loic Hausammann
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
File Header working
parent
fb100c1b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!502
Logger
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/logger.c
+3
-3
3 additions, 3 deletions
src/logger.c
src/logger.h
+1
-1
1 addition, 1 deletion
src/logger.h
with
4 additions
and
4 deletions
src/logger.c
+
3
−
3
View file @
757d2502
...
...
@@ -304,9 +304,7 @@ void logger_write_file_header(struct dump *dump) {
memcpy
(
buff
,
LOGGER_VERSION
,
LOGGER_VERSION_SIZE
);
/* write number of bytes used for the offsets */
message
(
"Start %lu"
,
*
file_offset
);
buff
=
dump_get
(
dump
,
LOGGER_OFFSET_SIZE
,
file_offset
);
message
(
"End %lu"
,
*
file_offset
);
memcpy
(
buff
,
&
log_const
.
offset
,
LOGGER_OFFSET_SIZE
);
/* will write the offset of the first particle here */
...
...
@@ -320,6 +318,7 @@ void logger_write_file_header(struct dump *dump) {
buff
=
dump_get
(
dump
,
LOGGER_NBER_SIZE
,
file_offset
);
memcpy
(
buff
,
&
log_const
.
number
,
LOGGER_NBER_SIZE
);
/* write masks */
mask_size
=
log_const
.
nber_mask
*
(
log_const
.
name
+
log_const
.
mask
);
name_buff
=
dump_get
(
dump
,
mask_size
,
file_offset
);
for
(
i
=
0
;
i
<
log_const
.
nber_mask
;
i
++
)
{
...
...
@@ -337,6 +336,7 @@ void logger_write_file_header(struct dump *dump) {
/* last step */
memcpy
(
skip_header
,
file_offset
,
log_const
.
offset
);
message
(
"First offset %lu"
,
*
file_offset
);
logger_const_free
(
&
log_const
);
}
...
...
@@ -346,7 +346,7 @@ void logger_const_init(struct logger_const* log_const) {
log_const
->
mask
=
1
;
log_const
->
number
=
1
;
log_const
->
nber_mask
=
8
;
log_const
->
nber_mask
=
1
;
char
*
cur_name
;
char
tmp
[
log_const
->
name
];
...
...
This diff is collapsed.
Click to expand it.
src/logger.h
+
1
−
1
View file @
757d2502
...
...
@@ -84,7 +84,7 @@ struct dump;
* Size in bytes
*/
#define LOGGER_VERSION_SIZE 20 // size of the version message
#define LOGGER_NAME_SIZE
1
// size of the labels
#define LOGGER_NAME_SIZE
2
// size of the labels
#define LOGGER_MASK_SIZE 1 // size of the masks
#define LOGGER_NBER_SIZE 1 // size of the number of elements
#define LOGGER_OFFSET_SIZE 1// size of the offset size information
...
...
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