-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* draft v1 * clippy * correctness * fmt * clippy * add mpi finalize * clippy * refactor; try make mpi compatible with threading * add finalize * clippy * try ci install * update * try mpi install * try mpi install * try mpi install * try mpi install * refactor * clippy * identify structure info * clippy * main-mpi * mpi_config * mpiexec in ci * intentially fail ci for mpi * now correct * minor in toml * Update ci.yml Signed-off-by: Tiancheng Xie <[email protected]> * allow static mut ref * Update build.yml Signed-off-by: Tiancheng Xie <[email protected]> * Update ci.yml Signed-off-by: Tiancheng Xie <[email protected]> * Merge CI change (#106) * [FIX] m31 exp (#96) * chore: test vectors for M31 * fix: M31 exponentiation --------- Co-authored-by: enpsi <[email protected]> * fix ci (#104) --------- Co-authored-by: 0xwework <[email protected]> Co-authored-by: enpsi <[email protected]> Co-authored-by: zhenfei <[email protected]> --------- Signed-off-by: Tiancheng Xie <[email protected]> Co-authored-by: Tiancheng Xie <[email protected]> Co-authored-by: 0xwework <[email protected]> Co-authored-by: enpsi <[email protected]> Co-authored-by: zhenfei <[email protected]>
- Loading branch information
1 parent
10215e1
commit 3df9ca0
Showing
33 changed files
with
1,634 additions
and
848 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import subprocess | ||
from sys import platform | ||
|
||
if __name__ == "__main__": | ||
if platform == "darwin": # mac os | ||
subprocess.run(["brew", "install", "openmpi"]) | ||
else: | ||
pass # Do nothing, assuming mpi has already been installed |
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,44 @@ | ||
import sys | ||
import json | ||
import subprocess | ||
|
||
MPI_CONFIG_JSON = ''' | ||
{ | ||
"field": "gf2ext128", | ||
"n_groups": 2, | ||
"mpi_size_each_group": 8, | ||
"cpu_ids": | ||
[ | ||
[0, 1, 2, 3, 4, 5, 6, 7], | ||
[8, 9, 10, 11, 12, 13, 14, 15] | ||
] | ||
} | ||
''' | ||
|
||
def parse_config(mpi_config): | ||
field = mpi_config["field"] | ||
n_groups = mpi_config["n_groups"] | ||
mpi_size_each_group = mpi_config["mpi_size_each_group"] | ||
cpu_ids = mpi_config["cpu_ids"] | ||
|
||
if field not in ["gf2ext128", "m31ext3", "fr"]: | ||
sys.exit("Unrecognized field, now only supports gf2ext128, m31ext3 and fr") | ||
|
||
if n_groups != len(cpu_ids): | ||
sys.exit("Lack/Too much cpu specifications.") | ||
|
||
for i in range(n_groups): | ||
if len(cpu_ids[i]) != mpi_size_each_group: | ||
sys.exit(f"Cpu ids are not correct for group {i}") | ||
|
||
return field, n_groups, mpi_size_each_group, cpu_ids | ||
|
||
|
||
# Run two mpi process | ||
if __name__ == "__main__": | ||
mpi_config = json.loads(MPI_CONFIG_JSON) | ||
field, n_groups, mpi_size_each_group, cpu_ids = parse_config(mpi_config) | ||
|
||
for i in range(n_groups): | ||
cpu_id = ",".join(map(str, cpu_ids[i])) | ||
subprocess.Popen(["mpiexec", "-cpu-set", cpu_id, "-n", str(mpi_size_each_group), "./target/release/expander-rs-mpi", "-f", field]) |
Oops, something went wrong.