1
1

- fix a sm bug that causes segfaults in the case of threaded builds.

The problem is that in the case of threaded builds for every fifo
  a head and tail lock will be allocated inside the shared memory
  segment and the ptr is stored inside the fifo. In the case that the sm backend
  file will be mapped in all processes at the same address (mostly the
  case for non-thread builds) this is fine, but in the cases when the
  processes map the file at different addresses this addresses cause big
  trouble in other processes than the one that allocted the locks. 
  Therefore the send lock addresses have to be recalculated to match
  the local mapping of the processes that use them.

This commit was SVN r15291.
Этот коммит содержится в:
Sven Stork 2007-07-05 14:26:32 +00:00
родитель 74008aac53
Коммит 21f12f29f8

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -518,6 +518,11 @@ int mca_btl_sm_add_procs(
mca_btl_sm_component.fifo[j] = (ompi_fifo_t*)((char*)fifo_tmp[j]+diff);
mca_btl_sm_component.sm_offset[j] = diff;
/* don't forget to update the head_lock if allocated because this address is also in the remote process */
if ( mca_btl_sm_component.fifo[j][mca_btl_sm_component.my_smp_rank].head_lock != NULL ) {
mca_btl_sm_component.fifo[j][mca_btl_sm_component.my_smp_rank].head_lock =
(opal_atomic_lock_t*)((char*)mca_btl_sm_component.fifo[j][mca_btl_sm_component.my_smp_rank].head_lock+diff);
}
}
for( j=mca_btl_sm_component.num_smp_procs ; j <