@@ -494,4 +494,235 @@ private native long rGet(
494494 int targetRank , int targetDisp , int targetCount , long targetType ,
495495 int baseType ) throws MPIException ;
496496
497+ /**
498+ * Java binding of {@code MPI_RACCUMULATE}.
499+ * @param origin origin buffer
500+ * @param orgCount number of entries in origin buffer
501+ * @param orgType datatype of each entry in origin buffer
502+ * @param targetRank rank of target
503+ * @param targetDisp displacement from start of window to target buffer
504+ * @param targetCount number of entries in target buffer
505+ * @param targetType datatype of each entry in target buffer
506+ * @param op reduce operation
507+ * @return RMA request
508+ * @throws MPIException
509+ */
510+ public Request rAccumulate (Buffer origin , int orgCount , Datatype orgType ,
511+ int targetRank , int targetDisp , int targetCount ,
512+ Datatype targetType , Op op )
513+ throws MPIException
514+ {
515+ MPI .check ();
516+
517+ if (!origin .isDirect ())
518+ throw new IllegalArgumentException ("The origin must be direct buffer." );
519+
520+ return new Request (rAccumulate (handle , origin , orgCount , orgType .handle ,
521+ targetRank , targetDisp , targetCount , targetType .handle ,
522+ op , op .handle , getBaseType (orgType , targetType )));
523+ }
524+
525+ private native long rAccumulate (
526+ long win , Buffer origin , int orgCount , long orgType ,
527+ int targetRank , int targetDisp , int targetCount , long targetType ,
528+ Op jOp , long hOp , int baseType ) throws MPIException ;
529+
530+ /**
531+ * Java binding of {@code MPI_GET_ACCUMULATE}.
532+ * @param origin origin buffer
533+ * @param orgCount number of entries in origin buffer
534+ * @param orgType datatype of each entry in origin buffer
535+ * @param resultAddr result buffer
536+ * @param resultCount number of entries in result buffer
537+ * @param resultType datatype of each entry in result buffer
538+ * @param targetRank rank of target
539+ * @param targetDisp displacement from start of window to target buffer
540+ * @param targetCount number of entries in target buffer
541+ * @param targetType datatype of each entry in target buffer
542+ * @param op reduce operation
543+ * @throws MPIException
544+ */
545+
546+ public void getAccumulate (Buffer origin , int orgCount , Datatype orgType ,
547+ Buffer resultAddr , int resultCount , Datatype resultType ,
548+ int targetRank , int targetDisp , int targetCount ,
549+ Datatype targetType , Op op )
550+ throws MPIException
551+ {
552+ MPI .check ();
553+
554+ if (!origin .isDirect ())
555+ throw new IllegalArgumentException ("The origin must be direct buffer." );
556+
557+ getAccumulate (handle , origin , orgCount , orgType .handle ,
558+ resultAddr , resultCount , resultType .handle ,
559+ targetRank , targetDisp , targetCount , targetType .handle ,
560+ op , op .handle , getBaseType (orgType , targetType ));
561+ }
562+
563+ private native void getAccumulate (
564+ long win , Buffer origin , int orgCount , long orgType ,
565+ Buffer resultAddr , int resultCount , long resultType ,
566+ int targetRank , int targetDisp , int targetCount , long targetType ,
567+ Op jOp , long hOp , int baseType ) throws MPIException ;
568+
569+ /**
570+ * Java binding of {@code MPI_RGET_ACCUMULATE}.
571+ * @param origin origin buffer
572+ * @param orgCount number of entries in origin buffer
573+ * @param orgType datatype of each entry in origin buffer
574+ * @param resultAddr result buffer
575+ * @param resultCount number of entries in result buffer
576+ * @param resultType datatype of each entry in result buffer
577+ * @param targetRank rank of target
578+ * @param targetDisp displacement from start of window to target buffer
579+ * @param targetCount number of entries in target buffer
580+ * @param targetType datatype of each entry in target buffer
581+ * @param op reduce operation
582+ * @return RMA request
583+ * @throws MPIException
584+ */
585+
586+ public Request rGetAccumulate (Buffer origin , int orgCount , Datatype orgType ,
587+ Buffer resultAddr , int resultCount , Datatype resultType ,
588+ int targetRank , int targetDisp , int targetCount ,
589+ Datatype targetType , Op op )
590+ throws MPIException
591+ {
592+ MPI .check ();
593+
594+ if (!origin .isDirect ())
595+ throw new IllegalArgumentException ("The origin must be direct buffer." );
596+
597+ return new Request (rGetAccumulate (handle , origin , orgCount , orgType .handle ,
598+ resultAddr , resultCount , resultType .handle ,
599+ targetRank , targetDisp , targetCount , targetType .handle ,
600+ op , op .handle , getBaseType (orgType , targetType )));
601+ }
602+
603+ private native long rGetAccumulate (
604+ long win , Buffer origin , int orgCount , long orgType ,
605+ Buffer resultAddr , int resultCount , long resultType ,
606+ int targetRank , int targetDisp , int targetCount , long targetType ,
607+ Op jOp , long hOp , int baseType ) throws MPIException ;
608+
609+ /**
610+ * Java binding of the MPI operation {@code MPI_WIN_LOCK_ALL}.
611+ * @param assertion program assertion
612+ * @throws MPIException
613+ */
614+ public void lockAll (int assertion ) throws MPIException
615+ {
616+ MPI .check ();
617+ lockAll (handle , assertion );
618+ }
619+
620+ private native void lockAll (long win , int assertion )
621+ throws MPIException ;
622+
623+ /**
624+ * Java binding of the MPI operation {@code MPI_WIN_UNLOCK_ALL}.
625+ * @throws MPIException
626+ */
627+ public void unlockAll () throws MPIException
628+ {
629+ MPI .check ();
630+ unlockAll (handle );
631+ }
632+
633+ private native void unlockAll (long win ) throws MPIException ;
634+
635+ /**
636+ * Java binding of the MPI operation {@code MPI_WIN_SYNC}.
637+ * @throws MPIException
638+ */
639+ public void sync () throws MPIException
640+ {
641+ MPI .check ();
642+ sync (handle );
643+ }
644+
645+ private native void sync (long win ) throws MPIException ;
646+
647+ /**
648+ * Java binding of the MPI operation {@code MPI_WIN_FLUSH}.
649+ * @param targetRank rank of target window
650+ * @throws MPIException
651+ */
652+ public void flush (int targetRank ) throws MPIException
653+ {
654+ MPI .check ();
655+ flush (handle , targetRank );
656+ }
657+
658+ private native void flush (long win , int targetRank ) throws MPIException ;
659+
660+ /**
661+ * Java binding of the MPI operation {@code MPI_WIN_FLUSH_ALL}.
662+ * @throws MPIException
663+ */
664+ public void flushAll () throws MPIException
665+ {
666+ MPI .check ();
667+ flushAll (handle );
668+ }
669+
670+ private native void flushAll (long win ) throws MPIException ;
671+
672+ /**
673+ * Java binding of {@code MPI_COMPARE_AND_SWAP}.
674+ * @param origin origin buffer
675+ * @param compareAddr compare buffer
676+ * @param resultAddr result buffer
677+ * @param targetType datatype of each entry in target buffer
678+ * @param targetRank rank of target
679+ * @param targetDisp displacement from start of window to target buffer
680+ * @throws MPIException
681+ */
682+
683+ public void compareAndSwap (Buffer origin , Buffer compareAddr , Buffer resultAddr ,
684+ Datatype targetType , int targetRank , int targetDisp )
685+ throws MPIException
686+ {
687+ MPI .check ();
688+
689+ if (!origin .isDirect ())
690+ throw new IllegalArgumentException ("The origin must be direct buffer." );
691+
692+ compareAndSwap (handle , origin , compareAddr , resultAddr ,
693+ targetType .handle , targetRank , targetDisp );
694+ }
695+
696+ private native void compareAndSwap (
697+ long win , Buffer origin , Buffer compareAddr , Buffer resultAddr ,
698+ long targetType , int targetRank , int targetDisp ) throws MPIException ;
699+
700+ /**
701+ * Java binding of {@code MPI_FETCH_AND_OP}.
702+ * @param origin origin buffer
703+ * @param resultAddr result buffer
704+ * @param dataType datatype of entry in origin, result, and target buffers
705+ * @param targetRank rank of target
706+ * @param targetDisp displacement from start of window to target buffer
707+ * @param op reduce operation
708+ * @throws MPIException
709+ */
710+
711+ public void fetchAndOp (Buffer origin , Buffer resultAddr , Datatype dataType ,
712+ int targetRank , int targetDisp , Op op )
713+ throws MPIException
714+ {
715+ MPI .check ();
716+
717+ if (!origin .isDirect ())
718+ throw new IllegalArgumentException ("The origin must be direct buffer." );
719+
720+ fetchAndOp (handle , origin , resultAddr , dataType .handle , targetRank ,
721+ targetDisp , op , op .handle , getBaseType (dataType , dataType )); //neccessary?
722+ }
723+
724+ private native void fetchAndOp (
725+ long win , Buffer origin , Buffer resultAddr , long targetType , int targetRank ,
726+ int targetDisp , Op jOp , long hOp , int baseType ) throws MPIException ;
727+
497728} // Win
0 commit comments