Crash when Parallelization is used for O.bodies.replaceByClumps

Bug #1559098 reported by Adel ALBABA
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Medium
Anton Gladky

Bug Description

The script crashes (Erreur de segmentation (core dumped) ) when I try use more than one core, at the line O.bodies.replaceByClumps.

YADE version: the latest one complied from getHub trunk

A simple script:

# encoding: utf-8

# Sphere package:

sp1=pack.SpherePack()

# Create the spheres of the package:
sp1.makeCloud((0,0,0),(0.5,0.5,0.5),rMean=0.0075,rRelFuzz=0.33)

# Send them to the simulation:
sp1.toSimulation()

# Replace spheres with clumps:
templates= []

relRadList1=[0.0075,0.0075]

relPosList1=[[0.0075,0,0],[0.0075*2,0,0]]

templates.append(clumpTemplate(relRadii=relRadList1,relPositions=relPosList1))

clumpIds=O.bodies.replaceByClumps(templates,[1]) # THE SCRIPT CRASHES BECAUSE OF THIS LINE !

Adel

Revision history for this message
Christian Jakob (jakob-ifgt) wrote :

Did you try your script with material definitions and some basic engines?

Revision history for this message
Adel ALBABA (adel-1) wrote : Re: [Bug 1559098] Re: Crash when Parallelization is used for O.bodies.replaceByClumps

Yes, I did, it is always the same problem when I try to use more than
one core

Adel

On 18/03/2016 14:47, Christian Jakob wrote:
> Did you try your script with material definitions and some basic
> engines?
>

--
Adel ALBABA
PostDoc Researcher
IRSTEA - Grenoble
Unité de Recherche Erosion Torrentielle Neige et Avalanches
Domaine Universitaire, BP 76
F38402 - Saint Martin d'Hères Cedex - France

Tel: +33 (0)4 76 76 27 27
Mobile: +33 (0)6 65 94 28 20
Website: www.mumolade.com/fellows/esr12-adel-albaba
www.linkedin.com/pub/adel-albaba/4b/814/665

Revision history for this message
Christian Jakob (jakob-ifgt) wrote :

Is the original example (somewhere in examples/clumps/) working in multicore mode (I can not test right now)?

And I have another note: You do not need to set particle dimensions in relRadList and relPosList. You can use any value for X in the following code and the result should be the same, so why not use X=1?

relRadList1=[X,X]

relPosList1=[[-X,0,0],[X,0,0]] #(has the same effect as [[X,0,0],[2*X,0,0]])

Revision history for this message
Anton Gladky (gladky-anton) wrote :

Should be fixed in e35535b.

@Christian. I needed to remove parallel execution of that algorithm, because it was buggy. If one need to make it correctly, we need to collect new bodies and removal list in a thread-safe containers (openmp-accu). In your case you did insert/removal on body container parallelly, but it is not thread-safe, that is why one get segfault.

Regards

Anton

Changed in yade:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Anton Gladky (gladky-anton)
Changed in yade:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.