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
e48aa70d
Commit
e48aa70d
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Implemented serial i/o reads
parent
1330a303
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!121
Gpart mpi io
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
examples/main.c
+1
-1
1 addition, 1 deletion
examples/main.c
src/common_io.h
+3
-0
3 additions, 0 deletions
src/common_io.h
src/serial_io.c
+4
-1
4 additions, 1 deletion
src/serial_io.c
src/serial_io.h
+2
-1
2 additions, 1 deletion
src/serial_io.h
src/single_io.c
+0
-3
0 additions, 3 deletions
src/single_io.c
with
10 additions
and
6 deletions
examples/main.c
+
1
−
1
View file @
e48aa70d
...
...
@@ -359,7 +359,7 @@ int main(int argc, char *argv[]) {
read_ic_parallel
(
ICfileName
,
dim
,
&
parts
,
&
Ngas
,
&
periodic
,
myrank
,
nr_nodes
,
MPI_COMM_WORLD
,
MPI_INFO_NULL
);
#else
read_ic_serial
(
ICfileName
,
dim
,
&
parts
,
&
Ngas
,
&
periodic
,
myrank
,
nr_nodes
,
read_ic_serial
(
ICfileName
,
dim
,
&
parts
,
&
gparts
,
&
Ngas
,
&
Ngpart
,
&
periodic
,
myrank
,
nr_nodes
,
MPI_COMM_WORLD
,
MPI_INFO_NULL
);
#endif
#else
...
...
This diff is collapsed.
Click to expand it.
src/common_io.h
+
3
−
0
View file @
e48aa70d
...
...
@@ -70,6 +70,9 @@ enum PARTICLE_TYPE {
NUM_PARTICLE_TYPES
};
#define FILENAME_BUFFER_SIZE 150
#define PARTICLE_GROUP_BUFFER_SIZE 20
hid_t
hdf5Type
(
enum
DATA_TYPE
type
);
size_t
sizeOfType
(
enum
DATA_TYPE
type
);
...
...
This diff is collapsed.
Click to expand it.
src/serial_io.c
+
4
−
1
View file @
e48aa70d
...
...
@@ -390,6 +390,9 @@ void writeArrayBackEnd(hid_t grp, char* fileName, FILE* xmfFile, char* name,
/* Import the right hydro definition */
#include
"hydro_io.h"
/* Import the right gravity definition */
#include
"gravity_io.h"
/**
* @brief Reads an HDF5 initial condition file (GADGET-3 type)
...
...
@@ -499,7 +502,7 @@ void read_ic_serial(char* fileName, double dim[3], struct part** parts,
bzero
(
*
parts
,
*
Ngas
*
sizeof
(
struct
part
));
/* Allocate memory to store all particles */
Ndm
=
N
[
1
];
const
size_t
Ndm
=
N
[
1
];
*
Ngparts
=
N
[
1
]
+
N
[
0
];
if
(
posix_memalign
((
void
*
)
gparts
,
gpart_align
,
*
Ngparts
*
sizeof
(
struct
gpart
))
!=
0
)
error
(
"Error while allocating memory for gravity particles"
);
...
...
This diff is collapsed.
Click to expand it.
src/serial_io.h
+
2
−
1
View file @
e48aa70d
...
...
@@ -32,7 +32,8 @@
#if defined(HAVE_HDF5) && defined(WITH_MPI) && !defined(HAVE_PARALLEL_HDF5)
void
read_ic_serial
(
char
*
fileName
,
double
dim
[
3
],
struct
part
**
parts
,
size_t
*
N
,
int
*
periodic
,
int
mpi_rank
,
int
mpi_size
,
struct
gpart
**
gparts
,
size_t
*
Ngas
,
size_t
*
Ngparts
,
int
*
periodic
,
int
mpi_rank
,
int
mpi_size
,
MPI_Comm
comm
,
MPI_Info
info
);
void
write_output_serial
(
struct
engine
*
e
,
struct
UnitSystem
*
us
,
int
mpi_rank
,
...
...
This diff is collapsed.
Click to expand it.
src/single_io.c
+
0
−
3
View file @
e48aa70d
...
...
@@ -39,9 +39,6 @@
#include
"common_io.h"
#include
"error.h"
#define FILENAME_BUFFER_SIZE 150
#define PARTICLE_GROUP_BUFFER_SIZE 20
/*-----------------------------------------------------------------------------
* Routines reading an IC file
*-----------------------------------------------------------------------------*/
...
...
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