PLUTO  4.4-patch2
Functions
particles_mpi_datatype.c File Reference

Define MPI data-type structure for MPI communications. More...

#include "pluto.h"
#include <stddef.h>

Functions

void Particles_SetID (particleNode *PHead)
 

Detailed Description

Define the MPI Datatype of the Particle structure so that it can be passed among processors. This has to be done for each PARTICLES type depending on the quantities present in the structure.

Authors
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
B. Vaidya (bvaid.nosp@m.ya@u.nosp@m.nito..nosp@m.it)
D. Mukherjee (dipan.nosp@m.jan..nosp@m.mukhe.nosp@m.rjee.nosp@m.@unit.nosp@m.o.it)
Date
Aug 17, 2020

References http://mpi.deino.net/mpi_functions/MPI_Type_create_struct.html https://stackoverflow.com/questions/33618937/trouble-understanding-mpi-type-create-struct https://stackoverflow.com/questions/9864510/struct-serialization-in-c-and-transfer-over-mpi

Function Documentation

◆ Particles_SetID()

void Particles_SetID ( particleNode *  PHead)

Assign id to newly injected particles. The id is incrementally assigned starting from the global counter p_idCounter.

|--------------|--------------|--------------|--------------|

[A] 1,2,3 4,5 6 7,8 = N0

[B] +dn(0)=2 +dn(1)=5 +dn(2)=3 +dn(3)=4

The new id must take the value:

rank #0: 1,2,3, [N0+1, N0+dn(0)] rank #1: 4,5, [N0+dn(0)+1, N0+dn(0)+dn(1)+1] rank #2: 6, [N0+dn(0)+dn(1)+1, N0+dn(0)+dn(1)+dn(2)+1] ...