static int myvalue = 0;
-
+static void test_opts(int* argc, char **argv[]){
+ int found = 0, ret;
+ static struct option long_options[] = {
+ {"long", no_argument, 0, 0 },
+ {0, 0, 0, 0 }
+ };
+ while (1) {
+ ret = getopt_long_only(*argc, *argv, "s",
+ long_options, NULL);
+ if(ret==-1)
+ break;
+
+ switch (ret) {
+ case 0:
+ found++;
+ break;
+ case 's':
+ found ++;
+ break;
+ default:
+ printf("option %s", long_options[0].name);
+ break;
+ }
+ }
+ if (found!=2){
+ printf("(smpi_)getopt_long_only failed ! \n");
+ }
+}
int main(int argc, char **argv)
{
int me;
MPI_Init(&argc, &argv);
+ /* test getopt_long function */
+ test_opts(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &me);
p Test privatization
! timeout 5
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:${privatization:=1} --log=simix_context.thres:error --log=xbt_memory_map.thres:critical
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization -s -long --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:${privatization:=1} --log=simix_context.thres:error --log=xbt_memory_map.thres:critical
> You requested to use 32 ranks, but there is only 5 processes in your hostfile...
XBT_LOG_NEW_DEFAULT_CATEGORY(dsend,"the dsend test");
-int main()
+static void test_opts(int* argc, char **argv[]){
+ int found = 0, ret;
+ int option_index = 0;
+ static struct option long_options[] = {
+ {"long", no_argument, 0, 0 },
+ {0, 0, 0, 0 }
+ };
+ while (1) {
+ ret = getopt_long(*argc, *argv, "s",
+ long_options, &option_index);
+ if(ret==-1)
+ break;
+
+ switch (ret) {
+ case 0:
+ found++;
+ break;
+ case 's':
+ found ++;
+ break;
+ default:
+ printf("option %s", long_options[option_index].name);
+ break;
+ }
+ }
+ if (found!=2){
+ printf("(smpi_)getopt_long failed ! \n");
+ }
+}
+
+int main(int argc, char *argv[])
{
int rank;
int32_t data=11;
MPI_Init(NULL, NULL);
+
+ /* test getopt_long function */
+ test_opts(&argc, &argv);
+
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Request r;
if (rank==1) {
p Test dsend
! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
> [Jupiter:1:(2) 0.000000] [dsend/INFO] rank 1: data exchanged
> [Tremblay:0:(1) 0.005890] [dsend/INFO] rank 0: data exchanged
> [rank 0] -> Tremblay
p process 1 will finish at 0.5+2*4 (send) + 1+0.1*4 (isend) = 9.9s
p process 2 will finish at 0.5+2*4 (time before first send) + 2*(1+0.5*4) (recv+irecv) + 0.005890 (network time, same as before) = 14.505890s
! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -q --log=smpi_kernel.thres:warning --cfg=smpi/or:0:1:0.5 --cfg=smpi/os:0:0.5:2 --cfg=smpi/ois:0:1:0.1 --cfg=smpi/simulate-computation:no --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --log=smpi_kernel.thres:warning --cfg=smpi/or:0:1:0.5 --cfg=smpi/os:0:0.5:2 --cfg=smpi/ois:0:1:0.1 --cfg=smpi/simulate-computation:no --log=xbt_cfg.thres:warning
> [Jupiter:1:(2) 9.900000] [dsend/INFO] rank 1: data exchanged
> [Tremblay:0:(1) 14.505890] [dsend/INFO] rank 0: data exchanged
> [rank 0] -> Tremblay
#include <stdio.h>
#include <mpi.h>
+static void test_opts(int* argc, char **argv[]){
+ int found = 0, ret;
+ while ((ret = getopt(*argc, *argv, "s")) >= 0)
+ {
+ switch (ret) {
+ case 's':
+ found = 1;
+ break;
+ }
+ }
+ if (found!=1){
+ printf("(smpi_)getopt failed ! \n");
+ }
+}
+
int main(int argc, char *argv[])
{
const int tag1 = 42;
MPI_Status status;
int err = MPI_Init(&argc, &argv); /* Initialize MPI */
+
+ /* test getopt function */
+ test_opts(&argc, &argv);
+
if (err != MPI_SUCCESS) {
printf("MPI initialization failed!\n");
exit(1);
p Test pingpong
! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -s --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> *** Ping-pong test (MPI_Send/MPI_Recv) ***
>
>