1
1

Merge pull request #2299 from alex-mikheev/topic/oshmem_init_fix

OSHMEM: fixes crash during initialization
Этот коммит содержится в:
Mike Dubman 2016-10-27 14:48:33 +03:00 коммит произвёл GitHub
родитель 3d4285b04d 511dd43736
Коммит 83e3323646

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

@ -149,35 +149,37 @@ int oshmem_shmem_init(int argc, char **argv, int requested, int *provided)
if (!ompi_mpi_initialized && !ompi_mpi_finalized) {
ret = ompi_mpi_init(argc, argv, requested, provided);
}
if (OSHMEM_SUCCESS != ret) {
return ret;
}
PMPI_Comm_dup(MPI_COMM_WORLD, &oshmem_comm_world);
ret = _shmem_init(argc, argv, requested, provided);
if (OSHMEM_SUCCESS == ret) {
ret = _shmem_init(argc, argv, requested, provided);
if (OSHMEM_SUCCESS != ret) {
return ret;
}
oshmem_shmem_initialized = true;
if (OSHMEM_SUCCESS != shmem_lock_init()) {
SHMEM_API_ERROR( "shmem_lock_init() failed");
return OSHMEM_ERROR;
}
if (OSHMEM_SUCCESS == ret) {
oshmem_shmem_initialized = true;
/* this is a collective op, implies barrier */
MCA_MEMHEAP_CALL(get_all_mkeys());
if (OSHMEM_SUCCESS != shmem_lock_init()) {
SHMEM_API_ERROR( "shmem_lock_init() failed");
return OSHMEM_ERROR;
}
/* this is a collective op, implies barrier */
MCA_MEMHEAP_CALL(get_all_mkeys());
oshmem_shmem_preconnect_all();
oshmem_shmem_preconnect_all();
#if OSHMEM_OPAL_THREAD_ENABLE
pthread_t thread_id;
int perr;
perr = pthread_create(&thread_id, NULL, &shmem_opal_thread, NULL);
if (perr != 0)
{
SHMEM_API_ERROR("cannot creat opal thread for SHMEM");
return OSHMEM_ERROR;
}
#endif
pthread_t thread_id;
int perr;
perr = pthread_create(&thread_id, NULL, &shmem_opal_thread, NULL);
if (0 != perr) {
SHMEM_API_ERROR("cannot create opal thread for SHMEM");
return OSHMEM_ERROR;
}
#endif
}
#ifdef SIGUSR1
signal(SIGUSR1,sighandler__SIGUSR1);