This repository has been archived by the owner on Sep 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
v2.x: oshmem: Align OSHMEM API with spec v1.3 (alltoall) #1042
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7a53bad
oshmem: Align OSHMEM API with spec v1.3 (Add scoll/alltoall interface)
igor-ivanov 5a20198
oshmem: Align OSHMEM API with spec v1.3 (Add alltoall C function)
igor-ivanov 1ee6029
oshmem: Align OSHMEM API with spec v1.3 (Add alltoall Fortran)
igor-ivanov 17b5ba8
oshmem: Align OSHMEM API with spec v1.3 (Add man for alltoall)
igor-ivanov f3b7e4a
oshmem: Align OSHMEM API with spec v1.3 (update scoll/basic)
igor-ivanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
* Copyright (c) 2016 Mellanox Technologies, Inc. | ||
* All rights reserved. | ||
* $COPYRIGHT$ | ||
* | ||
* Additional copyrights may follow | ||
* | ||
* $HEADER$ | ||
*/ | ||
|
||
#include "oshmem_config.h" | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "oshmem/constants.h" | ||
#include "oshmem/op/op.h" | ||
#include "oshmem/mca/spml/spml.h" | ||
#include "oshmem/mca/scoll/scoll.h" | ||
#include "oshmem/mca/scoll/base/base.h" | ||
#include "scoll_basic.h" | ||
|
||
static int _algorithm_simple(struct oshmem_group_t *group, | ||
void *target, | ||
const void *source, | ||
ptrdiff_t dst, ptrdiff_t sst, | ||
size_t nelems, | ||
size_t element_size, | ||
long *pSync); | ||
|
||
int mca_scoll_basic_alltoall(struct oshmem_group_t *group, | ||
void *target, | ||
const void *source, | ||
ptrdiff_t dst, ptrdiff_t sst, | ||
size_t nelems, | ||
size_t element_size, | ||
long *pSync, | ||
int alg) | ||
{ | ||
int rc = OSHMEM_SUCCESS; | ||
|
||
/* Arguments validation */ | ||
if (!group) { | ||
SCOLL_ERROR("Active set (group) of PE is not defined"); | ||
rc = OSHMEM_ERR_BAD_PARAM; | ||
} | ||
|
||
/* Check if this PE is part of the group */ | ||
if ((rc == OSHMEM_SUCCESS) && oshmem_proc_group_is_member(group)) { | ||
int i = 0; | ||
|
||
if (pSync) { | ||
rc = _algorithm_simple(group, | ||
target, | ||
source, | ||
dst, | ||
sst, | ||
nelems, | ||
element_size, | ||
pSync); | ||
} else { | ||
SCOLL_ERROR("Incorrect argument pSync"); | ||
rc = OSHMEM_ERR_BAD_PARAM; | ||
} | ||
|
||
/* Restore initial values */ | ||
SCOLL_VERBOSE(12, | ||
"PE#%d Restore special synchronization array", | ||
group->my_pe); | ||
for (i = 0; pSync && (i < _SHMEM_ALLTOALL_SYNC_SIZE); i++) { | ||
pSync[i] = _SHMEM_SYNC_VALUE; | ||
} | ||
} | ||
|
||
return rc; | ||
} | ||
|
||
static int _algorithm_simple(struct oshmem_group_t *group, | ||
void *target, | ||
const void *source, | ||
ptrdiff_t tst, ptrdiff_t sst, | ||
size_t nelems, | ||
size_t element_size, | ||
long *pSync) | ||
{ | ||
int rc = OSHMEM_SUCCESS; | ||
int pe_cur; | ||
int i; | ||
int j; | ||
int k; | ||
|
||
SCOLL_VERBOSE(14, | ||
"[#%d] send data to all PE in the group", | ||
group->my_pe); | ||
j = oshmem_proc_group_find_id(group, group->my_pe); | ||
for (i = 0; i < group->proc_count; i++) { | ||
/* index permutation for better distribution of traffic */ | ||
k = (((j)+(i))%(group->proc_count)); | ||
pe_cur = oshmem_proc_pe(group->proc_array[k]); | ||
rc = MCA_SPML_CALL(put( | ||
(void *)((char *)target + j * tst * nelems * element_size), | ||
nelems * element_size, | ||
(void *)((char *)source + i * sst * nelems * element_size), | ||
pe_cur)); | ||
if (OSHMEM_SUCCESS != rc) { | ||
break; | ||
} | ||
} | ||
|
||
/* Wait for operation completion */ | ||
if (rc == OSHMEM_SUCCESS) { | ||
SCOLL_VERBOSE(14, "[#%d] Wait for operation completion", group->my_pe); | ||
rc = BARRIER_FUNC(group, | ||
(pSync + 1), | ||
SCOLL_DEFAULT_ALG); | ||
} | ||
|
||
return rc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did not see that in master, so i committed it in open-mpi/ompi@cb84f58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggouaillardet you are right. I noticed it too yesterday but forgot to push. Thank you.