Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
TurTLE
TurTLE
Commits
69b05e24
There was a problem fetching the pipeline summary.
Commit
69b05e24
authored
8 years ago
by
Berenger Bramas
Committed by
Cristian Lalescu
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update to test if data exists
parent
af2de0ee
No related branches found
No related tags found
2 merge requests
!21
Bugfix/nansampling
,
!19
Feature/sampling new particles test (extension of Update particles sampling for variable dim)
Pipeline
#
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
bfps/cpp/particles/particles_output_sampling_hdf5.hpp
+30
-0
30 additions, 0 deletions
bfps/cpp/particles/particles_output_sampling_hdf5.hpp
bfps/cpp/particles/particles_sampling.hpp
+11
-1
11 additions, 1 deletion
bfps/cpp/particles/particles_sampling.hpp
with
41 additions
and
1 deletion
bfps/cpp/particles/particles_output_sampling_hdf5.hpp
+
30
−
0
View file @
69b05e24
...
@@ -24,6 +24,36 @@ class particles_output_sampling_hdf5 : public abstract_particles_output<partsize
...
@@ -24,6 +24,36 @@ class particles_output_sampling_hdf5 : public abstract_particles_output<partsize
const
bool
use_collective_io
;
const
bool
use_collective_io
;
public:
public:
static
bool
DatasetExistsCol
(
MPI_Comm
in_mpi_com
,
const
std
::
string
&
in_filename
,
const
std
::
string
&
in_groupname
,
const
std
::
string
&
in_dataset_name
){
int
my_rank
;
AssertMpi
(
MPI_Comm_rank
(
in_mpi_com
,
&
my_rank
));
int
dataset_exists
=
-
1
;
if
(
my_rank
==
0
){
// Parallel HDF5 write
hid_t
file_id
=
H5Fopen
(
in_filename
.
c_str
(),
H5F_ACC_RDWR
|
H5F_ACC_DEBUG
,
H5P_DEFAULT
);
assert
(
file_id
>=
0
);
dataset_exists
=
H5Lexists
(
file_id
,
(
in_groupname
+
"/"
+
in_dataset_name
).
c_str
(),
H5P_DEFAULT
);
int
retTest
=
H5Fclose
(
file_id
);
assert
(
retTest
>=
0
);
}
AssertMpi
(
MPI_Bcast
(
&
dataset_exists
,
1
,
MPI_INT
,
0
,
in_mpi_com
));
return
dataset_exists
;
}
particles_output_sampling_hdf5
(
MPI_Comm
in_mpi_com
,
particles_output_sampling_hdf5
(
MPI_Comm
in_mpi_com
,
const
partsize_t
inTotalNbParticles
,
const
partsize_t
inTotalNbParticles
,
const
std
::
string
&
in_filename
,
const
std
::
string
&
in_filename
,
...
...
This diff is collapsed.
Click to expand it.
bfps/cpp/particles/particles_sampling.hpp
+
11
−
1
View file @
69b05e24
...
@@ -17,13 +17,23 @@ void sample_from_particles_system(const field<rnumber, be, fc>& in_field, // a p
...
@@ -17,13 +17,23 @@ void sample_from_particles_system(const field<rnumber, be, fc>& in_field, // a p
const
std
::
string
&
filename
,
const
std
::
string
&
filename
,
const
std
::
string
&
parent_groupname
,
const
std
::
string
&
parent_groupname
,
const
std
::
string
&
fname
){
const
std
::
string
&
fname
){
const
std
::
string
datasetname
=
fname
+
std
::
string
(
"/"
)
+
std
::
to_string
(
ps
->
get_step_idx
());
const
int
size_particle_rhs
=
ncomp
(
fc
);
const
int
size_particle_rhs
=
ncomp
(
fc
);
// Stop here if already exists
if
(
particles_output_sampling_hdf5
<
partsize_t
,
particles_rnumber
,
3
,
size_particle_rhs
>::
DatasetExistsCol
(
MPI_COMM_WORLD
,
filename
,
parent_groupname
,
datasetname
)){
return
;
}
const
partsize_t
nb_particles
=
ps
->
getLocalNbParticles
();
const
partsize_t
nb_particles
=
ps
->
getLocalNbParticles
();
std
::
unique_ptr
<
particles_rnumber
[]
>
sample_rhs
(
new
particles_rnumber
[
size_particle_rhs
*
nb_particles
]);
std
::
unique_ptr
<
particles_rnumber
[]
>
sample_rhs
(
new
particles_rnumber
[
size_particle_rhs
*
nb_particles
]);
ps
->
sample_compute_field
(
in_field
,
sample_rhs
.
get
());
ps
->
sample_compute_field
(
in_field
,
sample_rhs
.
get
());
const
std
::
string
datasetname
=
fname
+
std
::
string
(
"/"
)
+
std
::
to_string
(
ps
->
get_step_idx
());
particles_output_sampling_hdf5
<
partsize_t
,
particles_rnumber
,
3
,
size_particle_rhs
>
outputclass
(
MPI_COMM_WORLD
,
particles_output_sampling_hdf5
<
partsize_t
,
particles_rnumber
,
3
,
size_particle_rhs
>
outputclass
(
MPI_COMM_WORLD
,
ps
->
getGlobalNbParticles
(),
ps
->
getGlobalNbParticles
(),
...
...
This diff is collapsed.
Click to expand it.
Cristian Lalescu
@clalescu
mentioned in issue
#9 (closed)
·
8 years ago
mentioned in issue
#9 (closed)
mentioned in issue #9
Toggle commit list
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