Révision 190
| Pi/XPU/PiXpuMPI.py (revision 190) | ||
|---|---|---|
| 75 | 75 |
RNG='MWC' |
| 76 | 76 |
# Value type : INT32, INT64, FP32, FP64 |
| 77 | 77 |
ValueType='FP32' |
| 78 |
|
|
| 79 |
HowToUse='%s -c (Print Curves) -d <DeviceId> -g <CUDA/OpenCL> -i <Iterations> -b <BlocksBegin> -e <BlocksEnd> -s <BlocksStep> -f <ThreadsFirst> -l <ThreadsLast> -t <ThreadssTep> -r <RedoToImproveStats> -m <SHR3/CONG/MWC/KISS> -v <INT32/INT64/FP32/FP64>' |
|
| 78 |
# Inside based on If |
|
| 79 |
IfThen=False |
|
| 80 |
|
|
| 81 |
HowToUse='%s -c (Print Curves) -k (Case On IfThen) -d <DeviceId> -g <CUDA/OpenCL> -i <Iterations> -b <BlocksBegin> -e <BlocksEnd> -s <BlocksStep> -f <ThreadsFirst> -l <ThreadsLast> -t <ThreadssTep> -r <RedoToImproveStats> -m <SHR3/CONG/MWC/KISS> -v <INT32/INT64/FP32/FP64>' |
|
| 80 | 82 |
|
| 81 | 83 |
try: |
| 82 |
opts, args = getopt.getopt(sys.argv[1:],"hcg:i:b:e:s:f:l:t:r:d:m:v:",["gpustyle=","iterations=","blocksBegin=","blocksEnd=","blocksStep=","threadsFirst=","threadsLast=","threadssTep=","redo=","device=","marsaglia=","valuetype="]) |
|
| 84 |
opts, args = getopt.getopt(sys.argv[1:],"hckg:i:b:e:s:f:l:t:r:d:m:v:",["gpustyle=","iterations=","blocksBegin=","blocksEnd=","blocksStep=","threadsFirst=","threadsLast=","threadssTep=","redo=","device=","marsaglia=","valuetype="])
|
|
| 83 | 85 |
except getopt.GetoptError: |
| 84 | 86 |
print(HowToUse % sys.argv[0]) |
| 85 | 87 |
sys.exit(2) |
| ... | ... | |
| 124 | 126 |
|
| 125 | 127 |
elif opt == '-c': |
| 126 | 128 |
Curves=True |
| 129 |
elif opt == '-k': |
|
| 130 |
IfThen=True |
|
| 127 | 131 |
elif opt in ("-d", "--device"):
|
| 128 | 132 |
Devices.append(int(arg)) |
| 129 | 133 |
elif opt in ("-g", "--gpustyle"):
|
| ... | ... | |
| 240 | 244 |
InputCL['RNG']=RNG |
| 241 | 245 |
InputCL['ValueType']=ValueType |
| 242 | 246 |
InputCL['GpuStyle']=GpuStyle |
| 247 |
InputCL['IfThen']=IfThen |
|
| 243 | 248 |
|
| 244 | 249 |
for Device in Devices[1:]: |
| 245 | 250 |
print("Send to device %i on rank %i" % (Device,r))
|
| Pi/XPU/PiXpuThreads.py (revision 190) | ||
|---|---|---|
| 78 | 78 |
RNG='MWC' |
| 79 | 79 |
# Value type : INT32, INT64, FP32, FP64 |
| 80 | 80 |
ValueType='FP32' |
| 81 |
# Inside based on If |
|
| 82 |
IfThen=False |
|
| 81 | 83 |
|
| 82 |
HowToUse='%s -c (Print Curves) -d <DeviceId> -g <CUDA/OpenCL> -i <Iterations> -b <BlocksBegin> -e <BlocksEnd> -s <BlocksStep> -f <ThreadsFirst> -l <ThreadsLast> -t <ThreadssTep> -r <RedoToImproveStats> -m <SHR3/CONG/MWC/KISS> -v <INT32/INT64/FP32/FP64>' |
|
| 84 |
HowToUse='%s -c (Print Curves) -k (Case On IfThen) -d <DeviceId> -g <CUDA/OpenCL> -i <Iterations> -b <BlocksBegin> -e <BlocksEnd> -s <BlocksStep> -f <ThreadsFirst> -l <ThreadsLast> -t <ThreadssTep> -r <RedoToImproveStats> -m <SHR3/CONG/MWC/KISS> -v <INT32/INT64/FP32/FP64>'
|
|
| 83 | 85 |
|
| 84 | 86 |
try: |
| 85 |
opts, args = getopt.getopt(sys.argv[1:],"hcg:i:b:e:s:f:l:t:r:d:m:v:",["gpustyle=","iterations=","blocksBegin=","blocksEnd=","blocksStep=","threadsFirst=","threadsLast=","threadssTep=","redo=","device=","marsaglia=","valuetype="]) |
|
| 87 |
opts, args = getopt.getopt(sys.argv[1:],"hckg:i:b:e:s:f:l:t:r:d:m:v:",["gpustyle=","iterations=","blocksBegin=","blocksEnd=","blocksStep=","threadsFirst=","threadsLast=","threadssTep=","redo=","device=","marsaglia=","valuetype="])
|
|
| 86 | 88 |
except getopt.GetoptError: |
| 87 | 89 |
print(HowToUse % sys.argv[0]) |
| 88 | 90 |
sys.exit(2) |
| ... | ... | |
| 127 | 129 |
|
| 128 | 130 |
elif opt == '-c': |
| 129 | 131 |
Curves=True |
| 132 |
elif opt == '-k': |
|
| 133 |
IfThen=True |
|
| 130 | 134 |
elif opt in ("-d", "--device"):
|
| 131 | 135 |
Devices.append(int(arg)) |
| 132 | 136 |
elif opt in ("-g", "--gpustyle"):
|
| ... | ... | |
| 243 | 247 |
InputCL['Device']=Device |
| 244 | 248 |
InputCL['RNG']=RNG |
| 245 | 249 |
InputCL['ValueType']=ValueType |
| 250 |
InputCL['IfThen']=IfThen |
|
| 246 | 251 |
if GpuStyle=='CUDA': |
| 247 | 252 |
try: |
| 248 | 253 |
MyThread=threadWithReturn(target=MetropolisCuda, args=(InputCL,)) |
Formats disponibles : Unified diff