|
29 | 29 | #include "tools.h" |
30 | 30 |
|
31 | 31 | #include <algorithm> |
| 32 | +#include <cstdlib> |
32 | 33 | #include <cstdio> |
33 | 34 | #include <cstring> |
34 | 35 | #include <unistd.h> |
@@ -117,6 +118,10 @@ int main(int argc, char *argv[]) { |
117 | 118 | int numWarmupIters = args.getWarmupIters(); |
118 | 119 | int localRegister = args.getLocalRegister(); |
119 | 120 | uint64_t splitMask = args.getSplitMask(); |
| 121 | + const bool skipPutValue = [] { |
| 122 | + const char *value = std::getenv("FLAGCX_SKIP_PUT_VALUE"); |
| 123 | + return value != nullptr && value[0] != '\0' && value[0] != '0'; |
| 124 | + }(); |
120 | 125 |
|
121 | 126 | if (stepFactor <= 1) { |
122 | 127 | printf("Error: stepFactor must be > 1, got %d\n", stepFactor); |
@@ -276,16 +281,23 @@ int main(int argc, char *argv[]) { |
276 | 281 | MPI_Barrier(MPI_COMM_WORLD); |
277 | 282 |
|
278 | 283 | // --- K3: PutValue --- |
279 | | - FLAGCXCHECK(devHandle->deviceMemset((char *)recvBuff + putValBase, 0, |
280 | | - (size_t)totalProcs * sizeof(uint64_t), |
281 | | - flagcxMemDevice, NULL)); |
282 | | - FLAGCXCHECK(flagcxInterTestPutValue(recvMem, devComm, stream, putValBase)); |
283 | | - FLAGCXCHECK(devHandle->streamSynchronize(stream)); |
284 | | - FLAGCXCHECK(devHandle->deviceMemcpy( |
285 | | - (char *)hostBuff + putValBase, (char *)recvBuff + putValBase, |
286 | | - (size_t)totalProcs * sizeof(uint64_t), flagcxMemcpyDeviceToHost, NULL)); |
287 | | - bool k3Ok = verifyPutValue(hostBuff, putValBase, totalProcs, proc); |
288 | | - printResult("K3 PutValue", k3Ok, proc); |
| 284 | + if (skipPutValue) { |
| 285 | + if (proc == 0 && color == 0) |
| 286 | + printf(" %-30s SKIPPED\n", "K3 PutValue"); |
| 287 | + } else { |
| 288 | + FLAGCXCHECK(devHandle->deviceMemset( |
| 289 | + (char *)recvBuff + putValBase, 0, |
| 290 | + (size_t)totalProcs * sizeof(uint64_t), flagcxMemDevice, NULL)); |
| 291 | + FLAGCXCHECK( |
| 292 | + flagcxInterTestPutValue(recvMem, devComm, stream, putValBase)); |
| 293 | + FLAGCXCHECK(devHandle->streamSynchronize(stream)); |
| 294 | + FLAGCXCHECK(devHandle->deviceMemcpy( |
| 295 | + (char *)hostBuff + putValBase, (char *)recvBuff + putValBase, |
| 296 | + (size_t)totalProcs * sizeof(uint64_t), flagcxMemcpyDeviceToHost, |
| 297 | + NULL)); |
| 298 | + bool k3Ok = verifyPutValue(hostBuff, putValBase, totalProcs, proc); |
| 299 | + printResult("K3 PutValue", k3Ok, proc); |
| 300 | + } |
289 | 301 | MPI_Barrier(MPI_COMM_WORLD); |
290 | 302 |
|
291 | 303 | // --- K4: Get --- |
|
0 commit comments